diff options
author | Mike Pall <mike> | 2011-10-24 16:02:37 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-10-24 16:11:38 +0200 |
commit | a0d782755482483c09e919a51c396322dd228bf2 (patch) | |
tree | bf599dfa722e463593f44f9f8647fb75b4618381 /src/lj_asm.c | |
parent | 84683405fbacad0938a953d9654bec27ac75d565 (diff) | |
download | luajit2-a0d782755482483c09e919a51c396322dd228bf2.tar.gz |
Generalize handling of stack checks indicated by highest exit + 1.
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r-- | src/lj_asm.c | 10 |
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) /* Inherit top stack slot already checked by parent trace. */ as->T->topslot = as->parent->topslot; if (as->topslot > as->T->topslot) { /* Need to check for higher slot? */ - as->T->topslot = (uint8_t)as->topslot; /* Remember for child traces. */ +#ifdef EXITSTATE_CHECKEXIT + /* Highest exit + 1 indicates stack check. */ + ExitNo exitno = as->T->nsnap; +#else /* Reuse the parent exit in the context of the parent trace. */ - asm_stack_check(as, as->topslot, irp, allow & RSET_GPR, as->J->exitno); + ExitNo exitno = as->J->exitno; +#endif + as->T->topslot = (uint8_t)as->topslot; /* Remember for child traces. */ + asm_stack_check(as, as->topslot, irp, allow & RSET_GPR, exitno); } } |