aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_sink.c')
-rw-r--r--src/lj_opt_sink.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lj_opt_sink.c b/src/lj_opt_sink.c
index df7f58af..c5323b11 100644
--- a/src/lj_opt_sink.c
+++ b/src/lj_opt_sink.c
@@ -165,8 +165,8 @@ static void sink_remark_phi(jit_State *J)
165/* Sweep instructions and tag sunken allocations and stores. */ 165/* Sweep instructions and tag sunken allocations and stores. */
166static void sink_sweep_ins(jit_State *J) 166static void sink_sweep_ins(jit_State *J)
167{ 167{
168 IRIns *ir, *irfirst = IR(J->cur.nk); 168 IRIns *ir, *irbase = IR(REF_BASE);
169 for (ir = IR(J->cur.nins-1) ; ir >= irfirst; ir--) { 169 for (ir = IR(J->cur.nins-1) ; ir >= irbase; ir--) {
170 switch (ir->o) { 170 switch (ir->o) {
171 case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { 171 case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: {
172 IRIns *ira = sink_checkalloc(J, ir); 172 IRIns *ira = sink_checkalloc(J, ir);
@@ -216,6 +216,13 @@ static void sink_sweep_ins(jit_State *J)
216 break; 216 break;
217 } 217 }
218 } 218 }
219 for (ir = IR(J->cur.nk); ir < irbase; ir++) {
220 irt_clearmark(ir->t);
221 ir->prev = REGSP_INIT;
222 /* The false-positive of irt_is64() for ASMREF_L (REF_NIL) is OK here. */
223 if (irt_is64(ir->t) && ir->o != IR_KNULL)
224 ir++;
225 }
219} 226}
220 227
221/* Allocation sinking and store sinking. 228/* Allocation sinking and store sinking.