From: Michael Starzinger Date: Mon, 29 Dec 2008 16:57:40 +0000 (+0100) Subject: * src/vm/jit/trap.cpp (trap_handle): Cleaned code for compiler traps. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=cacao.git;a=commitdiff_plain;h=a28db2d35987f19ba0ccb93065bcbe5ce56dd1b2 * src/vm/jit/trap.cpp (trap_handle): Cleaned code for compiler traps. This also fixes an issue on some archs not yet ported to executionstates. --- diff --git a/src/vm/jit/trap.cpp b/src/vm/jit/trap.cpp index c1dc16295..c4c97162d 100644 --- a/src/vm/jit/trap.cpp +++ b/src/vm/jit/trap.cpp @@ -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); }