Commit Graph

50364 Commits

Author SHA1 Message Date
nickysn
f29492bdea * at -O3 level, convert i:=i and/or/xor k to the new in_[and/or/xor]_assign_x_y
inline nodes, which should generate better code for certain CPU targets,
  including x86. Note that the optimization isn't applied yet for all integer
  types (those that have extra implicit typecasts, inserted by the compiler,
  aren't handled yet).

git-svn-id: trunk@35685 -
2017-03-29 15:20:57 +00:00
nickysn
f19ebe2acf * fixed compiler internal error in the in_[and/or/xor]_assign_x_y inline nodes
when their second parameter is a large 64-bit unsigned constant

git-svn-id: trunk@35684 -
2017-03-29 14:55:07 +00:00
michael
b62a833a01 * Patch from Mattias Gaertner
- allow only String, no other string types
  - assigned(array)
  - tpasargument proc type

git-svn-id: trunk@35683 -
2017-03-29 11:38:42 +00:00
michael
6ab7bc9def * Patch from Mattias Gaertner:
- function type

git-svn-id: trunk@35682 -
2017-03-29 11:38:02 +00:00
michael
0653c7045e * Patch from Mattias Gaertner
- assigned(array)
  - open array: override, pass array literal, pass var
  - reporting type mismatches shows full path if necessary
  - fixed comparing basetype from different units
  - types with unitname

git-svn-id: trunk@35681 -
2017-03-29 11:37:16 +00:00
michael
bfd78af212 * Patch from Mattias Gaertner:
- fixed source pos of function type
  - fixes closing asm..end block

git-svn-id: trunk@35680 -
2017-03-29 11:36:10 +00:00
nickysn
8033392554 * on 16-bit CPUs remove unnecessary 32-bit conversions of integers, that are
later converted back to 16 bits

git-svn-id: trunk@35679 -
2017-03-29 10:49:32 +00:00
Károly Balogh
6d795df166 m68k: removed silly debug writeln accidentally left in r35671
git-svn-id: trunk@35673 -
2017-03-28 11:57:17 +00:00
Károly Balogh
eeb660017e m68k: improve floating point compares against memory references by swapping sides when left is a reference and right is a register
git-svn-id: trunk@35672 -
2017-03-28 11:50:39 +00:00
Károly Balogh
21468861d4 m68k: handle more reg_ref and ref_reg operations more flexibly on the cg level. these OPs should get utilized better with some of the upcoming inline nodes
git-svn-id: trunk@35671 -
2017-03-28 09:57:14 +00:00
sergei
8ae0864c9a * x86 Intel asm reader: handle special variables "self" and "result" similar to regular ones in terms of subscripting. This makes fix from r34911 apply to these special variables. Resolves #31542.
git-svn-id: trunk@35669 -
2017-03-27 19:58:55 +00:00
michael
52c9e272d2 * Patch from Mattias Gaertner
- ord(char), chr()
    - typecast boolean to integer
    - typecast integer to boolean
    - open arrays, same as dynamic arrays
    - Pascal descendant of external class can define a newinstance class
      function
    - allow to type cast any class to any root class
    - jsvalue
      - init as undefined
      - assign to jsvalue := integer, string, boolean, double, char
      - type cast base types to jsvalue
      - type cast jsvalue to base type
         integer: Math.floor(jsvalue)
         boolean: !(jsvalue == false)
         double: rtl.getNumber(jsvalue)
         string: ""+jsvalue
         char: rtl.getChar(jsvalue)
      - enums: assign to jsvalue, typecast jsvalue to enum
      - class instance: assign to jsvalue, typecast jsvalue to a class
      - class of: assign to jsvalue, typecast jsvalue to a class-of
      - array of jsvalue
      - parameter, result type, assign from/to untyped

git-svn-id: trunk@35668 -
2017-03-27 10:34:50 +00:00
michael
a5919aa63f * Patch from Mattias Gaertner:
pastree: fixed double iterations in foreach
  parser: fixed skipping token after var declaration without checking
  pasresolver: 
  - ord(char), chr()
  - method visibility: warn and fix if override has lower visibility
  - open arrays
  - allow descendants to add their own base types
  - typecast to alias type
  pasuseanalyzer: support public modifier

git-svn-id: trunk@35667 -
2017-03-27 10:33:53 +00:00
nickysn
fc59649a98 + added inline nodes for handling and/or/xor in place (i.e. x:=x op y, where
op=and/or/xor). They generate more optimal code on certain architectures
  (including x86). The new inline nodes aren't generated by the compiler yet,
  but will be used in the future, at certain optimization levels, whenever the
  pattern x:=x op y is detected by the compiler.

git-svn-id: trunk@35666 -
2017-03-26 23:16:53 +00:00
florian
73c46a5988 - removed unused constants
git-svn-id: trunk@35664 -
2017-03-26 13:06:34 +00:00
florian
0897bd154a + align(<int64>,<int64>) and align(<qword>,<qword>), resolves an issue reported on the mailing list with large records
+ tests
* trecordsymtable.insertunionst takes a asizeint parameter
* changed one aint into a asizeint

git-svn-id: trunk@35662 -
2017-03-26 09:35:56 +00:00
florian
74423b88e0 * comment on border between linear list and jmp tree for case statements extended
git-svn-id: trunk@35661 -
2017-03-26 07:36:58 +00:00
nickysn
5cb724edd9 + added optimized implementation of a_op64_reg_ref for i386 as well; improves
generated code for inc(int64_var,int64_var) and dec(int64_var,int64_var)

git-svn-id: trunk@35660 -
2017-03-25 21:40:20 +00:00
joost
59cd3891e1 * Replaced calls to procedures that depend on global variables, which
are not always set

git-svn-id: trunk@35659 -
2017-03-25 20:27:00 +00:00
florian
88e31dc8c3 * revision.inc updated
git-svn-id: trunk@35658 -
2017-03-25 19:05:14 +00:00
nickysn
f0a63fa895 + added an optimized implementation of a_op64_reg_ref for i8086; this improves
the generated code on i8086 for things like inc(int64_var,int64_var) and
  dec(int64_var,int64_var)

git-svn-id: trunk@35657 -
2017-03-25 18:45:31 +00:00
svenbarth
34327000d8 + add test for Mantis #31521 which is already fixed, though I don't know which revision did it...
git-svn-id: trunk@35656 -
2017-03-25 13:41:27 +00:00
florian
0cf5ef459d + tcgtypeconvnode.second_class_to_intf supports LOC_CONSTANT as well, resolves #31596
git-svn-id: trunk@35655 -
2017-03-25 10:27:29 +00:00
svenbarth
abc4cf21d1 * fix compiling the 64-bit compiler with a 32-bit one
git-svn-id: trunk@35654 -
2017-03-24 15:47:36 +00:00
michael
872ed2af11 * Patch from Mattias Gaertner:
* added more global JS identifiers to reserved word list

git-svn-id: trunk@35653 -
2017-03-24 12:11:04 +00:00
michael
f12c8a8adc * Patch from Mattias Gaertner
- fixed procedure modifier public
  - fixed setting pmPublic when 'public' behind a procedure starts a class
    visibility section

git-svn-id: trunk@35652 -
2017-03-24 12:10:22 +00:00
michael
510352e121 * Patch from Mattias Gaertner: when an if-statement has an else always use {} for the BTrue
git-svn-id: trunk@35651 -
2017-03-24 12:09:38 +00:00
joost
9d6ff959f4 * Clear packages to avoid duplicates on a re-scan
git-svn-id: trunk@35650 -
2017-03-23 22:12:04 +00:00
florian
971280f082 + tarmcasenode.genjmptreeentry
git-svn-id: trunk@35649 -
2017-03-23 21:37:12 +00:00
michael
2d2a93de1d * Install pasuseanalyzer
git-svn-id: trunk@35648 -
2017-03-23 20:57:28 +00:00
florian
1ae90bce53 * commented how the limit for a case jmp tree had been determined
git-svn-id: trunk@35647 -
2017-03-23 18:35:48 +00:00
florian
e8f7c9dfdd + test for large case statements
git-svn-id: trunk@35646 -
2017-03-23 17:57:31 +00:00
florian
d5754cf47c * create jmp trees for really big case statements
git-svn-id: trunk@35645 -
2017-03-23 17:50:53 +00:00
michael
3148129d6f * Fix bug #31587
git-svn-id: trunk@35644 -
2017-03-23 15:22:07 +00:00
michael
cfa5a354cb * Patch from Mattias Gaertner
- class external:
    - JS object or function as ancestor
    - does not descend from TObject
    - all members become external. case sensitive
    - has no hidden values like $class, $ancestor, $unitname, $init, $final
    - can be ancestor of a pascal class (not descend from TObject).
    - pascal class descendant can override methods
    - property works as normal, replaced by getter and setter
    - class-of
    - class var/function: works as in JS.
    - is and as operators
    - destructor forbidden
    - constructor must not be virtual
    - constructor 'new' -> new extclass(params)
    - identifiers are renamed to avoid clashes with external names
    - call inherited

git-svn-id: trunk@35643 -
2017-03-23 15:03:57 +00:00
michael
298043354b * Patch from Mattias Gaertner
- external classes
  - option to allow is-operator with class-of
  - more extendable

git-svn-id: trunk@35642 -
2017-03-23 15:03:09 +00:00
michael
d9a21a8071 * Patch from Mattias Gaertner
- a.b.c is now stored as (a.b).c, which makes restructuring easier.
  - fixed closing a type section before a procedure is parsed.

git-svn-id: trunk@35641 -
2017-03-23 15:02:19 +00:00
michael
676b25cc93 * Patch from Mattias Gaertner to fix new (a())()
git-svn-id: trunk@35640 -
2017-03-23 15:01:16 +00:00
michael
406c7caa6f * External var does not need, but allows semicolon after var type
git-svn-id: trunk@35639 -
2017-03-22 20:31:29 +00:00
michael
f7db076989 * Allow external fields also for non-external classes is externalclass modeswitch is active
git-svn-id: trunk@35638 -
2017-03-22 20:12:33 +00:00
michael
0f40ccd45f * external class namespace is optional, external fields in class follow variable syntax
git-svn-id: trunk@35637 -
2017-03-22 17:27:05 +00:00
michael
b4787e1b47 * Fix support for external classes, initial implementation of external properties
git-svn-id: trunk@35636 -
2017-03-21 10:16:34 +00:00
michael
545fa038f4 * Added support for external classes
git-svn-id: trunk@35635 -
2017-03-21 06:55:28 +00:00
Károly Balogh
a405b5a150 m68k: improve getreferencestring function a bit
git-svn-id: trunk@35634 -
2017-03-20 23:48:28 +00:00
michael
44c5fe99c9 * Patch from Mattias Gaertner:
jswriter: 
    fixed some empty lines 
  pasresolver: 
    procedure str, function str
  fppas2js: 
    procedure str,function str
    write less empty blocks
    target platform browser and nodejs

git-svn-id: trunk@35633 -
2017-03-20 23:29:53 +00:00
marco
a2d397c064 * pmethod declaration, patch from mantis #31576 by Silvio
git-svn-id: trunk@35632 -
2017-03-20 21:19:20 +00:00
michael
a1303eecde * Fixed from Mattias Gaertner
pasresolver: checking all varargs arguments
  pasresolver: checking arguments are readable
  fppas2js: fixed using externals from other units

git-svn-id: trunk@35631 -
2017-03-20 07:31:39 +00:00
lacak
2e58447447 fcl-db: base: typo
git-svn-id: trunk@35630 -
2017-03-19 18:54:07 +00:00
lacak
93a528cd7a fcl-db: tests: test for bug #31532
git-svn-id: trunk@35629 -
2017-03-19 17:49:58 +00:00
lacak
4582b56506 fcl-db: base: cosmetic
git-svn-id: trunk@35628 -
2017-03-19 17:16:48 +00:00