Commit Graph

11 Commits

Author SHA1 Message Date
Jonas Maebe
11c7d5223c * moved ifdef'd jvm code from tprocvardef to jvm-specific descendant
git-svn-id: trunk@27386 -
2014-03-30 17:15:57 +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
b353a2ff27 * fixed writing jvm type for string constants after r22020
git-svn-id: trunk@22123 -
2012-08-19 13:47:50 +00:00
Jonas Maebe
0dfdae3132 * always get the basedef for an enum before using its classdef (since only
the basedef has an associated classdef)

git-svn-id: branches/jvmbackend@20142 -
2012-01-21 19:35:58 +00:00
Jonas Maebe
21e6401921 * no longer encode all pointers to other pointer types (such as
classes, interfaces, dynamic arrays, ...) as "array of JLObject",
    but instead as an array of the actual pointed-to type. The reason
    for the previous behaviour was mainly that the JVM threadvar
    implementation internally stores all threadvars that are
    such double pointer types into an "array of JLObject". Type casting
    this array to e.g. an "array of array of byte" causes an exception
    even if it only contains "array of byte" instances (since the outer
    array type is different). This is now solved by first taking the
    element of the array and then typecasting it to the destination
    type (so dynarrbyte(arr[0]) instead of pdynarrbyte(arr)^[0]).

    The reason for the new (more accurate) behaviour is because the
    old one caused type errors in case a double pointer field was
    internally created for the nestedfpstruct support (see added
    test)

git-svn-id: branches/jvmbackend@19821 -
2011-12-11 17:25:09 +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
Jonas Maebe
1a7c024ad3 * sign extend all byte/ansichar/word parameters before passing them
to and returning them from sub routines, in order to follow the JVM
    specs to the letter (not checked by the JVM bytecode verifiers, but
    checked by the Android DEX verifier)
  * -> also zero-extend them again at the caller side after returning
    from such a function

git-svn-id: branches/jvmbackend@18919 -
2011-08-30 23:34:12 +00:00
Jonas Maebe
a2a0436347 + support for threadvars in the JVM based on JLThreadLocal; see
rtl/java/jtvarh.inc for the details

git-svn-id: branches/jvmbackend@18820 -
2011-08-23 17:45:01 +00:00
Jonas Maebe
992cc352c6 * generalized handling of pointers to non-implicit pointer types:
as far as Java is concerned, they're now all arrays of JLObject.
    When loading a value from them, we typecast the loaded value
    to the appropriate type. This allows typecasting one pointer
    type to another without getting verification errors (since an
    "array of JLObject" is not compatible with "array of JLString")
  - no longer allow dereferencing untyped pointers on the JVM
    target, since that always results in invalid bytecode

git-svn-id: branches/jvmbackend@18819 -
2011-08-23 17:44:55 +00:00
Jonas Maebe
7010116096 * if a mangledbasename is set for staticvarsyms, also use if when emitting
definitions

git-svn-id: branches/jvmbackend@18814 -
2011-08-23 15:26:06 +00:00
Jonas Maebe
5c832ecbd1 * moved jvm-specific compiler units to the jvm subdirectory
git-svn-id: branches/jvmbackend@18782 -
2011-08-20 08:35:58 +00:00