* Merged in new trap code (twisti-branch).
[cacao.git] / src / vm / jit / m68k / codegen.c
index 0862cad4905ad2d5ea407286e7f7f80e0f2af714..41bd7c7f7f83e459c527546e81fe368a01bbdf8b 100644 (file)
@@ -2410,27 +2410,9 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        (void) dseg_add_unique_s4(cd, 0);                              /* IntSave         */
        (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 */
        M_AADD_IMM(-(cd->stackframesize*8), REG_SP);
 
-       /* get function address (this must happen before the stackframeinfo) */
-       if (f == NULL)  {
-               patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, 0);
-       }
-
-       M_AMOV_IMM(f, REG_ATMP2); /* do not move this line, the patcher is needed */
-
-       M_AST(REG_ATMP2, REG_SP, 4 * 4);
-
        /* put arguments for codegen_start_native_call onto stack */
        /* void codegen_start_native_call(u1 *datasp, u1 *pv, u1 *sp, u1 *ra) */
        
@@ -2448,9 +2430,6 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        if (m->flags & ACC_STATIC)
                M_INT2ADRMOVE(REG_RESULT, REG_ATMP3);
 
-       /* load function pointer */
-       M_ALD(REG_ATMP2, REG_SP, 4 * 4);
-
        /* copy arguments into stackframe */
        for (i = md->paramcount -1, j = i + skipparams; i >= 0; --i, --j)       {
                t = md->paramtypes[i].type;
@@ -2481,6 +2460,7 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
        }
 
        /* call the native function */
+       M_AMOV_IMM(f, REG_ATMP2);
        M_JSR(REG_ATMP2);
 
        /* save return value */
@@ -2501,14 +2481,7 @@ 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) */
 
@@ -2566,9 +2539,6 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
 
        /* should never be reached from within jit code*/
        M_JSR_IMM(0);
-
-       /* generate patcher stub call code */
-       emit_patcher_traps(jd);
 }