diff options
author | Mike Pall <mike> | 2010-02-18 03:43:09 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-02-18 06:07:31 +0100 |
commit | 59f54be9d362514724b033d3f2959f215b05957f (patch) | |
tree | 62cc4cc8008ceed2f4b842c213fab384410de32f /src/lj_record.c | |
parent | 2f300fb66a17e513669eb9cc3b4d85295a38a471 (diff) | |
download | luajit-59f54be9d362514724b033d3f2959f215b05957f.tar.gz luajit-59f54be9d362514724b033d3f2959f215b05957f.tar.bz2 luajit-59f54be9d362514724b033d3f2959f215b05957f.zip |
Update trace recorder infrastructure for hot calls.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 19 |
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); |