Merged with cldc-branch
authorRoland Lezuo <tbfg@complang.tuwien.ac.at>
Tue, 19 Feb 2008 17:04:20 +0000 (18:04 +0100)
committerRoland Lezuo <tbfg@complang.tuwien.ac.at>
Tue, 19 Feb 2008 17:04:20 +0000 (18:04 +0100)
src/vm/jit/m68k/asmpart.S
src/vm/jit/m68k/codegen.c
src/vm/jit/m68k/codegen.h
src/vm/jit/m68k/linux/md-abi.c

index 1a6ee282740e4d7fb408a7870f9cfe7618d1af73..25ea601e87978856510a16e48e7057291af8d620 100644 (file)
@@ -91,8 +91,8 @@ asm_vm_call_method_double:
        movel   %sp@(12*4+2*4),%a2                              /* arg array */
        movel   %sp@(12*4+3*4),%d2                              /* arg count */
 
-       movel   %a3, %sp@(12*4)                                 /* copy method address to stackslot */
-       leal    %sp@(12*4), %a3                                 /* and store that address in %a3 */
+       movel   %a3, %sp@(11*4)                                 /* copy method address to stackslot */
+       leal    %sp@(11*4), %a3                                 /* and store that address in %a3 */
 #else
        addal #(-12*4-6*8), %sp
        moveml  %d2/%d3/%d4/%d5/%d6/%d7/%a2/%a3/%a4/%a5/%fp,%sp@        /* save registers */
@@ -103,8 +103,8 @@ asm_vm_call_method_double:
        movel   %sp@(12*4+6*8+2*4),%a2                          /* arg array */
        movel   %sp@(12*4+6*8+3*4),%d2                          /* arg count */
 
-       movel   %a3, %sp@(12*4+6*8)                                     /* copy method address to stackslot */
-       leal    %sp@(12*4+6*8), %a3                                     /* and store that address in %a3 */
+       movel   %a3, %sp@(11*4+6*8)                                     /* copy method address to stackslot */
+       leal    %sp@(11*4+6*8), %a3                                     /* and store that address in %a3 */
 #endif
 
        moveal  %sp, %a5                                        /* memorize stack */
index 2b3ae563dc142e8225f26d7ceec344e3d34636c6..2bf473d9ea8009440a62f33da59aa458db9fd3b4 100644 (file)
@@ -2413,10 +2413,12 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        (void) dseg_add_unique_s4(cd, 0);                              /* FltSave         */
 
        /* print call trace */
+#if 0
 #if !defined(NDEBUG)
        if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
                emit_verbosecall_enter(jd);
        }
+#endif
 #endif
 
        /* generate code */
@@ -2469,13 +2471,16 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
                }
        }
 
-       /* for static function class as second arg */
-       if (m->flags & ACC_STATIC)
-               M_AST(REG_ATMP3, REG_SP, 1 * 4);
+       /* builtins are not invoked like natives, environemtn and clazz are only needed for natives */
+       if (m->flags & ACC_NATIVE)      {
+               /* for static function class as second arg */
+               if (m->flags & ACC_STATIC)
+                       M_AST(REG_ATMP3, REG_SP, 1 * 4);
 
-       /* env ist first argument */
-       M_AMOV_IMM(_Jv_env, REG_ATMP1);
-       M_AST(REG_ATMP1, REG_SP, 0 * 4);
+               /* env ist first argument */
+               M_AMOV_IMM(_Jv_env, REG_ATMP1);
+               M_AST(REG_ATMP1, REG_SP, 0 * 4);
+       }
 
        /* call the native function */
        M_JSR(REG_ATMP2);
@@ -2498,12 +2503,13 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
 
                default: assert(0);
        }
-       
+#if 0  
        /* print call trace */
 #if ! defined(NDEBUG)
        if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
                emit_verbosecall_exit(jd);
        }
+#endif
 #endif
        /* remove native stackframe info */
        /* therefore we call: java_objectheader *codegen_finish_native_call(u1 *datasp) */
index 8d5ff5b02837de2000ac73f9ae1643b8d117aba3..689dd9b6a64b9ed3873809bcae88796ed0a54ab8 100644 (file)
@@ -67,7 +67,7 @@
 
 /* stub defines ***************************************************************/
 
-#define COMPILERSTUB_CODESIZE (6+6+2)
+#define COMPILERSTUB_CODESIZE (2+2)
 
 
 /* coldfire instruction format:
index c8f5b77282f7b4ff7fe1ea6108fb8b8baf0f0099..63c2b13e0e0f0b52bcc9d1c168466bb733c2b669 100644 (file)
@@ -89,8 +89,25 @@ const s4 abi_registers_float_temporary[]     = {0,1};
 
 void md_param_alloc_native(methoddesc *md)
 {
-               /* For now use system ABI */
-               md_param_alloc(md);
+       paramdesc       *pd;
+       s4      stacksize;
+       s4      i;
+
+       pd = md->params;
+       stacksize = 0;
+
+       for (i=0; i<md->paramcount; i++, pd++)  {
+               pd->inmemory = true;
+               pd->regoff = stacksize * 4;
+               pd->index = stacksize;
+               stacksize += IS_2_WORD_TYPE(md->paramtypes[i].type) ? 2:1;
+       }
+
+       md->memuse = stacksize;
+       md->argintreguse = 0;
+       md->argfltreguse = 0;
+       md->argadrreguse = 0;
+
 }
 
 
@@ -122,7 +139,8 @@ void md_param_alloc(methoddesc *md)
        for (i=0; i<md->paramcount; i++, pd++)  {
                pd->inmemory = true;
                pd->regoff = stacksize * 8;
-/*             stacksize += IS_2_WORD_TYPE(md->paramtypes[i].type) ? 2:1;*/
+               pd->index = stacksize;
+               stacksize ++;
        }
 
        md->memuse = stacksize;