diff --git a/dynasm/dasm_arm.lua b/dynasm/dasm_arm.lua index 3aa8dead..d5078f7e 100644 --- a/dynasm/dasm_arm.lua +++ b/dynasm/dasm_arm.lua @@ -929,13 +929,16 @@ map_op[".template__"] = function(params, template, nparams) -- A single opcode needs a maximum of 3 positions. if secpos+3 > maxsecpos then wflush() end local pos = wpos() - local apos, spos = #actargs, secpos + local lpos, apos, spos = #actlist, #actargs, secpos local ok, err for t in gmatch(template, "[^|]+") do ok, err = pcall(parse_template, params, t, nparams, pos) if ok then return end secpos = spos + actlist[lpos+1] = nil + actlist[lpos+2] = nil + actlist[lpos+3] = nil actargs[apos+1] = nil actargs[apos+2] = nil actargs[apos+3] = nil diff --git a/src/lj_strscan.c b/src/lj_strscan.c index a21c414a..0fddd43b 100644 --- a/src/lj_strscan.c +++ b/src/lj_strscan.c @@ -289,14 +289,15 @@ static StrScanFmt strscan_dec(const uint8_t *p, TValue *o, /* Scale down until no more than 17 or 18 integer part digits remain. */ while (idig > 9) { - uint32_t i, cy = 0; + uint32_t i = hi, cy = 0; ex2 += 6; - for (i = hi; i != lo; i = DNEXT(i)) { + do { cy += xi[i]; xi[i] = (cy >> 6); cy = 100 * (cy & 0x3f); if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--; - } + i = DNEXT(i); + } while (i != lo); while (cy) { if (hi == lo) { xi[DPREV(lo)] |= 1; break; } xi[lo] = (cy >> 6); lo = DNEXT(lo); diff --git a/src/vm_arm.dasc b/src/vm_arm.dasc index 58efabce..9db3b827 100644 --- a/src/vm_arm.dasc +++ b/src/vm_arm.dasc @@ -336,7 +336,7 @@ static void build_subroutines(BuildCtx *ctx) | // - The GC shrinks the stack in between. | // - A return back from a lua_call() with (high) nresults adjustment. | str BASE, L->top // Save current top held in BASE (yes). - | mov CARG2, KBASE + | lsr CARG2, KBASE, #3 | mov CARG1, L | bl extern lj_state_growstack // (lua_State *L, int n) | ldr BASE, L->top // Need the (realloced) L->top in BASE. @@ -390,7 +390,7 @@ static void build_subroutines(BuildCtx *ctx) | str BASE, L->base | add PC, PC, #4 // Must point after first instruction. | str RC, L->top - | lsr CARG3, RA, #3 + | lsr CARG2, RA, #3 |2: | // L->base = new base, L->top = top | str PC, SAVE_PC @@ -3295,10 +3295,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | mvn RC, RC | ldr UPVAL:CARG2, [LFUNC:CARG2, RA] | ldr STR:CARG3, [KBASE, RC, lsl #2] - | mvn CARG4, #~LJ_TSTR | ldrb RB, UPVAL:CARG2->marked - | ldr CARG2, UPVAL:CARG2->v | ldrb RC, UPVAL:CARG2->closed + | ldr CARG2, UPVAL:CARG2->v + | mvn CARG4, #~LJ_TSTR | tst RB, #LJ_GC_BLACK // isblack(uv) | ldrb RB, STR:CARG3->marked | strd CARG34, [CARG2] diff --git a/src/vm_mips.dasc b/src/vm_mips.dasc index 3bf5a993..6c60fb47 100644 --- a/src/vm_mips.dasc +++ b/src/vm_mips.dasc @@ -399,7 +399,7 @@ static void build_subroutines(BuildCtx *ctx) | // - A return back from a lua_call() with (high) nresults adjustment. | load_got lj_state_growstack | move MULTRES, RD - | move CARG2, TMP2 + | srl CARG2, TMP2, 3 | call_intern lj_state_growstack // (lua_State *L, int n) |. move CARG1, L | lw TMP2, SAVE_NRES diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc index d7809f1f..a54057d0 100644 --- a/src/vm_ppc.dasc +++ b/src/vm_ppc.dasc @@ -587,7 +587,7 @@ static void build_subroutines(BuildCtx *ctx) | // - A return back from a lua_call() with (high) nresults adjustment. | stp BASE, L->top // Save current top held in BASE (yes). | mr SAVE0, RD - | mr CARG2, TMP2 + | srwi CARG2, TMP2, 3 | mr CARG1, L | bl extern lj_state_growstack // (lua_State *L, int n) | lwz TMP2, SAVE_NRES