Refactor IR_VLOAD to take an offset.
This commit is contained in:
@@ -260,9 +260,9 @@ TRef lj_record_constify(jit_State *J, cTValue *o)
|
||||
}
|
||||
|
||||
/* Emit a VLOAD with the correct type. */
|
||||
TRef lj_record_vload(jit_State *J, TRef ref, IRType t)
|
||||
TRef lj_record_vload(jit_State *J, TRef ref, MSize idx, IRType t)
|
||||
{
|
||||
TRef tr = emitir(IRTG(IR_VLOAD, t), ref, 0);
|
||||
TRef tr = emitir(IRTG(IR_VLOAD, t), ref, idx);
|
||||
if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */
|
||||
return tr;
|
||||
}
|
||||
@@ -1848,9 +1848,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
||||
vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8));
|
||||
for (i = 0; i < nload; i++) {
|
||||
IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]);
|
||||
TRef aref = emitir(IRT(IR_AREF, IRT_PGC),
|
||||
vbase, lj_ir_kint(J, (int32_t)i));
|
||||
J->base[dst+i] = lj_record_vload(J, aref, t);
|
||||
J->base[dst+i] = lj_record_vload(J, vbase, i, t);
|
||||
}
|
||||
} else {
|
||||
emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs));
|
||||
@@ -1897,7 +1895,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
|
||||
lj_ir_kint(J, frofs-(8<<LJ_FR2)));
|
||||
t = itype2irt(&J->L->base[idx-2-LJ_FR2-nvararg]);
|
||||
aref = emitir(IRT(IR_AREF, IRT_PGC), vbase, tridx);
|
||||
tr = lj_record_vload(J, aref, t);
|
||||
tr = lj_record_vload(J, aref, 0, t);
|
||||
}
|
||||
J->base[dst-2-LJ_FR2] = tr;
|
||||
J->maxslot = dst-1-LJ_FR2;
|
||||
|
||||
Reference in New Issue
Block a user