sink: Sweep constants in increasing order.

This commit is contained in:
Peter Cawley 2016-05-18 02:55:35 +01:00
parent 9d51806696
commit fdf6eb4678

View File

@ -166,8 +166,8 @@ static void sink_remark_phi(jit_State *J)
/* Sweep instructions and tag 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, *irbase = IR(REF_BASE);
for (ir = IR(J->cur.nins-1) ; ir >= irfirst; ir--) { for (ir = IR(J->cur.nins-1) ; ir >= irbase; ir--) {
switch (ir->o) { switch (ir->o) {
case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: {
IRIns *ira = sink_checkalloc(J, ir); IRIns *ira = sink_checkalloc(J, ir);
@ -217,6 +217,10 @@ static void sink_sweep_ins(jit_State *J)
break; break;
} }
} }
for (ir = IR(J->cur.nk); ir < irbase; ++ir) {
irt_clearmark(ir->t);
ir->prev = REGSP_INIT;
}
} }
/* Allocation sinking and store sinking. /* Allocation sinking and store sinking.