mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Specialize to the global environment
This commit is contained in:
parent
7a0cf5fd4c
commit
0c70d3d34f
@ -2456,6 +2456,12 @@ void lj_record_ins(jit_State *J)
|
|||||||
case BC_GGET: case BC_GSET:
|
case BC_GGET: case BC_GSET:
|
||||||
settabV(J->L, &ix.tabv, tabref(J->fn->l.env));
|
settabV(J->L, &ix.tabv, tabref(J->fn->l.env));
|
||||||
ix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), getcurrf(J), IRFL_FUNC_ENV);
|
ix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), getcurrf(J), IRFL_FUNC_ENV);
|
||||||
|
if (gcrefeq(J->fn->l.env, J->L->env)) {
|
||||||
|
/* Specialize to the global environment. */
|
||||||
|
TRef ktab = lj_ir_ktab(J, tabref(J->fn->l.env));
|
||||||
|
emitir(IRTG(IR_EQ, IRT_TAB), ix.tab, ktab);
|
||||||
|
ix.tab = ktab;
|
||||||
|
}
|
||||||
ix.idxchain = LJ_MAX_IDXCHAIN;
|
ix.idxchain = LJ_MAX_IDXCHAIN;
|
||||||
rc = lj_record_idx(J, &ix);
|
rc = lj_record_idx(J, &ix);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user