diff --git a/src/lj_jit.h b/src/lj_jit.h index b3408e9bb2..8a522973bb 100644 --- a/src/lj_jit.h +++ b/src/lj_jit.h @@ -199,6 +199,8 @@ typedef struct GCtrace { TraceNo1 root; /* Root trace of side trace (or 0 for root traces). */ TraceNo1 nextroot; /* Next root trace for same prototype. */ TraceNo1 nextside; /* Next side trace of same root trace. */ + TraceNo1 parent; /* Parent of this trace (or 0 for root traces). */ + ExitNo exitno; /* Exit number in parent (valid for side-traces only). */ uint8_t sinktags; /* Trace has SINK tags. */ uint8_t unused1; } GCtrace; diff --git a/src/lj_trace.c b/src/lj_trace.c index 0b674ec276..99c49fa0a9 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c @@ -109,6 +109,8 @@ static void trace_save(jit_State *J, GCtrace *T) size_t szins = (J->cur.nins-J->cur.nk)*sizeof(IRIns); char *p = (char *)T + sztr; memcpy(T, &J->cur, sizeof(GCtrace)); + T->parent = J->parent; + T->exitno = J->exitno; setgcrefr(T->nextgc, J2G(J)->gc.root); setgcrefp(J2G(J)->gc.root, T); newwhite(J2G(J), T);