* src/vm/jit/trap.cpp (trap_handle): Cleaned code for compiler traps.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 29 Dec 2008 16:57:40 +0000 (17:57 +0100)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Mon, 29 Dec 2008 16:57:40 +0000 (17:57 +0100)
This also fixes an issue on some archs not yet ported to executionstates.

src/vm/jit/trap.cpp

index c1dc1629559687898b64b3c393c09d42a278b246..c4c97162d92867511a31caea0737cbca62980585 100644 (file)
@@ -165,6 +165,7 @@ void* trap_handle(int type, intptr_t val, void *pv, void *sp, void *ra, void *xp
 
        int32_t        index;
        java_handle_t* p;
+       void*          entry;
 
        switch (type) {
        case TRAP_NullPointerException:
@@ -203,7 +204,8 @@ void* trap_handle(int type, intptr_t val, void *pv, void *sp, void *ra, void *xp
                break;
 
        case TRAP_COMPILER:
-               p = (java_handle_t*) jit_compile_handle(m, sfi.pv, ra, (void*) val);
+               entry = jit_compile_handle(m, sfi.pv, ra, (void*) val);
+               p = NULL;
                break;
 
 #if defined(ENABLE_REPLACEMENT)
@@ -255,9 +257,9 @@ void* trap_handle(int type, intptr_t val, void *pv, void *sp, void *ra, void *xp
                // The normal case for a compiler trap is to jump directly to
                // the newly compiled method.
 
-               if (p != NULL) {
-                       es.pc = (uint8_t *) (uintptr_t) p;
-                       es.pv = (uint8_t *) (uintptr_t) p;
+               if (entry != NULL) {
+                       es.pc = (uint8_t *) (uintptr_t) entry;
+                       es.pv = (uint8_t *) (uintptr_t) entry;
                        break;
                }
 
@@ -305,7 +307,7 @@ void* trap_handle(int type, intptr_t val, void *pv, void *sp, void *ra, void *xp
        /* AFTER: removing stackframeinfo */
 
        if (type == TRAP_COMPILER)
-               return p;
+               return entry;
        else
                return LLNI_UNWRAP(p);
 }