/* -- Trace setup --------------------------------------------------------- */
/* 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;
+ int sink = T->sinktags;
IRRef nins = T->nins;
IRIns *ir, *lastir;
int inloop;
ASMState as_;
ASMState *as = &as_;
MCode *origtop;
- int sink;
/* Ensure an initialized instruction beyond the last one for HIOP checks. */
J->cur.nins = lj_ir_nextins(J);
as->mcp = as->mctop;
as->mclim = as->mcbot + MCLIM_REDZONE;
asm_setup_target(as);
- sink = (IR(REF_BASE)->prev == 1);
do {
as->mcp = as->mctop;
as->gcsteps = 0;
as->sectref = as->loopref;
as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED;
- asm_setup_regsp(as, sink);
+ asm_setup_regsp(as);
if (!as->loopref)
asm_tail_link(as);
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. */
- uint16_t unused2;
+ uint8_t sinktags; /* Trace has SINK tags. */
+ uint8_t unused1;
#ifdef LUAJIT_USE_GDBJIT
void *gdbjit_entry; /* GDB JIT entry. */
#endif
} 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)
{
IRIns *ir, *irfirst = IR(J->cur.nk);
if (!irt_ismarked(ir->t)) {
ir->t.irt &= ~IRT_GUARD;
ir->prev = REGSP(RID_SINK, 0);
+ J->cur.sinktags = 1; /* Signal present SINK tags to assembler. */
} else {
irt_clearmark(ir->t);
ir->prev = REGSP_INIT;
break;
}
}
- IR(REF_BASE)->prev = 1; /* Signal SINK flags to assembler. */
}
/* Allocation sinking and store sinking.