summaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_record.c')
-rw-r--r--src/lj_record.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index e5a8b208..f4bfd5f7 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -2248,6 +2248,11 @@ static const BCIns *rec_setup_root(jit_State *J)
2248 J->maxslot = ra; 2248 J->maxslot = ra;
2249 pc++; 2249 pc++;
2250 break; 2250 break;
2251 case BC_FUNCF:
2252 /* No bytecode range check for root traces started by a hot call. */
2253 J->maxslot = J->pt->numparams;
2254 pc++;
2255 break;
2251 default: 2256 default:
2252 lua_assert(0); 2257 lua_assert(0);
2253 break; 2258 break;
@@ -2370,15 +2375,11 @@ void lj_record_setup(jit_State *J)
2370 rec_stop(J, TRACE_INTERP); 2375 rec_stop(J, TRACE_INTERP);
2371 } else { /* Root trace. */ 2376 } else { /* Root trace. */
2372 J->cur.root = 0; 2377 J->cur.root = 0;
2373 if (J->pc >= proto_bc(J->pt)) { /* Not a hot CALL? */ 2378 J->cur.startins = *J->pc;
2374 J->cur.startins = *J->pc; 2379 J->pc = rec_setup_root(J);
2375 J->pc = rec_setup_root(J); 2380 /* Note: the loop instruction itself is recorded at the end and not
2376 /* Note: the loop instruction itself is recorded at the end and not 2381 ** at the start! So snapshot #0 needs to point to the *next* instruction.
2377 ** at the start! So snapshot #0 needs to point to the *next* instruction. 2382 */
2378 */
2379 } else {
2380 J->cur.startins = BCINS_ABC(BC_CALL, 0, 0, 0);
2381 }
2382 lj_snap_add(J); 2383 lj_snap_add(J);
2383 if (bc_op(J->cur.startins) == BC_FORL) 2384 if (bc_op(J->cur.startins) == BC_FORL)
2384 rec_setup_forl(J, J->pc-1); 2385 rec_setup_forl(J, J->pc-1);