| str TAB:RB, [CARG2]
| str CARG4, [CARG2, #4]
|2:
- | mvn CARG4, #~LJ_TISNUM
+ | mvn CARG4, #~LJ_TSTR
| str STR:RC, TMPDlo
| str CARG4, TMPDhi
| mov CARG3, TMPDp
| b >1
|
|->vmeta_unm:
+ | ldr INS, [PC, #-8]
+ | sub PC, PC, #4
| add CARG3, BASE, RC
| add CARG4, BASE, RC
| b >1
|//-- Bit library --------------------------------------------------------
|
|.macro .ffunc_bit, name
- | .ffunc_n bit_..name
+ | .ffunc_1 bit_..name
| NYI
|.endmacro
|
| NYI
|
|.macro .ffunc_bit_sh, name, ins, shmod
- | .ffunc_nn bit_..name
+ | .ffunc_2 bit_..name
| NYI
|.endmacro
|
| ins_next1
| ins_next2
| checktp CARG2, LJ_TISNUM
+ | bhi ->vmeta_unm
+ | eorne CARG2, CARG2, #0x80000000
| bne >5
- | rsbs CARG1, CARG1, #0
- | bvs >4
- |9:
+ | rsbseq CARG1, CARG1, #0
+ | ldrdvs CARG12, >9
+ |5:
| strd CARG12, [BASE, RA]
| ins_next3
- |4:
- | mov CARG2, #0x01e00000 // 2^31.
- | mov CARG1, #0
- | orr CARG2, CARG2, #0x40000000
- | b <9
- |5:
- | bhi ->vmeta_unm
- | add CARG2, CARG2, #0x80000000
- | b <9
+ |
+ |.align 8
+ |9:
+ | .long 0x00000000, 0x41e00000 // 2^31.
break;
case BC_LEN:
| // RA = dst*8, RC = src
|
|.macro ins_arithfp, fpcall
| ins_arithpre
+ | ins_arithfallback ins_arithcheck_num
||if (op == BC_MODVN) {
| ->BC_MODVN_Z:
||}
- | ins_arithfallback ins_arithcheck_num
| bl fpcall
| ins_next1
| ins_next2
break;
case BC_MODNV: case BC_MODVV:
| ins_arithpre
+ | ins_arithfallback ins_arithcheck_num
| b ->BC_MODVN_Z
break;
case BC_POW:
| str BASE, L->base
| str PC, SAVE_PC
| cmp CARG3, CARG4
+ | mov CARG1, L
| bhs >5
|1:
- | mov CARG1, L
if (op == BC_TNEW) {
| lsl CARG2, RC, #21
| lsr CARG3, RC, #11
| ins_next3
|5:
| bl extern lj_gc_step_fixtop // (lua_State *L)
+ | mov CARG1, L
| b <1
break;
| cmp CARG3, CARG2 // In array part?
| ldrdlo CARG34, [CARG4]
| bhs ->vmeta_tgetv
- | ins_next1
+ | ins_next1 // Overwrites RB!
| checktp CARG4, LJ_TNIL
| beq >5
|1:
| ldrb CARG2, TAB:CARG2->nomm
| tst CARG2, #1<<MM_index
| bne <1 // 'no __index' flag set: done.
+ | decode_RB8 RB, INS // Restore RB.
| b ->vmeta_tgetv
|
|9:
| ldrb RA, TAB:RA->nomm
| tst RA, #1<<MM_newindex
| bne <1 // 'no __newindex' flag set: done.
- | ldr INS, [PC, #-4] // Restore RA.
+ | ldr INS, [PC, #-4] // Restore RA and RB.
+ | decode_RB8 RB, INS
| decode_RA8 RA, INS
| b ->vmeta_tsetv
|
| mov TAB:RB, TAB:CARG1
| and CARG3, CARG3, CARG4 // idx = str->hash & tab->hmask
| add CARG3, CARG3, CARG3, lsl #1
+ | mov CARG4, #0
| add NODE:INS, NODE:INS, CARG3, lsl #3 // node = tab->node + idx*3*8
+ | strb CARG4, TAB:RB->nomm // Clear metamethod cache.
|1:
- | ldrd CARG12, NODE:INS->key // STALL: early NODE:INS.
+ | ldrd CARG12, NODE:INS->key
| ldr CARG4, NODE:INS->val.it
| ldr NODE:CARG3, NODE:INS->next
| cmp CARG1, STR:RC
| b ->BC_CALL_Z
break;
case BC_CALL:
- | // RA = base*8, (RB = nresults+1,) RC = nargs+1
| decode_RC8 NARGS8:RC, INS
+ | // RA = base*8, (RB = nresults+1,) RC = (nargs+1)*8
|->BC_CALL_Z:
| mov RB, BASE // Save old BASE for vmeta_call.
| ldrd CARG34, [BASE, RA]!
break;
case BC_ISNEXT:
- | // RA = base*8, RD = target (points to ITERN)
+ | // RA = base*8, RC = target (points to ITERN)
| add RA, BASE, RA
| add RC, PC, RC, lsl #2
| ldrd CFUNC:CARG12, [RA, #-24]
| bne <2
|3:
| decode_RA8 RA, INS
- | sub BASE, CARG3, RA
+ | sub CARG4, CARG3, RA
| decode_RB8 RB, INS
- | ldr LFUNC:CARG1, [BASE, FRAME_FUNC]
+ | ldr LFUNC:CARG1, [CARG4, FRAME_FUNC]
|5:
| cmp RB, RC // More results expected?
| bhi >6
+ | mov BASE, CARG4
| ldr CARG2, LFUNC:CARG1->field_pc
| ins_next1
| ins_next2
|
|6: // Fill up results with nil.
| mvn CARG2, #~LJ_TNIL
- | sub BASE, BASE, #8
+ | add BASE, BASE, #8
| add RC, RC, #8
| str CARG2, [BASE, #-12]
| b <5
| bhs ->vmeta_for
| cmp RB, #0
| strd CARG12, FOR_IDX
+ | strd CARG12, FOR_EXT
| blt >8
} else {
| cmp CARG4, #0
| ins_next2
|2:
| cmp NARGS8:RC, CARG2, lsl #3 // Check for missing parameters.
+ | mvn CARG4, #~LJ_TNIL
| ble >3
if (op == BC_JFUNCF) {
| NYI
}
|
|3: // Clear missing parameters.
- | mvn CARG1, #~LJ_TNIL
- | str CARG1, [BASE, NARGS8:RC]
+ | strd CARG34, [BASE, NARGS8:RC]
| add NARGS8:RC, NARGS8:RC, #8
| b <2
break;