Commit Graph

376 Commits

Author SHA1 Message Date
svenbarth
e4feacf29d Load global variables and typed constants from different units using indirect references if necessary.
ncgld.pas, tcgloadnode:
  + new method use_indirect_symbol to determine whether using an indirect reference is necessary at all
  * generate_threadvar_access & pass_generate_code: pass result of use_indirect_code() to RefAsmSymbol() for using an indirect access if needed

git-svn-id: trunk@33282 -
2016-03-18 22:27:28 +00:00
Jonas Maebe
4643913d58 - disable x86-specific workarounds when using LLVM (even when targeting x86)
git-svn-id: trunk@32782 -
2015-12-28 15:06:50 +00:00
Jeppe Johansen
f21f9ab930 Fix issue with absolute offsets being sign extended from aint to asizeint.
git-svn-id: trunk@32576 -
2015-12-03 21:43:39 +00:00
Jonas Maebe
0c4edd2aa9 * fixed getting address of interface methods after r32414: interfaces are not
a pointer to a vmt, but a pointer to a pointer to vmt (mantis #29086)
   o also adjusted the llvm type for interfaces accordingly

git-svn-id: trunk@32530 -
2015-11-25 19:28:17 +00:00
Jonas Maebe
554be0c301 * fixed hlcg type correctness when getting the address of a virtual method
o handle interfaces like classrefdef, since they also point to the vmt

git-svn-id: trunk@32414 -
2015-11-21 12:37:11 +00:00
Jonas Maebe
a3cdf466e3 * fixed type of proc address when loading a complex procvar
git-svn-id: trunk@32413 -
2015-11-21 12:37:08 +00:00
Jonas Maebe
eaeb9d8351 * renamed thlcgobj.g_set_addr_nonbitpacked_record_field_ref() to
thlcgobj.g_set_addr_nonbitpacked_field_ref() and adjusted it so that
    it also works for objects/classes (if the incoming reference points
    to the start of the class contents)
   o factored out the related code from tllvmsubscriptnode

git-svn-id: trunk@32411 -
2015-11-21 12:37:01 +00:00
Jonas Maebe
7ce34ac7d2 * fixed code generator type correctness when loading a resourcestring
git-svn-id: trunk@32403 -
2015-11-21 12:36:35 +00:00
Jonas Maebe
98c08dee1a * fixed indentation
git-svn-id: trunk@32246 -
2015-11-04 22:23:44 +00:00
Jonas Maebe
22d8b273bd * the type of tvarrec fields that are passed by address is already a pointer
-> don't make a double pointer

git-svn-id: trunk@32245 -
2015-11-04 22:23:41 +00:00
Jonas Maebe
9914f02faa * always set the resultdef for variant array constructors correctly, so we
don't need to pull all kinds of special tricks pass_generate_code

git-svn-id: trunk@32233 -
2015-11-04 20:46:10 +00:00
Jonas Maebe
2c5187cb97 * fixed size when storing arrayconstructor vtype field
git-svn-id: trunk@32215 -
2015-10-31 14:25:56 +00:00
Jonas Maebe
af4d69f446 * always write the entire integer field when storing a value < integer in an
arrayconstructor, so the upper bits get zeroed (tbs/tb0581)

git-svn-id: trunk@32214 -
2015-10-31 14:25:54 +00:00
nickysn
94a5364c2c * fixed 'array of const' in the i8086 tiny/small/medium memory models
git-svn-id: trunk@32212 -
2015-10-31 11:43:04 +00:00
Jonas Maebe
4670e0abc9 * converted "array of const" handling to the high level code generator
git-svn-id: trunk@32207 -
2015-10-30 20:45:15 +00:00
Jonas Maebe
3b2bd718d8 * corrected the def of the temp for array constructor nodes in case of
an array of const

git-svn-id: trunk@31777 -
2015-09-22 19:59:37 +00:00
yury
374148b966 * fixed compilation of 8086 compiler.
git-svn-id: trunk@31746 -
2015-09-17 16:30:02 +00:00
yury
47b316d0e2 * Removed unused vars for x86-64 compiler.
git-svn-id: trunk@31744 -
2015-09-17 15:26:31 +00:00
nickysn
c7ecf84fc0 * fixed compilation of threadvars in i8086 far data memory models
git-svn-id: trunk@31662 -
2015-09-13 12:52:23 +00:00
Jonas Maebe
19882aea7e * converted threadvar loading to high level code generator and updated/added
comments

git-svn-id: trunk@31644 -
2015-09-12 23:33:10 +00:00
Jonas Maebe
3c6aa91a96 * factored out the loading of threadvars in its own method, and put the
x86-specific part in nx86ld

git-svn-id: trunk@31639 -
2015-09-12 23:32:53 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
Jonas Maebe
388cef8a34 * fixed types for shortstring handling in tcgassignmentnode.pass_generate_code
git-svn-id: trunk@30716 -
2015-04-25 15:51:19 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
290e3f5ff8 * fixed assigning one float loc_reference to another of a different size if a
platform does not support (hl)cg.a_loadfpu_*, but only (hl)cg.a_loadmm_*

git-svn-id: trunk@29820 -
2015-02-23 22:47:47 +00:00
Jonas Maebe
ac02c92a0d * disable cg64/cg128 special cases for high level targets
git-svn-id: branches/hlcgllvm@28365 -
2014-08-10 19:40:00 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
svenbarth
441e6c6083 Fix for Mantis #26177. Use the correct value for the method data when using a method pointer of a type or record helper.
Please note that Delphi has the exact same bug as we have and thus code working in FPC will not work in Delphi.
Additionally taking the method address of a local variable or a local/global constant for a method pointer is dangerous as the variable (in case of constants is a temporary local variable) will go out of scope once the containing procedure/function/method exits!

ncgld.pas, tcgloadnode.pass_generate_code:
  * only use the value of Self if it is an implicit pointer object (class instance) or a class reference, but not for everything else (objects, records, primitive types)

+added test

git-svn-id: trunk@28160 -
2014-07-05 08:54:10 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
24bf272c69 * fixed the passing of array of const parameters in i8086 far data memory models
git-svn-id: trunk@27700 -
2014-05-01 12:46:29 +00:00
nickysn
40a6a9c820 + added i8086 specific implementation of thlcgcpu.a_load_loc_ref, which handles
6-byte method pointers and other i8086 types that use loc.registerhi
* changed the i8086 specific code in tcgassignmentnode.pass_generate_code to
  use hlcg.a_load_loc_ref

git-svn-id: trunk@27555 -
2014-04-13 01:38:43 +00:00
nickysn
02988023b7 * tcgloadnode.pass_generate_code: fixes for i8086 far data model fixes in the
handling of method procsyms + even more ifdef i8086s removed

git-svn-id: trunk@27551 -
2014-04-12 19:59:04 +00:00
nickysn
68ff3fb1e2 * tcgloadnode.pass_generate_code: rm the ifdef'd i8086 code from the handling of
non-method procsyms by using def_cgsize(pd.address_type) to determine the
  address size

git-svn-id: trunk@27550 -
2014-04-12 16:26:51 +00:00
nickysn
9ae26316e8 * fixed the handling of const resourcestrings in the i8086 far data memory models
git-svn-id: trunk@27380 -
2014-03-30 16:30:51 +00:00
Jonas Maebe
4a79481c51 * isolated segment-related functionality of tabsolutevarsym into i386/i8086-
specific descendent classes and moved the code that deals with this in the
    code generator also to target-specific classes -> only ifdefs left in
    pdecvar

git-svn-id: trunk@27379 -
2014-03-30 15:42:53 +00:00
nickysn
0082db46ea * i8086 far data memory model fix in tcgloadnode.generate_nested_access.
The system unit now compiles in the compact and large memory models again.

git-svn-id: trunk@27341 -
2014-03-29 18:32:01 +00:00
nickysn
d43d7e59b5 * partially converted the threadvar handling in tcgloadnode.pass_generate_code
to use the hlcg in order to support the i8086 far data memory models. Only the
  instructions that handle the case when there's no thread manager installed
  (FPC_THREADVAR_RELOCATE=nil) are converted, since that's what's used on the
  msdos target. The rest still uses the low level code generator.

git-svn-id: trunk@27336 -
2014-03-29 16:22:48 +00:00
nickysn
7f014c5040 * replaced ifdef i8086 with hlcg.reference_reset_base in tcgloadnode.pass_generate_code
git-svn-id: trunk@27327 -
2014-03-28 23:38:57 +00:00
nickysn
897802c7c4 + fill the treference segment correctly in the load node for localvarsyms and
paravarsyms that are passed by reference in a i8086 far data memory model

git-svn-id: trunk@27277 -
2014-03-25 00:50:18 +00:00
Jonas Maebe
73a3f5ced4 * moved ncgutil.maybechangeloadnodereg() to hlcg.maybe_change_load_node_reg()
and moved ifdef'd jvm code to overridden method

git-svn-id: trunk@27153 -
2014-03-16 11:24:40 +00:00
Jonas Maebe
d8e228e82d - removed unnecessary JVM-specific code
git-svn-id: trunk@27151 -
2014-03-16 11:24:32 +00:00
Jonas Maebe
e9268a0a14 * synchronised with trunk up till r26975
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
nickysn
9eb4419ba3 * fixed the conversion and assignment to the 64-bit boolean types on the i8086
git-svn-id: trunk@26343 -
2013-12-31 17:18:20 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
Jonas Maebe
967354bb4c * corrected def used for loads of the address of pass-by-reference
parameters

git-svn-id: branches/hlcgllvm@26034 -
2013-11-11 11:15:05 +00:00
nickysn
b8de1370a0 * fixed assignment of i8086 method pointers, when the source is in a register
git-svn-id: trunk@25999 -
2013-11-09 16:50:56 +00:00
nickysn
7ff97d9b7d * specify AT_DATA when refering to the 'RESSTR' symbols; among other things,
this fixes resourcestring constants in the i8086 memory model.

git-svn-id: trunk@25796 -
2013-10-15 22:06:16 +00:00
nickysn
f2763b98fa + implemented absolute seg:ofs vars on i8086
git-svn-id: trunk@25666 -
2013-10-05 22:16:33 +00:00
florian
0a22199738 * always use the varrec size retrieved from the system unit when advancing to the next element
git-svn-id: trunk@25244 -
2013-08-11 20:13:57 +00:00
nickysn
91d7b2bc94 + added i8086 medium/compact model 6-byte (mixed near + far) method pointer support in tcgloadnode and tcgassignmentnode
git-svn-id: trunk@25149 -
2013-07-20 15:06:14 +00:00
florian
541d67771b * keep managed types in registers if possible. Under certain circumstances (if they don't require init/final code,
e.g. being a const parameter or immutable temp. values), managed types like dyn. arrays, new string types and interfaces can be kept in registers.

git-svn-id: trunk@24953 -
2013-06-23 15:16:30 +00:00
nickysn
57e84dc0b4 * set the proper size for far procsyms in tcgloadnode.pass_generate_code
git-svn-id: trunk@24858 -
2013-06-10 01:06:02 +00:00
sergei
4b820a1ca5 - Removed tcgloadnode.generate_picvaraccess, it is never used and is not necessary because PIC stuff is handled at lower levels.
git-svn-id: trunk@24764 -
2013-06-02 10:49:17 +00:00
Jonas Maebe
5051453806 + support for LOC_(C)MMREGISTER in hlcg
o migrated location_force_mmregister_scalar from ncgutil to hlcgobj

git-svn-id: trunk@24661 -
2013-05-31 12:05:14 +00:00
nickysn
35939ff0a9 + method pointer support for targets with a 16-bit address space in tcgloadnode.pass_generate_code
git-svn-id: trunk@24641 -
2013-05-30 13:22:59 +00:00
nickysn
c41d93214f * fixed passing a longint to an array of const parameter on i8086 (and other 8/16-bit cpus)
git-svn-id: trunk@24588 -
2013-05-25 10:14:39 +00:00
Jonas Maebe
5152c86932 * set the location size of load nodes of procsyms without methodpointer/
framepointer
  * fixed conversion of procedure of object/nested procedure into a procvar
    that only contains the code address

git-svn-id: trunk@23928 -
2013-03-19 12:27:57 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
sergei
bc4c1149c3 + Native threadvar implementation for Win32 and Win64 (most of it, but not yet complete).
git-svn-id: trunk@23359 -
2013-01-10 19:13:02 +00:00
Jonas Maebe
69c29a415f * pass the procdef to getintparaloc instead of only the proccalloption, so
that the type of the parameters can be determined automatically
   o added compilerproc declarations for all helpers called in the compiler
     via their assembler name, so we can look up the corresponding procdef

git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
florian
761fcca4ec + is_dynamicstring
+ implement low/high for dynamic strings, resolves #15244 and #22936
+ basic support for $zerobasedstrings directive

git-svn-id: trunk@22933 -
2012-11-04 21:48:53 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
florian
67744ef46e * fix methodpointers in registers on big endian targets
git-svn-id: trunk@22362 -
2012-09-09 17:54:35 +00:00
florian
d93cee995b * fix register method pointer for ppc64 and x86_64-linux
git-svn-id: trunk@22351 -
2012-09-07 15:15:10 +00:00
florian
7361e19799 + support for handling OS_128/OS_S128 on 64 Bit CPUs as far as needed for method pointers in registers
git-svn-id: trunk@22344 -
2012-09-06 15:12:12 +00:00
florian
370d42035a * when creating method pointers, put them into registers
git-svn-id: trunk@22341 -
2012-09-06 15:11:58 +00:00
florian
d8161c185c + track usage of flags by using a new register RS_/NR_DEFAULTFLAGS
git-svn-id: trunk@22179 -
2012-08-22 19:37:51 +00:00
Jonas Maebe
7a0ae38700 + also specify the parameter def when allocating a parameter via
getintparaloc + adapted all call sites of getintparaloc. This
    led to a number of additional, related changes:
   o corrected the type information for some getintparaloc parameters
   o don't allocate some intparalocs in cases they aren't used
   o changed "const tvardata" parameter into "constref tvardata" for
     fpc_variant_copy_overwrite to make pass-by-reference semantics
     explicit
   o moved a number of routines that now have to call find_system_type()
     from cgobj to hlcgobj so that cgobj doesn't have to start depending
     on the symtable unit
   o added versions of the cpureg alloc/dealloc methods to hlcgobj that
     call through to their cgobj counter parts, so we can call save/restore
     the cpu registers before/after calling system helpers from hlcgobj
     (not implemented in hlcgobj itself, because all basic register
      allocator functionality is still part of cgobj/cgcpu)

git-svn-id: trunk@21696 -
2012-06-24 15:02:12 +00:00
Jonas Maebe
78bb3e323a * fixed source type information for values loaded in arrayconstructor after
r21069

git-svn-id: trunk@21350 -
2012-05-20 20:34:14 +00:00
Jonas Maebe
edd42aa42a * moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
future use by high level code generator targets
   o this in turn required that all a_load*_loc* methods are called via
     hlcg rather than via cg, since a location can be a subsetref/reg and
     and those are no longer handled in tcg
   o that then required moving several force_location_* routines into
     thlcg because they use a_load_loc*, but did not take tdef size
     parameters (which are required by the thlcg a_load_loc* routines)
   o the only practical consequence is that from now on, you have to
     use hlcg.location_force_mem/reg() (fpureg not yet) and
     hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
     and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
     might be involved

git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
Jonas Maebe
41d86f2b26 * fixed (harmless) class cast error when checking whether an aggregate
has the same size as one of its members to determine whether we can
    exchange two temps rather than copying one to the other

git-svn-id: trunk@21259 -
2012-05-08 20:02:04 +00:00
sergei
78c0215447 Preparations to native threadvar support:
- i386/cgcpu.pas: removed segment check, rejecting references with segment here is too early. These references are passed to tcgx86.a_loadaddr_ref_reg, which can generate required code for them (or reject if they are not allowed for the target).
- ncgld.pas: removed "not tf_section_threadvars in target_info" condition, it is inverse to one on the following line, making non-generic branch impossible to execute.
+ Define FPC_SECTION_THREADVARS macro if corresponding flag is set for the target.

git-svn-id: trunk@21210 -
2012-05-03 16:26:44 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
452414e1a7 - removed cg.g_indirect_sym_load() calls from pass_generate_code; this
routine is called from tcgppcgen.fixref()/tcgx86.make_simple_ref()
    when necessary

git-svn-id: trunk@20789 -
2012-04-11 18:00:21 +00:00
sergei
afb4992113 * Changed code generation for assignments of managed types, it now generates a single call to helper procedure (significantly reducing code size) and is handled entirely in firstpass.
git-svn-id: trunk@20118 -
2012-01-19 22:28:29 +00:00
florian
fd07f51f35 * handle LOC_JUMP correctly for 64 bit boolean assignments
git-svn-id: trunk@19967 -
2012-01-04 22:32:31 +00:00
Jonas Maebe
d0ba14ecab * fixed webtbs/tw20874b for non-x86 32 bit targets: tcgobj methods (by
default) cannot deal with 64 bit locations on 32 bit platforms

git-svn-id: trunk@19919 -
2011-12-30 11:58:49 +00:00
florian
c4a5499d2a * handle flag to reg./ref. conversion correctly for boolean64
git-svn-id: trunk@19914 -
2011-12-29 17:28:35 +00:00
florian
a59a37dddd * handle assignments of qword bools with LOC_FLAGS correctly, resolves #20874
git-svn-id: trunk@19912 -
2011-12-29 16:48:46 +00:00
Jonas Maebe
bd990d1173 * generate JVM bytecode that passes the stringent requirements of the Dalvik
verifier when -Cpjvmdalvik is used (including debug information). Using
    -Cpjvmdalvik changes the semantics at the language-level in one case:
    boolean(bytevar) will no longer return a boolean that contains the same
    value as bytevar did, but will map the value to 0/1 (that also means that
    such expressions cannot be passed to var-parameters in case of
    -Cpjvmdalvik). Code compiled with -Cpjvmdalvik will also work fine on
    the regular JVM, but it may be somewhat slower (it won't necessarily
    be slower on Dalvik, because the .class -> .dex transformation
    applies many optimizations itself)

git-svn-id: branches/jvmbackend@19743 -
2011-12-04 14:48:54 +00:00
florian
6ec0f2549a * factored load node flags out of node flags to gain space
+ implemented iso mode mod, resolves #17685

git-svn-id: trunk@19558 -
2011-10-30 15:14:21 +00:00
florian
7bb1c642dd * fix division by zero in alignment code, should resolve #20265 an #20240
git-svn-id: trunk@19338 -
2011-10-03 16:53:42 +00:00
Jonas Maebe
27731e342c + support for array-of-const on the JVM target. Even though the
implementation is a bit different from that on native targets, the
    result is quite compatible

git-svn-id: branches/jvmbackend@18765 -
2011-08-20 08:34:00 +00:00
Jonas Maebe
979f55e1db + support for procedural variables for the JVM target
o every porocedural variable type is represented by a class with one
     public "invoke" method whose signature matches the signature of the
     procvar
   o internally, dispatching happens via java.lang.reflect.Method.invoke().
     WARNING: while this allows calling private/protected or other methods
     that are normally not accessible from another context, a security
     manger can override this. If such a security manager is installed,
     most procvars will cause security exceptions
   o such dispatching also requires that all arguments are wrapped, but
     that's done in the compiler-generated body of the invoke method,
     so that procvars can also be called conveniently from Java code
   o typecasting between a procedure of object and tmethod is supported,
     as well as Delphi-style replacing of only the method pointer via
     @procvar1=@procvar2.
   o nested procvars are not yet supported, but most of the basic
     infrastructure for them is already present
  * all units/programs now get an internal __FPC_JVM_Module_Class_Alias$
    type when compiled for the JVM target, which is an "external" class
    that maps to the unit name. This is required to look up the
    JLRMethod instances for regular functions/procedures
  + new tabstractprocdef.copyas() method that allows to create a procvar
    from a procdef and vice versa

git-svn-id: branches/jvmbackend@18690 -
2011-08-20 08:24:58 +00:00
Jonas Maebe
d6966e545b + support for formal var/out parameters on the JVM target:
o primitive types are first boxed
   o the parameter is passed inside an array of one class instance
   o changing the parameter inside the routine (by assigning a value to it
     like in Delphi.NET and different from regular Pascal code) will replace
     this class instance (again boxing the value if required)
   o on return, the class instance is extracted, unboxed if required, and
     assigned back to the original location
   o formal const parameters are handled without the extra array indirection,
     since they cannot be changed

  TODO: while writing tjvmcallparanode.handleformalcopyoutpara() I forgot that
    calling getcopy on ttemprefnodes whose ttempcreatenode hasn't been copied
    yet works fine, so that code is more complex than needed. Still have to
    fix.

git-svn-id: branches/jvmbackend@18675 -
2011-08-20 08:23:33 +00:00
Jonas Maebe
569228447d * converted all enum handling for the JVM target so that it uses the
JDK class-style enums rather than plain ordinals like in Pascal
   o for Pascal code, nothing changes, except that for the JVM target
     you can always typecast any enum into a class instance (to interface
     with the JDK)
   o to Java programs, FPC enums look exactly like Java enum types

git-svn-id: branches/jvmbackend@18620 -
2011-08-20 08:15:54 +00:00
Jonas Maebe
8fa42c206f + support for nested procedures for the JVM target
o since the JVM target has no stack/framepointer that can be passed
     on to nested routines, all local variables and parameters accessed
     from nested routines are grouped into a local record whose address
     is passed to nested routines. The same technique is also required
     for LLVM in the future

git-svn-id: branches/jvmbackend@18588 -
2011-08-20 08:12:59 +00:00
Jonas Maebe
63962043a5 * fixed fake nested procedures support
git-svn-id: branches/jvmbackend@18543 -
2011-08-20 08:09:00 +00:00
Jonas Maebe
c9537e3347 + support for non-array/record var parameter on the JVM target using
copy-in/out

git-svn-id: branches/jvmbackend@18527 -
2011-08-20 08:07:24 +00:00
Jonas Maebe
d1a1d30e04 * unless compiled with -dnounsupported, the compiler will now accept not
only JVM constructs that are already implemented, but also ones that
    will be supported in the future but that aren't implemented yet (to
    make it easier to already adapt code to the future changes)

