diff --git a/src/lj_asm.c b/src/lj_asm.c index 5e7ff7f5..55bc814e 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c @@ -3043,8 +3043,7 @@ static void asm_tail_sync(ASMState *as) MSize n, nent = snap->nent; SnapEntry *map = &as->T->snapmap[snap->mapofs]; SnapEntry *flinks = map + nent + 1; - BCReg newbase = 0; - BCReg nslots, topslot = 0; + BCReg newbase = 0, topslot = 0; checkmclim(as); ra_allocref(as, REF_BASE, RID2RSET(RID_BASE)); @@ -3076,21 +3075,6 @@ static void asm_tail_sync(ASMState *as) emit_addptr(as, RID_BASE, 8*(int32_t)newbase); - /* Clear stack slots of newly added frames. */ - nslots = snap->nslots; - if (nslots <= topslot) { - if (nslots < topslot) { - BCReg s; - for (s = nslots; s <= topslot; s++) { - emit_movtomro(as, RID_EAX, RID_BASE, 8*((int32_t)s-1)+4); - checkmclim(as); - } - emit_loadi(as, RID_EAX, LJ_TNIL); - } else { - emit_movmroi(as, RID_BASE, 8*((int32_t)nslots-1)+4, LJ_TNIL); - } - } - /* Store the value of all modified slots to the Lua stack. */ for (n = 0; n < nent; n++) { SnapEntry sn = map[n]; diff --git a/src/lj_snap.c b/src/lj_snap.c index 95dc77da..547b2089 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c @@ -229,10 +229,6 @@ void lj_snap_restore(jit_State *J, void *exptr) o = L->top; } fs = o + framesize; - if (s == 0) /* Only partially clear tail call frame at #0. */ - o = &frame[nslots]; - while (o < fs) /* Clear slots of newly added frames. */ - setnilV(o++); } } }