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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lj_opt_sink.c b/src/lj_opt_sink.c
index 784d9a1a..4b9008be 100644
--- a/src/lj_opt_sink.c
+++ b/src/lj_opt_sink.c
@@ -86,8 +86,7 @@ static void sink_mark_ins(jit_State *J)
86 switch (ir->o) { 86 switch (ir->o) {
87 case IR_BASE: 87 case IR_BASE:
88 return; /* Finished. */ 88 return; /* Finished. */
89 case IR_CALLL: /* IRCALL_lj_tab_len */ 89 case IR_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR: case IR_ALEN:
90 case IR_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR:
91 irt_setmark(IR(ir->op1)->t); /* Mark ref for remaining loads. */ 90 irt_setmark(IR(ir->op1)->t); /* Mark ref for remaining loads. */
92 break; 91 break;
93 case IR_FLOAD: 92 case IR_FLOAD:
@@ -173,8 +172,8 @@ static void sink_remark_phi(jit_State *J)
173/* Sweep instructions and tag sunken allocations and stores. */ 172/* Sweep instructions and tag sunken allocations and stores. */
174static void sink_sweep_ins(jit_State *J) 173static void sink_sweep_ins(jit_State *J)
175{ 174{
176 IRIns *ir, *irfirst = IR(J->cur.nk); 175 IRIns *ir, *irbase = IR(REF_BASE);
177 for (ir = IR(J->cur.nins-1) ; ir >= irfirst; ir--) { 176 for (ir = IR(J->cur.nins-1) ; ir >= irbase; ir--) {
178 switch (ir->o) { 177 switch (ir->o) {
179 case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: { 178 case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: {
180 IRIns *ira = sink_checkalloc(J, ir); 179 IRIns *ira = sink_checkalloc(J, ir);
@@ -224,6 +223,13 @@ static void sink_sweep_ins(jit_State *J)
224 break; 223 break;
225 } 224 }
226 } 225 }
226 for (ir = IR(J->cur.nk); ir < irbase; ir++) {
227 irt_clearmark(ir->t);
228 ir->prev = REGSP_INIT;
229 /* The false-positive of irt_is64() for ASMREF_L (REF_NIL) is OK here. */
230 if (irt_is64(ir->t) && ir->o != IR_KNULL)
231 ir++;
232 }
227} 233}
228 234
229/* Allocation sinking and store sinking. 235/* Allocation sinking and store sinking.