Commit Graph

16 Commits

Author SHA1 Message Date
Jonas Maebe
8f2aacfed5 + support for (formal/untyped) constants (ordinal, floating point,
nil-pointers typecasted to a class type, strings)
   o escape ", \, #10 and #13 in string constants as required by Java

git-svn-id: branches/jvmbackend@18391 -
2011-08-20 07:55:41 +00:00
Jonas Maebe
737f9f5e90 * moved tabstractvarsym.jvmmangledbasename to the jvmdef unit as a separate
function, so it can be easily also used for constsym without adding
    JVM-specific routines to symtype or duplicating the routine without
    inheritance
  + added tconstsym support to jvmdef.jvmmangledbasename()

git-svn-id: branches/jvmbackend@18390 -
2011-08-20 07:55:36 +00:00
Jonas Maebe
59ccdd1de8 - removed unused local variables
git-svn-id: branches/jvmbackend@18389 -
2011-08-20 07:55:31 +00:00
Jonas Maebe
be4a27657b + support for nested Java classes
o tobjectdef.jvm_full_typename() now gets an extra parameter to determine
     whether or not the package name should be prepended, so it can be easily
     used to generate the name of the .j file and of the class name inside it

git-svn-id: branches/jvmbackend@18384 -
2011-08-20 07:55:03 +00:00
Jonas Maebe
608572c63a * removed unused local variables
* fixed some "uninitialised function result" warnings for dummy routines

git-svn-id: branches/jvmbackend@18381 -
2011-08-20 07:54:37 +00:00
Jonas Maebe
678e6dceef * write floating point numbers using hex notation to prevent data loss
(requires patched Jasmin)

git-svn-id: branches/jvmbackend@18380 -
2011-08-20 07:54:29 +00:00
Jonas Maebe
e20919f065 + support for writing JVM line number information
* moved emitting line information from agjasmin to dbgjasm (+ it now
    also works if -al is not used)

git-svn-id: branches/jvmbackend@18355 -
2011-08-20 07:50:46 +00:00
Jonas Maebe
d456ec2ffe + support for JVM local variable and parameter debug information
o self is encoded as "this" for javac compatibility
  + ait_jvar (for the above) and ait_jcatch (similar, for future try/catch
    support) classes
  + support for smallset JVM type encoding (as int)

git-svn-id: branches/jvmbackend@18354 -
2011-08-20 07:50:41 +00:00
Jonas Maebe
b5e7989a06 * separate Jasmin operands by space instead of by ","
git-svn-id: branches/jvmbackend@18353 -
2011-08-20 07:50:35 +00:00
Jonas Maebe
730f75ed96 * use current_module.realmodulename^ (= unit name as declared in its main
source) instead of the filename of a unit's source as its Java class name

git-svn-id: branches/jvmbackend@18352 -
2011-08-20 07:50:29 +00:00
Jonas Maebe
002455ab5c + support for instance and class fields, and unit-level global variables
o hlcgobj support in tcgsubscriptnode.pass_2 for JVM-required functionality
   o slightly different handling for class fields for the JVM than for other
     platforms: instead of adding a unit-level staticvarsym with a hidden name,
     rename the original (unused) field and add the staticvarsym with the original
     name to the object symtable. This is required because the JVM code generator
     has to know the class the field belongs to, as well as its real name
   o moved tprocdef.makejvmmangledcallname() functionality mostly to
     jvmdef.jvmaddtypeownerprefix() because it's also required for mangling
     field symbol names
  * changed the interface of jvmdef from ansistring to shortstring because
    all of its results are also used in shortstring contexts (and they're
    unlikely to overflow the shortstring limit)
  * "protected", "private" (without strict) and implementation-only symbols
    now get "package" visibility instead of "public" visibility

git-svn-id: branches/jvmbackend@18349 -
2011-08-20 07:49:46 +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
83dc297346 + Java interface support, mostly the same as Objective-C protocols
(generalised some error messages that were specific to protocols
     so they can also be used for Java interfaces)
  o note, Java interface support requires a fix to Jasmin 2.4:
    http://sourceforge.net/tracker/?func=detail&aid=2897170&group_id=100746&atid=628212

git-svn-id: branches/jvmbackend@18344 -
2011-08-20 07:49:19 +00:00
Jonas Maebe
b0d050a490 * pass all .j files related to one unit in one go to Jasmin instead of
invoking Jasmin once for every generated .j file

git-svn-id: branches/jvmbackend@18343 -
2011-08-20 07:49:07 +00:00
Jonas Maebe
74d684878d * factored searching the exe directories from FindExe() into
FindFileInExeLocations()
  * search for jasmin.jar using FindFileInExeLocations and properly
    build the java command line, so jasmin can be called successfully
    by the compiler
  * properly create separate assembler files for each class, and
    correctly specify the class name and superclass for each class
    (units themselves are still hardcoded to descend from java.lang.Object)

git-svn-id: branches/jvmbackend@18318 -
2011-08-20 07:38:21 +00:00
Jonas Maebe
1e2c70796e + jvm (cpu architecure) and java ("OS"/target) identifiers
+ basic target information for jvm target (assembling/linking
    helpers are still dummies for now)
  + basic jasmin assembler writer
  + cpunode and cputarg units to include the target units in the
    compiler

git-svn-id: branches/jvmbackend@18309 -
2011-08-20 07:37:33 +00:00