Commit Graph

4 Commits

Author SHA1 Message Date
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
eb5814a868 * implemented declaring and calling constructors for Java classes
o handle them like for regular classes (return a class instance,
     although this is technically not true since they don't return
     anything; will be changed in the future)
   o because of the previous point, make sure that we handle the
     "function result" properly and don't pop too many values from
     the evaluation stack when calling one constructor from another
   o added "extra_pre_call_code" method used by njvmcal to insert
     the "new" opcode to create the new class instance before
     calling a constructor
   o when a constructor does not call any other constructor (inherited
     or otherwise), automatically insert a call to the inherited
     parameterless constructor as required by the jvm standard)
   TODO: check that *if* an inherited or other constructor is called
     from another constructor, that it does so as the first statement/
     call

git-svn-id: branches/jvmbackend@18328 -
2011-08-20 07:46:37 +00:00
Jonas Maebe
e2e32fbbe9 * fixed temp leaking after release_unused_return_value_cpu() refactor:
renamed refactored routine to do_release_unused_return_value()
    which by default releases temps, and if something else needs to
    be done override (and call inherited if temps may have to be
    released)

git-svn-id: branches/jvmbackend@18327 -
2011-08-20 07:46:31 +00:00
Jonas Maebe
9a9ea1f257 + limited thlcg.gen_load_cgpara_loc() implementation (only loc_reference
support), passed through to original ncgutils version in thlcg2ll
  + thlcgobj.location_force_mem() implementation
  * order parameters for jvm similar to those for i386 without fixed_stack,
    so we don't need temporary paralocations
  * converted most of ncgcal to thlcg
  * disabled special handling for virtual methods for jvm in ncgcal, as all
    invocations are name-based there
  + njvmcal with special jvm callnode support:
   o always move the function result into a memory temp
   o when freeing an unused function result, use a_pop(2) and adjust
     the internal evaluation stack height counter
   o after the call instruction, adjust the evaluation stack height counter
     by subtracting the number of the pushed parameter slots, adjusted for
     the slots taken up by the function result

git-svn-id: branches/jvmbackend@18325 -
2011-08-20 07:46:22 +00:00