mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
913df6a945
@ -1052,6 +1052,7 @@ LUA_API int lua_setmetatable(lua_State *L, int idx)
|
||||
/* Flush cache, since traces specialize to basemt. But not during __gc. */
|
||||
if (lj_trace_flushall(L))
|
||||
lj_err_caller(L, LJ_ERR_NOGCMM);
|
||||
o = index2adr(L, idx); /* Stack may have been reallocated. */
|
||||
if (tvisbool(o)) {
|
||||
/* NOBARRIER: basemt is a GC root. */
|
||||
setgcref(basemt_it(g, LJ_TTRUE), obj2gco(mt));
|
||||
|
@ -108,6 +108,9 @@ static void gc_mark_start(global_State *g)
|
||||
gc_markobj(g, tabref(mainthread(g)->env));
|
||||
gc_marktv(g, &g->registrytv);
|
||||
gc_mark_gcroot(g);
|
||||
#if LJ_HASFFI
|
||||
if (ctype_ctsG(g)) gc_markobj(g, ctype_ctsG(g)->finalizer);
|
||||
#endif
|
||||
g->gc.state = GCSpropagate;
|
||||
}
|
||||
|
||||
|
@ -948,7 +948,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
|
||||
if ((pt->flags & PROTO_NOJIT))
|
||||
lj_trace_err(J, LJ_TRERR_CJITOFF);
|
||||
if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) {
|
||||
if (check_downrec_unroll(J, pt)) {
|
||||
if (!J->cur.root && check_downrec_unroll(J, pt)) {
|
||||
J->maxslot = (BCReg)(rbase + gotresults);
|
||||
lj_snap_purge(J);
|
||||
lj_record_stop(J, LJ_TRLINK_DOWNREC, J->cur.traceno); /* Down-rec. */
|
||||
@ -970,6 +970,8 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
|
||||
lj_trace_err(J, LJ_TRERR_LLEAVE);
|
||||
} else if (J->needsnap) { /* Tailcalled to ff with side-effects. */
|
||||
lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */
|
||||
} else if (1 + pt->framesize >= LJ_MAX_JSLOTS) {
|
||||
lj_trace_err(J, LJ_TRERR_STACKOV);
|
||||
} else { /* Return to lower frame. Guard for the target we return to. */
|
||||
TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO);
|
||||
TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame));
|
||||
|
Loading…
Reference in New Issue
Block a user