summaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-02-22 22:39:12 +0100
committerMike Pall <mike>2011-02-22 22:39:12 +0100
commit4c97cc773091d3a7b523283b178ab53451583ca4 (patch)
treee4861f7359c30a5802a7f7d32277da3af0f15e79 /src/lj_record.c
parent8d0b073ff0506b94fd0586f96ae6967cf8167290 (diff)
downloadluajit-4c97cc773091d3a7b523283b178ab53451583ca4.tar.gz
luajit-4c97cc773091d3a7b523283b178ab53451583ca4.tar.bz2
luajit-4c97cc773091d3a7b523283b178ab53451583ca4.zip
Eliminate dead slots in snapshots using bytecode data-flow analysis.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r--src/lj_record.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index 6517a1b7..cfdd3e1a 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -1364,11 +1364,8 @@ static void rec_comp_fixup(jit_State *J, const BCIns *pc, int cond)
1364 /* Set PC to opposite target to avoid re-recording the comp. in side trace. */ 1364 /* Set PC to opposite target to avoid re-recording the comp. in side trace. */
1365 J->cur.snapmap[snap->mapofs + snap->nent] = SNAP_MKPC(npc); 1365 J->cur.snapmap[snap->mapofs + snap->nent] = SNAP_MKPC(npc);
1366 J->needsnap = 1; 1366 J->needsnap = 1;
1367 /* Shrink last snapshot if possible. */ 1367 if (bc_a(jmpins) < J->maxslot) J->maxslot = bc_a(jmpins);
1368 if (bc_a(jmpins) < J->maxslot) { 1368 lj_snap_shrink(J); /* Shrink last snapshot if possible. */
1369 J->maxslot = bc_a(jmpins);
1370 lj_snap_shrink(J);
1371 }
1372} 1369}
1373 1370
1374/* Record the next bytecode instruction (_before_ it's executed). */ 1371/* Record the next bytecode instruction (_before_ it's executed). */
@@ -1411,6 +1408,7 @@ void lj_record_ins(jit_State *J)
1411 /* Need snapshot before recording next bytecode (e.g. after a store). */ 1408 /* Need snapshot before recording next bytecode (e.g. after a store). */
1412 if (J->needsnap) { 1409 if (J->needsnap) {
1413 J->needsnap = 0; 1410 J->needsnap = 0;
1411 lj_snap_purge(J);
1414 lj_snap_add(J); 1412 lj_snap_add(J);
1415 J->mergesnap = 1; 1413 J->mergesnap = 1;
1416 } 1414 }