Clean up temporary bytecode patching.

This commit is contained in:
Mike Pall 2011-06-28 23:19:36 +02:00
parent 999d95253a
commit 3dbae4ffc2

View File

@ -545,9 +545,13 @@ static int trace_abort(jit_State *J)
/* Perform pending re-patch of a bytecode instruction. */ /* Perform pending re-patch of a bytecode instruction. */
static LJ_AINLINE void trace_pendpatch(jit_State *J, int force) static LJ_AINLINE void trace_pendpatch(jit_State *J, int force)
{ {
if (LJ_UNLIKELY(J->patchpc) && (force || J->chain[IR_RETF])) { if (LJ_UNLIKELY(J->patchpc)) {
*J->patchpc = J->patchins; if (force || J->bcskip == 0) {
J->patchpc = NULL; *J->patchpc = J->patchins;
J->patchpc = NULL;
} else {
J->bcskip = 0;
}
} }
} }
@ -769,6 +773,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
J->patchins = *pc; J->patchins = *pc;
J->patchpc = (BCIns *)pc; J->patchpc = (BCIns *)pc;
*J->patchpc = *retpc; *J->patchpc = *retpc;
J->bcskip = 1;
} else { } else {
pc = retpc; pc = retpc;
setcframe_pc(cf, pc); setcframe_pc(cf, pc);