aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dynasm/dasm_arm.lua5
-rw-r--r--src/lj_strscan.c7
-rw-r--r--src/vm_arm.dasc8
-rw-r--r--src/vm_mips.dasc2
-rw-r--r--src/vm_ppc.dasc2
5 files changed, 14 insertions, 10 deletions
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)
929 -- A single opcode needs a maximum of 3 positions. 929 -- A single opcode needs a maximum of 3 positions.
930 if secpos+3 > maxsecpos then wflush() end 930 if secpos+3 > maxsecpos then wflush() end
931 local pos = wpos() 931 local pos = wpos()
932 local apos, spos = #actargs, secpos 932 local lpos, apos, spos = #actlist, #actargs, secpos
933 933
934 local ok, err 934 local ok, err
935 for t in gmatch(template, "[^|]+") do 935 for t in gmatch(template, "[^|]+") do
936 ok, err = pcall(parse_template, params, t, nparams, pos) 936 ok, err = pcall(parse_template, params, t, nparams, pos)
937 if ok then return end 937 if ok then return end
938 secpos = spos 938 secpos = spos
939 actlist[lpos+1] = nil
940 actlist[lpos+2] = nil
941 actlist[lpos+3] = nil
939 actargs[apos+1] = nil 942 actargs[apos+1] = nil
940 actargs[apos+2] = nil 943 actargs[apos+2] = nil
941 actargs[apos+3] = nil 944 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,
289 289
290 /* Scale down until no more than 17 or 18 integer part digits remain. */ 290 /* Scale down until no more than 17 or 18 integer part digits remain. */
291 while (idig > 9) { 291 while (idig > 9) {
292 uint32_t i, cy = 0; 292 uint32_t i = hi, cy = 0;
293 ex2 += 6; 293 ex2 += 6;
294 for (i = hi; i != lo; i = DNEXT(i)) { 294 do {
295 cy += xi[i]; 295 cy += xi[i];
296 xi[i] = (cy >> 6); 296 xi[i] = (cy >> 6);
297 cy = 100 * (cy & 0x3f); 297 cy = 100 * (cy & 0x3f);
298 if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--; 298 if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--;
299 } 299 i = DNEXT(i);
300 } while (i != lo);
300 while (cy) { 301 while (cy) {
301 if (hi == lo) { xi[DPREV(lo)] |= 1; break; } 302 if (hi == lo) { xi[DPREV(lo)] |= 1; break; }
302 xi[lo] = (cy >> 6); lo = DNEXT(lo); 303 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)
336 | // - The GC shrinks the stack in between. 336 | // - The GC shrinks the stack in between.
337 | // - A return back from a lua_call() with (high) nresults adjustment. 337 | // - A return back from a lua_call() with (high) nresults adjustment.
338 | str BASE, L->top // Save current top held in BASE (yes). 338 | str BASE, L->top // Save current top held in BASE (yes).
339 | mov CARG2, KBASE 339 | lsr CARG2, KBASE, #3
340 | mov CARG1, L 340 | mov CARG1, L
341 | bl extern lj_state_growstack // (lua_State *L, int n) 341 | bl extern lj_state_growstack // (lua_State *L, int n)
342 | ldr BASE, L->top // Need the (realloced) L->top in BASE. 342 | ldr BASE, L->top // Need the (realloced) L->top in BASE.
@@ -390,7 +390,7 @@ static void build_subroutines(BuildCtx *ctx)
390 | str BASE, L->base 390 | str BASE, L->base
391 | add PC, PC, #4 // Must point after first instruction. 391 | add PC, PC, #4 // Must point after first instruction.
392 | str RC, L->top 392 | str RC, L->top
393 | lsr CARG3, RA, #3 393 | lsr CARG2, RA, #3
394 |2: 394 |2:
395 | // L->base = new base, L->top = top 395 | // L->base = new base, L->top = top
396 | str PC, SAVE_PC 396 | str PC, SAVE_PC
@@ -3295,10 +3295,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
3295 | mvn RC, RC 3295 | mvn RC, RC
3296 | ldr UPVAL:CARG2, [LFUNC:CARG2, RA] 3296 | ldr UPVAL:CARG2, [LFUNC:CARG2, RA]
3297 | ldr STR:CARG3, [KBASE, RC, lsl #2] 3297 | ldr STR:CARG3, [KBASE, RC, lsl #2]
3298 | mvn CARG4, #~LJ_TSTR
3299 | ldrb RB, UPVAL:CARG2->marked 3298 | ldrb RB, UPVAL:CARG2->marked
3300 | ldr CARG2, UPVAL:CARG2->v
3301 | ldrb RC, UPVAL:CARG2->closed 3299 | ldrb RC, UPVAL:CARG2->closed
3300 | ldr CARG2, UPVAL:CARG2->v
3301 | mvn CARG4, #~LJ_TSTR
3302 | tst RB, #LJ_GC_BLACK // isblack(uv) 3302 | tst RB, #LJ_GC_BLACK // isblack(uv)
3303 | ldrb RB, STR:CARG3->marked 3303 | ldrb RB, STR:CARG3->marked
3304 | strd CARG34, [CARG2] 3304 | 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)
399 | // - A return back from a lua_call() with (high) nresults adjustment. 399 | // - A return back from a lua_call() with (high) nresults adjustment.
400 | load_got lj_state_growstack 400 | load_got lj_state_growstack
401 | move MULTRES, RD 401 | move MULTRES, RD
402 | move CARG2, TMP2 402 | srl CARG2, TMP2, 3
403 | call_intern lj_state_growstack // (lua_State *L, int n) 403 | call_intern lj_state_growstack // (lua_State *L, int n)
404 |. move CARG1, L 404 |. move CARG1, L
405 | lw TMP2, SAVE_NRES 405 | 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)
587 | // - A return back from a lua_call() with (high) nresults adjustment. 587 | // - A return back from a lua_call() with (high) nresults adjustment.
588 | stp BASE, L->top // Save current top held in BASE (yes). 588 | stp BASE, L->top // Save current top held in BASE (yes).
589 | mr SAVE0, RD 589 | mr SAVE0, RD
590 | mr CARG2, TMP2 590 | srwi CARG2, TMP2, 3
591 | mr CARG1, L 591 | mr CARG1, L
592 | bl extern lj_state_growstack // (lua_State *L, int n) 592 | bl extern lj_state_growstack // (lua_State *L, int n)
593 | lwz TMP2, SAVE_NRES 593 | lwz TMP2, SAVE_NRES