Compare commits

...

2 Commits

Author SHA1 Message Date
Jude Melton-Houghton
d1fe2b2d94
Merge 0c70d3d34f into a4f56a459a 2025-01-14 04:15:06 +03:00
Jude Melton-Houghton
0c70d3d34f Specialize to the global environment 2022-11-14 08:43:34 -05:00

View File

@ -2524,6 +2524,12 @@ void lj_record_ins(jit_State *J)
case BC_GGET: case BC_GSET:
settabV(J->L, &ix.tabv, tabref(J->fn->l.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;
rc = lj_record_idx(J, &ix);
break;