diff options
-rw-r--r-- | src/lj_snap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index bbe7dcae..252dc29e 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -24,6 +24,9 @@ | |||
24 | /* Some local macros to save typing. Undef'd at the end. */ | 24 | /* Some local macros to save typing. Undef'd at the end. */ |
25 | #define IR(ref) (&J->cur.ir[(ref)]) | 25 | #define IR(ref) (&J->cur.ir[(ref)]) |
26 | 26 | ||
27 | /* Emit raw IR without passing through optimizations. */ | ||
28 | #define emitir_raw(ot, a, b) (lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J)) | ||
29 | |||
27 | /* -- Snapshot buffer allocation ------------------------------------------ */ | 30 | /* -- Snapshot buffer allocation ------------------------------------------ */ |
28 | 31 | ||
29 | /* Grow snapshot buffer. */ | 32 | /* Grow snapshot buffer. */ |
@@ -138,11 +141,12 @@ void lj_snap_add(jit_State *J) | |||
138 | (nsnap > 0 && J->cur.snap[nsnap-1].ref == J->cur.nins)) { | 141 | (nsnap > 0 && J->cur.snap[nsnap-1].ref == J->cur.nins)) { |
139 | if (nsnap == 1 && J->parent == 0) { | 142 | if (nsnap == 1 && J->parent == 0) { |
140 | /* But preserve snap #0 PC for root traces. */ | 143 | /* But preserve snap #0 PC for root traces. */ |
141 | J->mergesnap = 0; | 144 | emitir_raw(IRT(IR_NOP, IRT_NIL), 0, 0); |
142 | return; | 145 | goto nomerge; |
143 | } | 146 | } |
144 | nsnapmap = J->cur.snap[--nsnap].mapofs; | 147 | nsnapmap = J->cur.snap[--nsnap].mapofs; |
145 | } else { | 148 | } else { |
149 | nomerge: | ||
146 | lj_snap_grow_buf(J, nsnap+1); | 150 | lj_snap_grow_buf(J, nsnap+1); |
147 | J->cur.nsnap = (uint16_t)(nsnap+1); | 151 | J->cur.nsnap = (uint16_t)(nsnap+1); |
148 | } | 152 | } |
@@ -447,5 +451,6 @@ const BCIns *lj_snap_restore(jit_State *J, void *exptr) | |||
447 | } | 451 | } |
448 | 452 | ||
449 | #undef IR | 453 | #undef IR |
454 | #undef emitir_raw | ||
450 | 455 | ||
451 | #endif | 456 | #endif |