mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
7a76d435da
@ -929,13 +929,16 @@ map_op[".template__"] = function(params, template, nparams)
|
|||||||
-- A single opcode needs a maximum of 3 positions.
|
-- A single opcode needs a maximum of 3 positions.
|
||||||
if secpos+3 > maxsecpos then wflush() end
|
if secpos+3 > maxsecpos then wflush() end
|
||||||
local pos = wpos()
|
local pos = wpos()
|
||||||
local apos, spos = #actargs, secpos
|
local lpos, apos, spos = #actlist, #actargs, secpos
|
||||||
|
|
||||||
local ok, err
|
local ok, err
|
||||||
for t in gmatch(template, "[^|]+") do
|
for t in gmatch(template, "[^|]+") do
|
||||||
ok, err = pcall(parse_template, params, t, nparams, pos)
|
ok, err = pcall(parse_template, params, t, nparams, pos)
|
||||||
if ok then return end
|
if ok then return end
|
||||||
secpos = spos
|
secpos = spos
|
||||||
|
actlist[lpos+1] = nil
|
||||||
|
actlist[lpos+2] = nil
|
||||||
|
actlist[lpos+3] = nil
|
||||||
actargs[apos+1] = nil
|
actargs[apos+1] = nil
|
||||||
actargs[apos+2] = nil
|
actargs[apos+2] = nil
|
||||||
actargs[apos+3] = nil
|
actargs[apos+3] = nil
|
||||||
|
@ -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. */
|
/* Scale down until no more than 17 or 18 integer part digits remain. */
|
||||||
while (idig > 9) {
|
while (idig > 9) {
|
||||||
uint32_t i, cy = 0;
|
uint32_t i = hi, cy = 0;
|
||||||
ex2 += 6;
|
ex2 += 6;
|
||||||
for (i = hi; i != lo; i = DNEXT(i)) {
|
do {
|
||||||
cy += xi[i];
|
cy += xi[i];
|
||||||
xi[i] = (cy >> 6);
|
xi[i] = (cy >> 6);
|
||||||
cy = 100 * (cy & 0x3f);
|
cy = 100 * (cy & 0x3f);
|
||||||
if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--;
|
if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--;
|
||||||
}
|
i = DNEXT(i);
|
||||||
|
} while (i != lo);
|
||||||
while (cy) {
|
while (cy) {
|
||||||
if (hi == lo) { xi[DPREV(lo)] |= 1; break; }
|
if (hi == lo) { xi[DPREV(lo)] |= 1; break; }
|
||||||
xi[lo] = (cy >> 6); lo = DNEXT(lo);
|
xi[lo] = (cy >> 6); lo = DNEXT(lo);
|
||||||
|
@ -336,7 +336,7 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| // - The GC shrinks the stack in between.
|
| // - The GC shrinks the stack in between.
|
||||||
| // - A return back from a lua_call() with (high) nresults adjustment.
|
| // - A return back from a lua_call() with (high) nresults adjustment.
|
||||||
| str BASE, L->top // Save current top held in BASE (yes).
|
| str BASE, L->top // Save current top held in BASE (yes).
|
||||||
| mov CARG2, KBASE
|
| lsr CARG2, KBASE, #3
|
||||||
| mov CARG1, L
|
| mov CARG1, L
|
||||||
| bl extern lj_state_growstack // (lua_State *L, int n)
|
| bl extern lj_state_growstack // (lua_State *L, int n)
|
||||||
| ldr BASE, L->top // Need the (realloced) L->top in BASE.
|
| 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
|
| str BASE, L->base
|
||||||
| add PC, PC, #4 // Must point after first instruction.
|
| add PC, PC, #4 // Must point after first instruction.
|
||||||
| str RC, L->top
|
| str RC, L->top
|
||||||
| lsr CARG3, RA, #3
|
| lsr CARG2, RA, #3
|
||||||
|2:
|
|2:
|
||||||
| // L->base = new base, L->top = top
|
| // L->base = new base, L->top = top
|
||||||
| str PC, SAVE_PC
|
| str PC, SAVE_PC
|
||||||
@ -3295,10 +3295,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| mvn RC, RC
|
| mvn RC, RC
|
||||||
| ldr UPVAL:CARG2, [LFUNC:CARG2, RA]
|
| ldr UPVAL:CARG2, [LFUNC:CARG2, RA]
|
||||||
| ldr STR:CARG3, [KBASE, RC, lsl #2]
|
| ldr STR:CARG3, [KBASE, RC, lsl #2]
|
||||||
| mvn CARG4, #~LJ_TSTR
|
|
||||||
| ldrb RB, UPVAL:CARG2->marked
|
| ldrb RB, UPVAL:CARG2->marked
|
||||||
| ldr CARG2, UPVAL:CARG2->v
|
|
||||||
| ldrb RC, UPVAL:CARG2->closed
|
| ldrb RC, UPVAL:CARG2->closed
|
||||||
|
| ldr CARG2, UPVAL:CARG2->v
|
||||||
|
| mvn CARG4, #~LJ_TSTR
|
||||||
| tst RB, #LJ_GC_BLACK // isblack(uv)
|
| tst RB, #LJ_GC_BLACK // isblack(uv)
|
||||||
| ldrb RB, STR:CARG3->marked
|
| ldrb RB, STR:CARG3->marked
|
||||||
| strd CARG34, [CARG2]
|
| strd CARG34, [CARG2]
|
||||||
|
@ -399,7 +399,7 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| // - A return back from a lua_call() with (high) nresults adjustment.
|
| // - A return back from a lua_call() with (high) nresults adjustment.
|
||||||
| load_got lj_state_growstack
|
| load_got lj_state_growstack
|
||||||
| move MULTRES, RD
|
| move MULTRES, RD
|
||||||
| move CARG2, TMP2
|
| srl CARG2, TMP2, 3
|
||||||
| call_intern lj_state_growstack // (lua_State *L, int n)
|
| call_intern lj_state_growstack // (lua_State *L, int n)
|
||||||
|. move CARG1, L
|
|. move CARG1, L
|
||||||
| lw TMP2, SAVE_NRES
|
| lw TMP2, SAVE_NRES
|
||||||
|
@ -587,7 +587,7 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| // - A return back from a lua_call() with (high) nresults adjustment.
|
| // - A return back from a lua_call() with (high) nresults adjustment.
|
||||||
| stp BASE, L->top // Save current top held in BASE (yes).
|
| stp BASE, L->top // Save current top held in BASE (yes).
|
||||||
| mr SAVE0, RD
|
| mr SAVE0, RD
|
||||||
| mr CARG2, TMP2
|
| srwi CARG2, TMP2, 3
|
||||||
| mr CARG1, L
|
| mr CARG1, L
|
||||||
| bl extern lj_state_growstack // (lua_State *L, int n)
|
| bl extern lj_state_growstack // (lua_State *L, int n)
|
||||||
| lwz TMP2, SAVE_NRES
|
| lwz TMP2, SAVE_NRES
|
||||||
|
Loading…
Reference in New Issue
Block a user