aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-10-24 16:02:37 +0200
committerMike Pall <mike>2011-10-24 16:11:38 +0200
commita0d782755482483c09e919a51c396322dd228bf2 (patch)
treebf599dfa722e463593f44f9f8647fb75b4618381 /src/lj_asm.c
parent84683405fbacad0938a953d9654bec27ac75d565 (diff)
downloadluajit-a0d782755482483c09e919a51c396322dd228bf2.tar.gz
luajit-a0d782755482483c09e919a51c396322dd228bf2.tar.bz2
luajit-a0d782755482483c09e919a51c396322dd228bf2.zip
Generalize handling of stack checks indicated by highest exit + 1.
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r--src/lj_asm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index c795b99e..bb134ac2 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -1357,9 +1357,15 @@ static void asm_head_side(ASMState *as)
1357 /* Inherit top stack slot already checked by parent trace. */ 1357 /* Inherit top stack slot already checked by parent trace. */
1358 as->T->topslot = as->parent->topslot; 1358 as->T->topslot = as->parent->topslot;
1359 if (as->topslot > as->T->topslot) { /* Need to check for higher slot? */ 1359 if (as->topslot > as->T->topslot) { /* Need to check for higher slot? */
1360 as->T->topslot = (uint8_t)as->topslot; /* Remember for child traces. */ 1360#ifdef EXITSTATE_CHECKEXIT
1361 /* Highest exit + 1 indicates stack check. */
1362 ExitNo exitno = as->T->nsnap;
1363#else
1361 /* Reuse the parent exit in the context of the parent trace. */ 1364 /* Reuse the parent exit in the context of the parent trace. */
1362 asm_stack_check(as, as->topslot, irp, allow & RSET_GPR, as->J->exitno); 1365 ExitNo exitno = as->J->exitno;
1366#endif
1367 as->T->topslot = (uint8_t)as->topslot; /* Remember for child traces. */
1368 asm_stack_check(as, as->topslot, irp, allow & RSET_GPR, exitno);
1363 } 1369 }
1364} 1370}
1365 1371