Commit Graph

20 Commits

Author SHA1 Message Date
Jonas Maebe
a2a6b2fd1d + "reference" temps that sort of implement pointer-style functionality for
platforms that don't support pointers (by make a copy of all registers
    part of a reference)

git-svn-id: branches/jvmbackend@18377 -
2011-08-20 07:54:10 +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
b5ea6ab7d8 + thlcgobj.location_force_fpureg() implementation
git-svn-id: branches/jvmbackend@18370 -
2011-08-20 07:53:03 +00:00
Jonas Maebe
09207563d5 + hlcg implementation of gen_load_para_value(); no support yet for copying
value parameters when necessary, nor for -gt variable trashing

git-svn-id: branches/jvmbackend@18367 -
2011-08-20 07:52:31 +00:00
Jonas Maebe
6c9256ee32 * made internalerror unique
git-svn-id: branches/jvmbackend@18359 -
2011-08-20 07:51:28 +00:00
Jonas Maebe
afceec23b2 - removed unused local variables
git-svn-id: branches/jvmbackend@18348 -
2011-08-20 07:49:41 +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
e1b6398b47 * don't give an "abstract method called" error for g_rangecheck()
if range checking is disabled

git-svn-id: branches/jvmbackend@18334 -
2011-08-20 07:47:44 +00:00
Jonas Maebe
332f613cd7 + thlcgobj.maketojumpbool() implementation
git-svn-id: branches/jvmbackend@18329 -
2011-08-20 07:46:41 +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
Jonas Maebe
71deda6f50 + added interface to ncgutil.gen_load_loc_cgpara() to hlcgobj + generic
implementation (without loc_©mmregister support)
  * moved ncgutil.gen_load_return_value() to hlcgobj, and factored out
    architecture-specific behaviour to load an uninitialised function result
    into a virtual method (+ JVM-specific implementation of that method),
    gen_load_uninitialized_function_result()
  + added hlcgx86 unit and thlcgx86 type to override the
    thlcgobj.gen_load_uninitialized_function_result() method for x87
    function results; the i386 and x86_64 units now instantiate thlcgx86
    instead of thlcg2ll
  * moved calling of ncgutil.gen_load_loc_cgpara() from ncgcal also to hlcgobj
  -> returning function results works for JVM

git-svn-id: branches/jvmbackend@18317 -
2011-08-20 07:38:16 +00:00
Jonas Maebe
8439e1472e * moved def2regtyp() from jvm/hlcgcpu to defutil, and extended it to
handle vectorfpu (floatdef->MMREG) and softfloat (floatdef->INTREG)
  + thlcg.getregisterfordef(), which uses def2regtyp() to allocate a register
    appropriate to hold values of that tdef type
  + generic thlcg.location_force_reg() implementation. Note that for
    low-level code generator targets it may be slightly less efficient than
    the implementation in hlcg2ll (from ncgutil) because it does not play
    any tricks with the register or location size, or with reference offsets,
    to truncate values

git-svn-id: branches/jvmbackend@18315 -
2011-08-20 07:38:06 +00:00
Jonas Maebe
e4d322bcdb + default implementation for for the *_checkoverflow() methods in case
setflags is false
  * don't call the *_checkoverflow() methods from ncgadd with setflags
    = true in case cs_check_overflow is disabled

git-svn-id: branches/jvmbackend@18314 -
2011-08-20 07:38:01 +00:00
Jonas Maebe
742f4ee12e + first (partial) implementation of thlcg for the jvm
+ added arrayreftype field to treference for the jvm, because
    array loads have to be performed using special instructions,
    so this information has to be passed on to the code generator.
    This information will have to be added in t(cg)vecnode.
  * moved concatenating the generated code for a procedure to the
    al_procedures list to thlcg.record_generated_code_for_procdef(),
    which is overridden by jvm/hlcgcpu to attach that code to the
    procdef it belongs with. The reason is that a Java class file
    can only contain code for one class, so we have to write out
    the assembler grouped per class instead of in the order the
    routines appear in the source code
  * also committed forgotten changes in psub after moving the
    register allocator initialisation to hlcgobj

git-svn-id: branches/jvmbackend@18308 -
2011-08-20 07:37:26 +00:00
Jonas Maebe
07130a0c71 + added register allocation methods from cgobj also to hlcgobj,
call through to cgobj

git-svn-id: branches/jvmbackend@18301 -
2011-08-20 07:36:42 +00:00
Jonas Maebe
09ac60b084 + a_call_name_inherited(), by default calls a_call_name() (for the JVM
target you have to use a different opcode for calling inherited methods
    than for regular methods)

git-svn-id: branches/jvmbackend@18300 -
2011-08-20 07:36:35 +00:00
Jonas Maebe
a2890f4463 + basic implementation of concatcopy based on a_load(fpu)_ref_ref
git-svn-id: branches/jvmbackend@18290 -
2011-08-20 07:35:25 +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
0e16369906 * moved gen_proc_symbol() and gen_proc_symbol_end() from ncgutil to hlcgobj
git-svn-id: branches/jvmbackend@18287 -
2011-08-20 07:21:52 +00:00
Jonas Maebe
db203431b2 + hlcgobj: high level code generator class. It has basically the same
interface as cgobj, except that all type parameters are defs instead
    of tcgsize. Also includes some procedures from ncgutil (over time,
    all of ncgutil will probably integrated here so it can be easily
    overridden)
  + hlcg2ll: pass-through implementation of thlcg that forwards everything
    either to cgobj or ncgutil, for use by the classic code generator
    clients (all current platforms)
  + added "def" field to tcgpara to record the tdef of the parameter
    (used by the high level code generator)

git-svn-id: branches/jvmbackend@18279 -
2011-08-20 07:21:09 +00:00