mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 11:11:35 +02:00
Update LuaJIT to commit 72efc42
This commit is contained in:
@@ -116,6 +116,7 @@ static void rec_check_slots(jit_State *J)
|
||||
cTValue *tv = &base[s];
|
||||
IRRef ref = tref_ref(tr);
|
||||
IRIns *ir = NULL; /* Silence compiler. */
|
||||
lj_assertJ(tv < J->L->top, "slot %d above top of Lua stack", s);
|
||||
if (!LJ_FR2 || ref || !(tr & (TREF_FRAME | TREF_CONT))) {
|
||||
lj_assertJ(ref >= J->cur.nk && ref < J->cur.nins,
|
||||
"slot %d ref %04d out of range", s, ref - REF_BIAS);
|
||||
@@ -1600,6 +1601,8 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix)
|
||||
TRef key = ix->key;
|
||||
if (tref_isinteger(key)) /* NEWREF needs a TValue as a key. */
|
||||
key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT);
|
||||
else if (tref_isnumber(key) && tref_isk(key) && tvismzero(&ix->keyv))
|
||||
key = lj_ir_knum_zero(J); /* Canonicalize -0.0 to +0.0. */
|
||||
xref = emitir(IRT(IR_NEWREF, IRT_PGC), ix->tab, key);
|
||||
keybarrier = 0; /* NEWREF already takes care of the key barrier. */
|
||||
#ifdef LUAJIT_ENABLE_TABLE_BUMP
|
||||
@@ -1939,12 +1942,14 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
||||
if (J->framedepth > 0) { /* Simple case: varargs defined on-trace. */
|
||||
ptrdiff_t i;
|
||||
if (nvararg < 0) nvararg = 0;
|
||||
if (nresults == -1) {
|
||||
nresults = nvararg;
|
||||
J->maxslot = dst + (BCReg)nvararg;
|
||||
} else if (dst + nresults > J->maxslot) {
|
||||
if (nresults != 1) {
|
||||
if (nresults == -1) nresults = nvararg;
|
||||
J->maxslot = dst + (BCReg)nresults;
|
||||
} else if (dst >= J->maxslot) {
|
||||
J->maxslot = dst + 1;
|
||||
}
|
||||
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
|
||||
lj_trace_err(J, LJ_TRERR_STACKOV);
|
||||
for (i = 0; i < nresults; i++)
|
||||
J->base[dst+i] = i < nvararg ? getslot(J, i - nvararg - 1 - LJ_FR2) : TREF_NIL;
|
||||
} else { /* Unknown number of varargs passed to trace. */
|
||||
@@ -1972,8 +1977,9 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
||||
}
|
||||
for (i = nvararg; i < nresults; i++)
|
||||
J->base[dst+i] = TREF_NIL;
|
||||
if (dst + (BCReg)nresults > J->maxslot)
|
||||
if (nresults != 1 || dst >= J->maxslot) {
|
||||
J->maxslot = dst + (BCReg)nresults;
|
||||
}
|
||||
} else if (select_detect(J)) { /* y = select(x, ...) */
|
||||
TRef tridx = J->base[dst-1];
|
||||
TRef tr = TREF_NIL;
|
||||
@@ -2022,8 +2028,6 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
||||
lj_trace_err_info(J, LJ_TRERR_NYIBC);
|
||||
}
|
||||
}
|
||||
if (J->baseslot + J->maxslot >= LJ_MAX_JSLOTS)
|
||||
lj_trace_err(J, LJ_TRERR_STACKOV);
|
||||
}
|
||||
|
||||
/* -- Record allocations -------------------------------------------------- */
|
||||
@@ -2475,6 +2479,7 @@ void lj_record_ins(jit_State *J)
|
||||
|
||||
case BC_TSETM:
|
||||
rec_tsetm(J, ra, (BCReg)(J->L->top - J->L->base), (int32_t)rcv->u32.lo);
|
||||
J->maxslot = ra; /* The table slot at ra-1 is the highest used slot. */
|
||||
break;
|
||||
|
||||
case BC_TNEW:
|
||||
|
||||
Reference in New Issue
Block a user