aboutsummaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_record.c')
-rw-r--r--src/lj_record.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index ee62179b..a1471aae 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -260,9 +260,9 @@ TRef lj_record_constify(jit_State *J, cTValue *o)
260} 260}
261 261
262/* Emit a VLOAD with the correct type. */ 262/* Emit a VLOAD with the correct type. */
263TRef lj_record_vload(jit_State *J, TRef ref, IRType t) 263TRef lj_record_vload(jit_State *J, TRef ref, MSize idx, IRType t)
264{ 264{
265 TRef tr = emitir(IRTG(IR_VLOAD, t), ref, 0); 265 TRef tr = emitir(IRTG(IR_VLOAD, t), ref, idx);
266 if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */ 266 if (irtype_ispri(t)) tr = TREF_PRI(t); /* Canonicalize primitives. */
267 return tr; 267 return tr;
268} 268}
@@ -1848,9 +1848,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)
1848 vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8)); 1848 vbase = emitir(IRT(IR_ADD, IRT_PGC), vbase, lj_ir_kint(J, frofs-8));
1849 for (i = 0; i < nload; i++) { 1849 for (i = 0; i < nload; i++) {
1850 IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]); 1850 IRType t = itype2irt(&J->L->base[i-1-LJ_FR2-nvararg]);
1851 TRef aref = emitir(IRT(IR_AREF, IRT_PGC), 1851 J->base[dst+i] = lj_record_vload(J, vbase, i, t);
1852 vbase, lj_ir_kint(J, (int32_t)i));
1853 J->base[dst+i] = lj_record_vload(J, aref, t);
1854 } 1852 }
1855 } else { 1853 } else {
1856 emitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs)); 1854 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)
1897 lj_ir_kint(J, frofs-(8<<LJ_FR2))); 1895 lj_ir_kint(J, frofs-(8<<LJ_FR2)));
1898 t = itype2irt(&J->L->base[idx-2-LJ_FR2-nvararg]); 1896 t = itype2irt(&J->L->base[idx-2-LJ_FR2-nvararg]);
1899 aref = emitir(IRT(IR_AREF, IRT_PGC), vbase, tridx); 1897 aref = emitir(IRT(IR_AREF, IRT_PGC), vbase, tridx);
1900 tr = lj_record_vload(J, aref, t); 1898 tr = lj_record_vload(J, aref, 0, t);
1901 } 1899 }
1902 J->base[dst-2-LJ_FR2] = tr; 1900 J->base[dst-2-LJ_FR2] = tr;
1903 J->maxslot = dst-1-LJ_FR2; 1901 J->maxslot = dst-1-LJ_FR2;