summaryrefslogtreecommitdiff
path: root/src/lj_trace.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-04-18 13:41:30 +0200
committerMike Pall <mike>2010-04-19 00:43:35 +0200
commit932cda0fe3cbd34e60aa68479935c946f69b756f (patch)
tree9e46aa620a75b5ac5bc95413b8b7b57e507d82a1 /src/lj_trace.c
parentff82df797a5ddf6ed2610ff1808b1fdc53686ea1 (diff)
downloadluajit-932cda0fe3cbd34e60aa68479935c946f69b756f.tar.gz
luajit-932cda0fe3cbd34e60aa68479935c946f69b756f.tar.bz2
luajit-932cda0fe3cbd34e60aa68479935c946f69b756f.zip
Replace on-trace GC frame syncing with interpreter exit.
Need to sync GC objects to stack only during atomic GC phase. Need to setup a proper frame structure only for calling finalizers. Force an exit to the interpreter and let it handle the uncommon cases. Finally solves the "NYI: gcstep sync with frames" issue.
Diffstat (limited to 'src/lj_trace.c')
-rw-r--r--src/lj_trace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c
index cbd7ca6e..5571293e 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -692,8 +692,12 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
692 ); 692 );
693 693
694 pc = exd.pc; 694 pc = exd.pc;
695 trace_hotside(J, pc);
696 cf = cframe_raw(L->cframe); 695 cf = cframe_raw(L->cframe);
696 setcframe_pc(cf, pc);
697 if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize)
698 lj_gc_step(L); /* Exited because of GC: drive GC forward. */
699 else
700 trace_hotside(J, pc);
697 if (bc_op(*pc) == BC_JLOOP) { 701 if (bc_op(*pc) == BC_JLOOP) {
698 BCIns *retpc = &J->trace[bc_d(*pc)]->startins; 702 BCIns *retpc = &J->trace[bc_d(*pc)]->startins;
699 if (bc_isret(bc_op(*retpc))) { 703 if (bc_isret(bc_op(*retpc))) {
@@ -703,10 +707,10 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
703 *J->patchpc = *retpc; 707 *J->patchpc = *retpc;
704 } else { 708 } else {
705 pc = retpc; 709 pc = retpc;
710 setcframe_pc(cf, pc);
706 } 711 }
707 } 712 }
708 } 713 }
709 setcframe_pc(cf, pc);
710 /* Return MULTRES or 0. */ 714 /* Return MULTRES or 0. */
711 switch (bc_op(*pc)) { 715 switch (bc_op(*pc)) {
712 case BC_CALLM: case BC_CALLMT: 716 case BC_CALLM: case BC_CALLMT: