Commit Graph

23 Commits

Author SHA1 Message Date
nickysn
3318703ece * moved nf_typedaddr to addrnodeflags (anf_typedaddr)
git-svn-id: trunk@38671 -
2018-04-03 16:41:01 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
Jonas Maebe
098d64b631 * don't swap and/or boolean operations, they always need to be evaluated in
the regular order (caused internalerror 200709253 while compiling
    tests/test/jvm/trange3, not sure why it wasn't a problem before)

git-svn-id: trunk@35349 -
2017-01-28 14:33:39 +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
93d50bc287 * moved jvm-specific classdef-related fields from tenumdef to a platform-
specific descendant

git-svn-id: trunk@27439 -
2014-04-01 21:41:30 +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
sergei
d72478eb64 * Function tjvmaddnode.cmpnode2topcmp is, in fact, not specific to any target. Moved it to generic tcgaddnode and reused in tmipsaddnode, where the same functionality was implemented in different way.
git-svn-id: trunk@26151 -
2013-11-28 11:52:47 +00:00
Jonas Maebe
583c9a3360 * replace assigned(dynarray) and dynarray=/<>nil with length(dynarray)=/<>0
on the JVM target because empty dynarrays are not always nil there

git-svn-id: branches/jvmbackend@19154 -
2011-09-19 19:59:32 +00:00
Jonas Maebe
a4cf406189 * use generic string concatentation and comparison infrastructure for the
JVM target (and also the generic routines in case of shortstrings)

git-svn-id: branches/jvmbackend@18910 -
2011-08-29 22:59:25 +00:00
Jonas Maebe
3bf71d8d04 * fixed unsigned comparisons after r18734 (comparison operator is now
used to determine the signedness of the comparison, not the types
    of the arguments)

git-svn-id: branches/jvmbackend@18833 -
2011-08-24 22:11:22 +00:00
Jonas Maebe
37aa2d8443 + full support for sets on the JVM target
o sets of enums are handled as JUEnumSet instances, others as JUBitSet
     derivatives (both smallsets and varsets, to make interoperability with
     Java easier)
   o special handling of set constants: these have to be constructed at run
     time. In case of constants in the code, create an internal constsym to
     represent them. These and regular constsyms are then aliased by an
     another internal staticvarsym that is used to initialise them in the
     unit initialisation code.
   o until they are constructed at run time, set constants are encoded as
     constant Java strings (with the characters containing the set bits)
   o hlcgobj conversion of tcginnode.pass_generate_code() for the genjumps
     part (that's the only part of the generic code that's used by the JVM
     target)
   o as far as explicit typecasting support is concerned, currently the
     following ones are supported (both from/to setdefs): ordinal types,
     enums, any other set types (whose size is the same on native targets)
   o enum setdefs also emit signatures
   o overloading routines for different ordinal set types, or for different
     enum set types, is not supported on the JVM target

git-svn-id: branches/jvmbackend@18662 -
2011-08-20 08:22:22 +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
6857dde33e + shortstring support for the JVM target (including accessing character 0 as
the "length byte")

git-svn-id: branches/jvmbackend@18570 -
2011-08-20 08:11:28 +00:00
Jonas Maebe
446d91eaab + ansistring support. Items of note:
o support for ansistring constants. It's done via a detour because the
      JVM only supports UTF-16 string constants (no array of byte or anything
      like that): store every ansicharacter in the lower 8 bits of an
      UTF-16 constant string, and at run time copy the characters to an
      ansistring. The alternative is to generate code that stores every
      character separately to an array.
    o the base ansistring support is implemented in a class called
      AnsistringClass, and an ansistring is simply an instance of this
      class under the hood
    o the compiler currently does generate nil pointers as empty
      ansistrings unlike for unicodestrings, where we always
      explicitly generate an empty string. The reason is that
      unicodestrings are the same as JLString and hence common
      for Java interoperation, while ansistrings are unlikely to
      be used in interaction with external Java code

  * fixed indentation

git-svn-id: branches/jvmbackend@18562 -
2011-08-20 08:10:39 +00:00
Jonas Maebe
3e5b70d80d * cpu64bitaddr -> cpu64bitalu check to determine whether we need special
handling for 64 add-nodes
  * call the generic ordinal handler for 64 add nodes on the JVM

git-svn-id: branches/jvmbackend@18518 -
2011-08-20 08:06:35 +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
91855becfe + unicodestring support for the JVM target (except for multiple adds
in a single statement, to be added later)
   o the unicodestrings are internally simply java.lang.String instances
   o at the language level, the unicodestrings are assignment-compatible
     with java.lang.String
   o constant strings can be implicitly converted to java.lang.String
   o since java.lang.String is immutable, in particular changing a
     single character in a string is extremely inefficient. This could
     be solved by letting unicodestring map to java.lang.StringBuilder,
     but that would make integration with plain Java code harder

git-svn-id: branches/jvmbackend@18470 -
2011-08-20 08:02:33 +00:00
Jonas Maebe
d3a4866cf5 * reorder processing of left/right for add nodes somewhat to make
it easier for the register allocator/optimizer to reduce the
    number of intermediate stores to the stack

git-svn-id: branches/jvmbackend@18341 -
2011-08-20 07:48:42 +00:00
Jonas Maebe
71b348757b * reversed expected operand order of tjvmhlcg.a_cmp_*(), because
that's how these operations also work on other architectures
  * fixed tjvmaddnode.second_generic_compare() for this new order

git-svn-id: branches/jvmbackend@18338 -
2011-08-20 07:48:27 +00:00
Jonas Maebe
e699eb3cc5 + added "list" parameter to thlcgjvm.inc/decstack() methods, and
in case of -ar add to the assembler output the height of the
    evaluation stack every time it's increased or decreased (to
    more easily track missing/wrong inc/decstack() operations)

git-svn-id: branches/jvmbackend@18335 -
2011-08-20 07:48:00 +00:00
Jonas Maebe
a1c50d0576 * make sure that comparisons with NaN always return false
git-svn-id: branches/jvmbackend@18332 -
2011-08-20 07:47:21 +00:00
Jonas Maebe
f250d5d494 + full JVM implementation for add-nodes and mat-nodes, except for
u64bit division/mod, and no overflow checking for divisions
    (none yet for add nodes either, but that has to be implemented
     in hlcgcpu rather than in the add-nodes themselves)

git-svn-id: branches/jvmbackend@18331 -
2011-08-20 07:47:05 +00:00