git-svn-id: branches/jvmbackend@18498 -
2011-08-20 08:04:51 +00:00
Jonas Maebe
bf21cd7a15 + support for (non-variant) arrayconstructornodes for the JVM target
o when allocating array temps for the JVM target, use the specified
     "forcesize" for the first dimension, since the arraydef size may
     be invalid (e.g., in case it's an array constructor)

git-svn-id: branches/jvmbackend@18468 -
2011-08-20 08:02:22 +00:00
Jonas Maebe
2c313e397e + support for regular arrays and open arrays
o support for copying value parameters at the callee side if they were
     passed by reference in hlcg
   o JVM g_concatcopy() implementation for arrays
   o moved code to get length of an array from njvminl to hlcgcpu so it can
     be reused elsewhere as well
   o export array copy helpers from system unit for use when assigning one
     array to another
   o some generic support for types that are normally not implicit pointers,
     but which are for the JVM target (such as normal arrays)
  * handle assigning nil to a dynamic array by generating a setlength(x,0)
    node instead of by hardcoding a call to fpc_dynarray_clear, so
    target-specific code can handle it if required
  * hook up gethltemp() for JVM ttgjvm so array temps are properly
    allocated

git-svn-id: branches/jvmbackend@18388 -
2011-08-20 07:55:27 +00:00
Jonas Maebe
0e87627218 + gethltemp() to allocate a temp specifying full type information even
for regular temps. This is required for targets that need special
    handling of the temps depending on the type
  * converted most gettemp() calls to gethltemp() calls

git-svn-id: branches/jvmbackend@18376 -
2011-08-20 07:54:04 +00:00
Jonas Maebe
28740dce2d - removed extra "fordefinition" parameter again from tprocdef.mangledname(),
since the definition-specific adorning of JVM mangled names is Jasmin-
    specific, and such code has no place in symdef
  * moved code to adorn JVM mangled names for Jasmin definitions to agjasmin

git-svn-id: branches/jvmbackend@18346 -
2011-08-20 07:49:31 +00:00
Jonas Maebe
35ca5b799b * list -> current_asmdata.CurrAsmList for cpuhighleveltarget code
git-svn-id: branches/jvmbackend@18302 -
2011-08-20 07:36:48 +00:00
Jonas Maebe
0ee702b3a2 * tprocdef.mangledname now gets an extra boolean parameter indicating
whether the mangled name is for defining a symbol, or for referencing
    it later (e.g. for a call or load of its address). The reason is that
    on the JVM both cases are different.
  + jvmdef unit to encode types according to the JVM rules
  + tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
    (the common part of defining/referencing it; tprocdef.mangledname
     afterwards adorns it as required)

git-svn-id: branches/jvmbackend@18288 -
2011-08-20 07:22:00 +00:00
Jonas Maebe
e3e4d365c8 * converted the parts of tcgloadnode.pass_generate_code() and
tcgassignmentnode.pass_generate_code() for simple symbols and
    for simple assignments from tcgobj to thlcgobj

git-svn-id: branches/jvmbackend@18283 -
2011-08-20 07:21:31 +00:00
florian
f1b13dca19 * handle aligned assignments with size < sizeof(aint) properly, resolves #19355
git-svn-id: trunk@17468 -
2011-05-15 13:47:26 +00:00