Use an explicit flag to signal SINK tags for a trace.

This commit is contained in:
Mike Pall 2012-07-11 16:45:15 +02:00
parent 79ecb231ce
commit 24fa85760c
3 changed files with 7 additions and 7 deletions

View File

@ -1538,9 +1538,10 @@ static void asm_tail_link(ASMState *as)
/* -- Trace setup --------------------------------------------------------- */ /* -- Trace setup --------------------------------------------------------- */
/* Clear reg/sp for all instructions and add register hints. */ /* Clear reg/sp for all instructions and add register hints. */
static void asm_setup_regsp(ASMState *as, int sink) static void asm_setup_regsp(ASMState *as)
{ {
GCtrace *T = as->T; GCtrace *T = as->T;
int sink = T->sinktags;
IRRef nins = T->nins; IRRef nins = T->nins;
IRIns *ir, *lastir; IRIns *ir, *lastir;
int inloop; int inloop;
@ -1768,7 +1769,6 @@ void lj_asm_trace(jit_State *J, GCtrace *T)
ASMState as_; ASMState as_;
ASMState *as = &as_; ASMState *as = &as_;
MCode *origtop; MCode *origtop;
int sink;
/* Ensure an initialized instruction beyond the last one for HIOP checks. */ /* Ensure an initialized instruction beyond the last one for HIOP checks. */
J->cur.nins = lj_ir_nextins(J); J->cur.nins = lj_ir_nextins(J);
@ -1789,7 +1789,6 @@ void lj_asm_trace(jit_State *J, GCtrace *T)
as->mcp = as->mctop; as->mcp = as->mctop;
as->mclim = as->mcbot + MCLIM_REDZONE; as->mclim = as->mcbot + MCLIM_REDZONE;
asm_setup_target(as); asm_setup_target(as);
sink = (IR(REF_BASE)->prev == 1);
do { do {
as->mcp = as->mctop; as->mcp = as->mctop;
@ -1805,7 +1804,7 @@ void lj_asm_trace(jit_State *J, GCtrace *T)
as->gcsteps = 0; as->gcsteps = 0;
as->sectref = as->loopref; as->sectref = as->loopref;
as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED; as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED;
asm_setup_regsp(as, sink); asm_setup_regsp(as);
if (!as->loopref) if (!as->loopref)
asm_tail_link(as); asm_tail_link(as);

View File

@ -233,7 +233,8 @@ typedef struct GCtrace {
TraceNo1 root; /* Root trace of side trace (or 0 for root traces). */ TraceNo1 root; /* Root trace of side trace (or 0 for root traces). */
TraceNo1 nextroot; /* Next root trace for same prototype. */ TraceNo1 nextroot; /* Next root trace for same prototype. */
TraceNo1 nextside; /* Next side trace of same root trace. */ TraceNo1 nextside; /* Next side trace of same root trace. */
uint16_t unused2; uint8_t sinktags; /* Trace has SINK tags. */
uint8_t unused1;
#ifdef LUAJIT_USE_GDBJIT #ifdef LUAJIT_USE_GDBJIT
void *gdbjit_entry; /* GDB JIT entry. */ void *gdbjit_entry; /* GDB JIT entry. */
#endif #endif

View File

@ -163,7 +163,7 @@ static void sink_remark_phi(jit_State *J)
} while (remark); } while (remark);
} }
/* Sweep instructions and mark sunken allocations and stores. */ /* Sweep instructions and tag sunken allocations and stores. */
static void sink_sweep_ins(jit_State *J) static void sink_sweep_ins(jit_State *J)
{ {
IRIns *ir, *irfirst = IR(J->cur.nk); IRIns *ir, *irfirst = IR(J->cur.nk);
@ -194,6 +194,7 @@ static void sink_sweep_ins(jit_State *J)
if (!irt_ismarked(ir->t)) { if (!irt_ismarked(ir->t)) {
ir->t.irt &= ~IRT_GUARD; ir->t.irt &= ~IRT_GUARD;
ir->prev = REGSP(RID_SINK, 0); ir->prev = REGSP(RID_SINK, 0);
J->cur.sinktags = 1; /* Signal present SINK tags to assembler. */
} else { } else {
irt_clearmark(ir->t); irt_clearmark(ir->t);
ir->prev = REGSP_INIT; ir->prev = REGSP_INIT;
@ -216,7 +217,6 @@ static void sink_sweep_ins(jit_State *J)
break; break;
} }
} }
IR(REF_BASE)->prev = 1; /* Signal SINK flags to assembler. */
} }
/* Allocation sinking and store sinking. /* Allocation sinking and store sinking.