diff options
author | Mike Pall <mike> | 2012-07-11 16:45:15 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-07-11 16:45:15 +0200 |
commit | 24fa85760cb29c68ff726c97c1ab67a3c0e1bd68 (patch) | |
tree | c5942f025653b49c92facc46c1c25771742a55c0 /src | |
parent | 79ecb231ce8079e8801f15307cf485efe7ee1255 (diff) | |
download | luajit-24fa85760cb29c68ff726c97c1ab67a3c0e1bd68.tar.gz luajit-24fa85760cb29c68ff726c97c1ab67a3c0e1bd68.tar.bz2 luajit-24fa85760cb29c68ff726c97c1ab67a3c0e1bd68.zip |
Use an explicit flag to signal SINK tags for a trace.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm.c | 7 | ||||
-rw-r--r-- | src/lj_jit.h | 3 | ||||
-rw-r--r-- | src/lj_opt_sink.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index ce2a70d7..5ad14003 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -1538,9 +1538,10 @@ static void asm_tail_link(ASMState *as) | |||
1538 | /* -- Trace setup --------------------------------------------------------- */ | 1538 | /* -- Trace setup --------------------------------------------------------- */ |
1539 | 1539 | ||
1540 | /* Clear reg/sp for all instructions and add register hints. */ | 1540 | /* Clear reg/sp for all instructions and add register hints. */ |
1541 | static void asm_setup_regsp(ASMState *as, int sink) | 1541 | static void asm_setup_regsp(ASMState *as) |
1542 | { | 1542 | { |
1543 | GCtrace *T = as->T; | 1543 | GCtrace *T = as->T; |
1544 | int sink = T->sinktags; | ||
1544 | IRRef nins = T->nins; | 1545 | IRRef nins = T->nins; |
1545 | IRIns *ir, *lastir; | 1546 | IRIns *ir, *lastir; |
1546 | int inloop; | 1547 | int inloop; |
@@ -1768,7 +1769,6 @@ void lj_asm_trace(jit_State *J, GCtrace *T) | |||
1768 | ASMState as_; | 1769 | ASMState as_; |
1769 | ASMState *as = &as_; | 1770 | ASMState *as = &as_; |
1770 | MCode *origtop; | 1771 | MCode *origtop; |
1771 | int sink; | ||
1772 | 1772 | ||
1773 | /* Ensure an initialized instruction beyond the last one for HIOP checks. */ | 1773 | /* Ensure an initialized instruction beyond the last one for HIOP checks. */ |
1774 | J->cur.nins = lj_ir_nextins(J); | 1774 | J->cur.nins = lj_ir_nextins(J); |
@@ -1789,7 +1789,6 @@ void lj_asm_trace(jit_State *J, GCtrace *T) | |||
1789 | as->mcp = as->mctop; | 1789 | as->mcp = as->mctop; |
1790 | as->mclim = as->mcbot + MCLIM_REDZONE; | 1790 | as->mclim = as->mcbot + MCLIM_REDZONE; |
1791 | asm_setup_target(as); | 1791 | asm_setup_target(as); |
1792 | sink = (IR(REF_BASE)->prev == 1); | ||
1793 | 1792 | ||
1794 | do { | 1793 | do { |
1795 | as->mcp = as->mctop; | 1794 | as->mcp = as->mctop; |
@@ -1805,7 +1804,7 @@ void lj_asm_trace(jit_State *J, GCtrace *T) | |||
1805 | as->gcsteps = 0; | 1804 | as->gcsteps = 0; |
1806 | as->sectref = as->loopref; | 1805 | as->sectref = as->loopref; |
1807 | as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED; | 1806 | as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED; |
1808 | asm_setup_regsp(as, sink); | 1807 | asm_setup_regsp(as); |
1809 | if (!as->loopref) | 1808 | if (!as->loopref) |
1810 | asm_tail_link(as); | 1809 | asm_tail_link(as); |
1811 | 1810 | ||
diff --git a/src/lj_jit.h b/src/lj_jit.h index 1ec54fe7..43a99392 100644 --- a/src/lj_jit.h +++ b/src/lj_jit.h | |||
@@ -233,7 +233,8 @@ typedef struct GCtrace { | |||
233 | TraceNo1 root; /* Root trace of side trace (or 0 for root traces). */ | 233 | TraceNo1 root; /* Root trace of side trace (or 0 for root traces). */ |
234 | TraceNo1 nextroot; /* Next root trace for same prototype. */ | 234 | TraceNo1 nextroot; /* Next root trace for same prototype. */ |
235 | TraceNo1 nextside; /* Next side trace of same root trace. */ | 235 | TraceNo1 nextside; /* Next side trace of same root trace. */ |
236 | uint16_t unused2; | 236 | uint8_t sinktags; /* Trace has SINK tags. */ |
237 | uint8_t unused1; | ||
237 | #ifdef LUAJIT_USE_GDBJIT | 238 | #ifdef LUAJIT_USE_GDBJIT |
238 | void *gdbjit_entry; /* GDB JIT entry. */ | 239 | void *gdbjit_entry; /* GDB JIT entry. */ |
239 | #endif | 240 | #endif |
diff --git a/src/lj_opt_sink.c b/src/lj_opt_sink.c index b7a3af2d..28291d77 100644 --- a/src/lj_opt_sink.c +++ b/src/lj_opt_sink.c | |||
@@ -163,7 +163,7 @@ static void sink_remark_phi(jit_State *J) | |||
163 | } while (remark); | 163 | } while (remark); |
164 | } | 164 | } |
165 | 165 | ||
166 | /* Sweep instructions and mark sunken allocations and stores. */ | 166 | /* Sweep instructions and tag sunken allocations and stores. */ |
167 | static void sink_sweep_ins(jit_State *J) | 167 | static void sink_sweep_ins(jit_State *J) |
168 | { | 168 | { |
169 | IRIns *ir, *irfirst = IR(J->cur.nk); | 169 | IRIns *ir, *irfirst = IR(J->cur.nk); |
@@ -194,6 +194,7 @@ static void sink_sweep_ins(jit_State *J) | |||
194 | if (!irt_ismarked(ir->t)) { | 194 | if (!irt_ismarked(ir->t)) { |
195 | ir->t.irt &= ~IRT_GUARD; | 195 | ir->t.irt &= ~IRT_GUARD; |
196 | ir->prev = REGSP(RID_SINK, 0); | 196 | ir->prev = REGSP(RID_SINK, 0); |
197 | J->cur.sinktags = 1; /* Signal present SINK tags to assembler. */ | ||
197 | } else { | 198 | } else { |
198 | irt_clearmark(ir->t); | 199 | irt_clearmark(ir->t); |
199 | ir->prev = REGSP_INIT; | 200 | ir->prev = REGSP_INIT; |
@@ -216,7 +217,6 @@ static void sink_sweep_ins(jit_State *J) | |||
216 | break; | 217 | break; |
217 | } | 218 | } |
218 | } | 219 | } |
219 | IR(REF_BASE)->prev = 1; /* Signal SINK flags to assembler. */ | ||
220 | } | 220 | } |
221 | 221 | ||
222 | /* Allocation sinking and store sinking. | 222 | /* Allocation sinking and store sinking. |