summaryrefslogtreecommitdiff
path: root/src/lj_gc.c
diff options
context:
space:
mode:
authorMike Pall <mike>2013-08-26 18:28:58 +0200
committerMike Pall <mike>2013-08-26 18:28:58 +0200
commit5120240b77e4544b9b7405b4849a6cc63cdbbe1e (patch)
tree40bb90b12d912924bc9abf1feb12347b8db6b520 /src/lj_gc.c
parentb33e96f3522e96e816cc46470b19d121bf88cfc8 (diff)
downloadluajit-5120240b77e4544b9b7405b4849a6cc63cdbbe1e.tar.gz
luajit-5120240b77e4544b9b7405b4849a6cc63cdbbe1e.tar.bz2
luajit-5120240b77e4544b9b7405b4849a6cc63cdbbe1e.zip
Use g->jit_base for on/off-trace detection.
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r--src/lj_gc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index c9eaf21a..8dbf2090 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -475,7 +475,7 @@ static void gc_finalize(lua_State *L)
475 global_State *g = G(L); 475 global_State *g = G(L);
476 GCobj *o = gcnext(gcref(g->gc.mmudata)); 476 GCobj *o = gcnext(gcref(g->gc.mmudata));
477 cTValue *mo; 477 cTValue *mo;
478 lua_assert(gcref(g->jit_L) == NULL); /* Must not be called on trace. */ 478 lua_assert(tvref(g->jit_base) == NULL); /* Must not be called on trace. */
479 /* Unchain from list of userdata to be finalized. */ 479 /* Unchain from list of userdata to be finalized. */
480 if (o == gcref(g->gc.mmudata)) 480 if (o == gcref(g->gc.mmudata))
481 setgcrefnull(g->gc.mmudata); 481 setgcrefnull(g->gc.mmudata);
@@ -606,7 +606,7 @@ static size_t gc_onestep(lua_State *L)
606 g->gc.state = GCSatomic; /* End of mark phase. */ 606 g->gc.state = GCSatomic; /* End of mark phase. */
607 return 0; 607 return 0;
608 case GCSatomic: 608 case GCSatomic:
609 if (gcref(g->jit_L)) /* Don't run atomic phase on trace. */ 609 if (tvref(g->jit_base)) /* Don't run atomic phase on trace. */
610 return LJ_MAX_MEM; 610 return LJ_MAX_MEM;
611 atomic(g, L); 611 atomic(g, L);
612 g->gc.state = GCSsweepstring; /* Start of sweep phase. */ 612 g->gc.state = GCSsweepstring; /* Start of sweep phase. */
@@ -640,7 +640,7 @@ static size_t gc_onestep(lua_State *L)
640 } 640 }
641 case GCSfinalize: 641 case GCSfinalize:
642 if (gcref(g->gc.mmudata) != NULL) { 642 if (gcref(g->gc.mmudata) != NULL) {
643 if (gcref(g->jit_L)) /* Don't call finalizers on trace. */ 643 if (tvref(g->jit_base)) /* Don't call finalizers on trace. */
644 return LJ_MAX_MEM; 644 return LJ_MAX_MEM;
645 gc_finalize(L); /* Finalize one userdata object. */ 645 gc_finalize(L); /* Finalize one userdata object. */
646 if (g->gc.estimate > GCFINALIZECOST) 646 if (g->gc.estimate > GCFINALIZECOST)
@@ -697,7 +697,7 @@ void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L)
697int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps) 697int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps)
698{ 698{
699 lua_State *L = gco2th(gcref(g->jit_L)); 699 lua_State *L = gco2th(gcref(g->jit_L));
700 L->base = mref(G(L)->jit_base, TValue); 700 L->base = tvref(G(L)->jit_base);
701 L->top = curr_topL(L); 701 L->top = curr_topL(L);
702 while (steps-- > 0 && lj_gc_step(L) == 0) 702 while (steps-- > 0 && lj_gc_step(L) == 0)
703 ; 703 ;