Skip to content

Commit

Permalink
Remove EXITSTATE_PCREG
Browse files Browse the repository at this point in the history
Remove unused feature where the trace number at exit is discovered
with a linear search for the trace whose mcode includes the exit jump.

This is not used on the x86-64 VM because the trace number is already
known without having to search.
  • Loading branch information
lukego committed Nov 15, 2017
1 parent c83fd4c commit b6902f8
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/lj_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,21 +671,6 @@ static TValue *trace_exit_cp(lua_State *L, lua_CFunction dummy, void *ud)
}


#ifdef EXITSTATE_PCREG
/* Determine trace number from pc of exit instruction. */
static TraceNo trace_exit_find(jit_State *J, MCode *pc)
{
TraceNo traceno;
for (traceno = 1; traceno < J->sizetrace; traceno++) {
GCtrace *T = traceref(J, traceno);
if (T && pc >= T->mcode && pc < (MCode *)((char *)T->mcode + T->szmcode))
return traceno;
}
lua_assert(0);
return 0;
}
#endif

/* A trace exited. Restore interpreter state. */
int lj_trace_exit(jit_State *J, void *exptr)
{
Expand All @@ -696,9 +681,6 @@ int lj_trace_exit(jit_State *J, void *exptr)
const BCIns *pc;
void *cf;
GCtrace *T;
#ifdef EXITSTATE_PCREG
J->parent = trace_exit_find(J, (MCode *)(intptr_t)ex->gpr[EXITSTATE_PCREG]);
#endif
T = traceref(J, J->parent); UNUSED(T);
#ifdef EXITSTATE_CHECKEXIT
if (J->exitno == T->nsnap) { /* Treat stack check like a parent exit. */
Expand Down

0 comments on commit b6902f8

Please sign in to comment.