diff options
| -rw-r--r-- | src/vm_mips.dasc | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/src/vm_mips.dasc b/src/vm_mips.dasc index a7c3b4ae..23692e34 100644 --- a/src/vm_mips.dasc +++ b/src/vm_mips.dasc | |||
| @@ -596,28 +596,28 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 596 | | move RB, BASE | 596 | | move RB, BASE |
| 597 | | move BASE, TMP2 // Restore caller BASE. | 597 | | move BASE, TMP2 // Restore caller BASE. |
| 598 | | lw LFUNC:TMP1, FRAME_FUNC(TMP2) | 598 | | lw LFUNC:TMP1, FRAME_FUNC(TMP2) |
| 599 | #if LJ_HASFFI | 599 | |.if FFI |
| 600 | | sltiu AT, TMP0, 2 | 600 | | sltiu AT, TMP0, 2 |
| 601 | #endif | 601 | |.endif |
| 602 | | lw PC, -16+HI(RB) // Restore PC from [cont|PC]. | 602 | | lw PC, -16+HI(RB) // Restore PC from [cont|PC]. |
| 603 | | addu TMP2, RA, RD | 603 | | addu TMP2, RA, RD |
| 604 | | lw TMP1, LFUNC:TMP1->pc | 604 | | lw TMP1, LFUNC:TMP1->pc |
| 605 | #if LJ_HASFFI | 605 | |.if FFI |
| 606 | | bnez AT, >1 | 606 | | bnez AT, >1 |
| 607 | #endif | 607 | |.endif |
| 608 | |. sw TISNIL, -8+HI(TMP2) // Ensure one valid arg. | 608 | |. sw TISNIL, -8+HI(TMP2) // Ensure one valid arg. |
| 609 | | // BASE = base, RA = resultptr, RB = meta base | 609 | | // BASE = base, RA = resultptr, RB = meta base |
| 610 | | jr TMP0 // Jump to continuation. | 610 | | jr TMP0 // Jump to continuation. |
| 611 | |. lw KBASE, PC2PROTO(k)(TMP1) | 611 | |. lw KBASE, PC2PROTO(k)(TMP1) |
| 612 | | | 612 | | |
| 613 | #if LJ_HASFFI | 613 | |.if FFI |
| 614 | |1: | 614 | |1: |
| 615 | | bnez TMP0, ->cont_ffi_callback // cont = 1: return from FFI callback. | 615 | | bnez TMP0, ->cont_ffi_callback // cont = 1: return from FFI callback. |
| 616 | | // cont = 0: tailcall from C function. | 616 | | // cont = 0: tailcall from C function. |
| 617 | |. addiu TMP1, RB, -16 | 617 | |. addiu TMP1, RB, -16 |
| 618 | | b ->vm_call_tail | 618 | | b ->vm_call_tail |
| 619 | |. subu RC, TMP1, BASE | 619 | |. subu RC, TMP1, BASE |
| 620 | #endif | 620 | |.endif |
| 621 | | | 621 | | |
| 622 | |->cont_cat: // RA = resultptr, RB = meta base | 622 | |->cont_cat: // RA = resultptr, RB = meta base |
| 623 | | lw INS, -4(PC) | 623 | | lw INS, -4(PC) |
| @@ -798,7 +798,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 798 | |. nop | 798 | |. nop |
| 799 | | | 799 | | |
| 800 | |->vmeta_equal_cd: | 800 | |->vmeta_equal_cd: |
| 801 | #if LJ_HASFFI | 801 | |.if FFI |
| 802 | | load_got lj_meta_equal_cd | 802 | | load_got lj_meta_equal_cd |
| 803 | | move CARG2, INS | 803 | | move CARG2, INS |
| 804 | | addiu PC, PC, -4 | 804 | | addiu PC, PC, -4 |
| @@ -809,7 +809,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 809 | | // Returns 0/1 or TValue * (metamethod). | 809 | | // Returns 0/1 or TValue * (metamethod). |
| 810 | | b <3 | 810 | | b <3 |
| 811 | |. nop | 811 | |. nop |
| 812 | #endif | 812 | |.endif |
| 813 | | | 813 | | |
| 814 | |//-- Arithmetic metamethods --------------------------------------------- | 814 | |//-- Arithmetic metamethods --------------------------------------------- |
| 815 | | | 815 | | |
| @@ -902,22 +902,22 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 902 | | move MULTRES, INS | 902 | | move MULTRES, INS |
| 903 | | call_intern lj_meta_for // (lua_State *L, TValue *base) | 903 | | call_intern lj_meta_for // (lua_State *L, TValue *base) |
| 904 | |. move CARG1, L | 904 | |. move CARG1, L |
| 905 | #if LJ_HASJIT | 905 | |.if JIT |
| 906 | | decode_OP1 TMP0, MULTRES | 906 | | decode_OP1 TMP0, MULTRES |
| 907 | | li AT, BC_JFORI | 907 | | li AT, BC_JFORI |
| 908 | #endif | 908 | |.endif |
| 909 | | decode_RA8a RA, MULTRES | 909 | | decode_RA8a RA, MULTRES |
| 910 | | decode_RD8a RD, MULTRES | 910 | | decode_RD8a RD, MULTRES |
| 911 | | decode_RA8b RA | 911 | | decode_RA8b RA |
| 912 | #if LJ_HASJIT | 912 | |.if JIT |
| 913 | | beq TMP0, AT, =>BC_JFORI | 913 | | beq TMP0, AT, =>BC_JFORI |
| 914 | |. decode_RD8b RD | 914 | |. decode_RD8b RD |
| 915 | | b =>BC_FORI | 915 | | b =>BC_FORI |
| 916 | |. nop | 916 | |. nop |
| 917 | #else | 917 | |.else |
| 918 | | b =>BC_FORI | 918 | | b =>BC_FORI |
| 919 | |. decode_RD8b RD | 919 | |. decode_RD8b RD |
| 920 | #endif | 920 | |.endif |
| 921 | | | 921 | | |
| 922 | |//----------------------------------------------------------------------- | 922 | |//----------------------------------------------------------------------- |
| 923 | |//-- Fast functions ----------------------------------------------------- | 923 | |//-- Fast functions ----------------------------------------------------- |
| @@ -1936,7 +1936,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 1936 | |//----------------------------------------------------------------------- | 1936 | |//----------------------------------------------------------------------- |
| 1937 | | | 1937 | | |
| 1938 | |->vm_record: // Dispatch target for recording phase. | 1938 | |->vm_record: // Dispatch target for recording phase. |
| 1939 | #if LJ_HASJIT | 1939 | |.if JIT |
| 1940 | | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) | 1940 | | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) |
| 1941 | | andi AT, TMP3, HOOK_VMEVENT // No recording while in vmevent. | 1941 | | andi AT, TMP3, HOOK_VMEVENT // No recording while in vmevent. |
| 1942 | | bnez AT, >5 | 1942 | | bnez AT, >5 |
| @@ -1950,7 +1950,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 1950 | |. nop | 1950 | |. nop |
| 1951 | | b >1 | 1951 | | b >1 |
| 1952 | |. sw TMP2, DISPATCH_GL(hookcount)(DISPATCH) | 1952 | |. sw TMP2, DISPATCH_GL(hookcount)(DISPATCH) |
| 1953 | #endif | 1953 | |.endif |
| 1954 | | | 1954 | | |
| 1955 | |->vm_rethook: // Dispatch target for return hooks. | 1955 | |->vm_rethook: // Dispatch target for return hooks. |
| 1956 | | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) | 1956 | | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH) |
| @@ -2001,7 +2001,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2001 | |. lw MULTRES, -24+LO(RB) // Restore MULTRES for *M ins. | 2001 | |. lw MULTRES, -24+LO(RB) // Restore MULTRES for *M ins. |
| 2002 | | | 2002 | | |
| 2003 | |->vm_hotloop: // Hot loop counter underflow. | 2003 | |->vm_hotloop: // Hot loop counter underflow. |
| 2004 | #if LJ_HASJIT | 2004 | |.if JIT |
| 2005 | | lw LFUNC:TMP1, FRAME_FUNC(BASE) | 2005 | | lw LFUNC:TMP1, FRAME_FUNC(BASE) |
| 2006 | | addiu CARG1, DISPATCH, GG_DISP2J | 2006 | | addiu CARG1, DISPATCH, GG_DISP2J |
| 2007 | | sw PC, SAVE_PC | 2007 | | sw PC, SAVE_PC |
| @@ -2017,19 +2017,19 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2017 | |. sw TMP1, L->top | 2017 | |. sw TMP1, L->top |
| 2018 | | b <3 | 2018 | | b <3 |
| 2019 | |. nop | 2019 | |. nop |
| 2020 | #endif | 2020 | |.endif |
| 2021 | | | 2021 | | |
| 2022 | |->vm_callhook: // Dispatch target for call hooks. | 2022 | |->vm_callhook: // Dispatch target for call hooks. |
| 2023 | #if LJ_HASJIT | 2023 | |.if JIT |
| 2024 | | b >1 | 2024 | | b >1 |
| 2025 | #endif | 2025 | |.endif |
| 2026 | |. move CARG2, PC | 2026 | |. move CARG2, PC |
| 2027 | | | 2027 | | |
| 2028 | |->vm_hotcall: // Hot call counter underflow. | 2028 | |->vm_hotcall: // Hot call counter underflow. |
| 2029 | #if LJ_HASJIT | 2029 | |.if JIT |
| 2030 | | ori CARG2, PC, 1 | 2030 | | ori CARG2, PC, 1 |
| 2031 | |1: | 2031 | |1: |
| 2032 | #endif | 2032 | |.endif |
| 2033 | | load_got lj_dispatch_call | 2033 | | load_got lj_dispatch_call |
| 2034 | | addu TMP0, BASE, RC | 2034 | | addu TMP0, BASE, RC |
| 2035 | | sw PC, SAVE_PC | 2035 | | sw PC, SAVE_PC |
| @@ -2059,7 +2059,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2059 | |.endmacro | 2059 | |.endmacro |
| 2060 | | | 2060 | | |
| 2061 | |->vm_exit_handler: | 2061 | |->vm_exit_handler: |
| 2062 | #if LJ_HASJIT | 2062 | |.if JIT |
| 2063 | | addiu sp, sp, -(16+32*8+32*4) | 2063 | | addiu sp, sp, -(16+32*8+32*4) |
| 2064 | | savex_ 0, 1 | 2064 | | savex_ 0, 1 |
| 2065 | | savex_ 2, 3 | 2065 | | savex_ 2, 3 |
| @@ -2104,9 +2104,9 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2104 | | lw PC, SAVE_PC // Get SAVE_PC. | 2104 | | lw PC, SAVE_PC // Get SAVE_PC. |
| 2105 | | b >1 | 2105 | | b >1 |
| 2106 | |. sw L, SAVE_L // Set SAVE_L (on-trace resume/yield). | 2106 | |. sw L, SAVE_L // Set SAVE_L (on-trace resume/yield). |
| 2107 | #endif | 2107 | |.endif |
| 2108 | |->vm_exit_interp: | 2108 | |->vm_exit_interp: |
| 2109 | #if LJ_HASJIT | 2109 | |.if JIT |
| 2110 | | // CRET1 = MULTRES or negated error code, BASE, PC and JGL set. | 2110 | | // CRET1 = MULTRES or negated error code, BASE, PC and JGL set. |
| 2111 | | lw L, SAVE_L | 2111 | | lw L, SAVE_L |
| 2112 | | addiu DISPATCH, JGL, -GG_DISP2G-32768 | 2112 | | addiu DISPATCH, JGL, -GG_DISP2G-32768 |
| @@ -2148,7 +2148,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2148 | | negu CARG2, CRET1 | 2148 | | negu CARG2, CRET1 |
| 2149 | | call_intern lj_err_throw // (lua_State *L, int errcode) | 2149 | | call_intern lj_err_throw // (lua_State *L, int errcode) |
| 2150 | |. move CARG1, L | 2150 | |. move CARG1, L |
| 2151 | #endif | 2151 | |.endif |
| 2152 | | | 2152 | | |
| 2153 | |//----------------------------------------------------------------------- | 2153 | |//----------------------------------------------------------------------- |
| 2154 | |//-- Math helper functions ---------------------------------------------- | 2154 | |//-- Math helper functions ---------------------------------------------- |
| @@ -2202,9 +2202,9 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2202 | |->vm_ceil: | 2202 | |->vm_ceil: |
| 2203 | | vm_round ceil | 2203 | | vm_round ceil |
| 2204 | |->vm_trunc: | 2204 | |->vm_trunc: |
| 2205 | #if LJ_HASJIT | 2205 | |.if JIT |
| 2206 | | vm_round trunc | 2206 | | vm_round trunc |
| 2207 | #endif | 2207 | |.endif |
| 2208 | | | 2208 | | |
| 2209 | |//----------------------------------------------------------------------- | 2209 | |//----------------------------------------------------------------------- |
| 2210 | |//-- Miscellaneous functions -------------------------------------------- | 2210 | |//-- Miscellaneous functions -------------------------------------------- |
| @@ -2216,7 +2216,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2216 | | | 2216 | | |
| 2217 | |// Handler for callback functions. Callback slot number in r1, g in r2. | 2217 | |// Handler for callback functions. Callback slot number in r1, g in r2. |
| 2218 | |->vm_ffi_callback: | 2218 | |->vm_ffi_callback: |
| 2219 | #if LJ_HASFFI | 2219 | |.if FFI |
| 2220 | |.type CTSTATE, CTState, PC | 2220 | |.type CTSTATE, CTState, PC |
| 2221 | | saveregs | 2221 | | saveregs |
| 2222 | | lw CTSTATE, GL:r2->ctype_state | 2222 | | lw CTSTATE, GL:r2->ctype_state |
| @@ -2248,10 +2248,10 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2248 | | st_vmstate | 2248 | | st_vmstate |
| 2249 | | cvt.d.s TOBIT, TOBIT | 2249 | | cvt.d.s TOBIT, TOBIT |
| 2250 | | ins_callt | 2250 | | ins_callt |
| 2251 | #endif | 2251 | |.endif |
| 2252 | | | 2252 | | |
| 2253 | |->cont_ffi_callback: // Return from FFI callback. | 2253 | |->cont_ffi_callback: // Return from FFI callback. |
| 2254 | #if LJ_HASFFI | 2254 | |.if FFI |
| 2255 | | load_got lj_ccallback_leave | 2255 | | load_got lj_ccallback_leave |
| 2256 | | lw CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH) | 2256 | | lw CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH) |
| 2257 | | sw BASE, L->base | 2257 | | sw BASE, L->base |
| @@ -2265,11 +2265,11 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2265 | | lw CRET2, CTSTATE->cb.gpr[1] | 2265 | | lw CRET2, CTSTATE->cb.gpr[1] |
| 2266 | | b ->vm_leave_unw | 2266 | | b ->vm_leave_unw |
| 2267 | |. ldc1 FRET2, CTSTATE->cb.fpr[1] | 2267 | |. ldc1 FRET2, CTSTATE->cb.fpr[1] |
| 2268 | #endif | 2268 | |.endif |
| 2269 | | | 2269 | | |
| 2270 | |->vm_ffi_call: // Call C function via FFI. | 2270 | |->vm_ffi_call: // Call C function via FFI. |
| 2271 | | // Caveat: needs special frame unwinding, see below. | 2271 | | // Caveat: needs special frame unwinding, see below. |
| 2272 | #if LJ_HASFFI | 2272 | |.if FFI |
| 2273 | | .type CCSTATE, CCallState, CARG1 | 2273 | | .type CCSTATE, CCallState, CARG1 |
| 2274 | | lw TMP1, CCSTATE->spadj | 2274 | | lw TMP1, CCSTATE->spadj |
| 2275 | | lbu CARG2, CCSTATE->nsp | 2275 | | lbu CARG2, CCSTATE->nsp |
| @@ -2310,7 +2310,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2310 | | move sp, r16 | 2310 | | move sp, r16 |
| 2311 | | jr ra | 2311 | | jr ra |
| 2312 | |. move r16, TMP2 | 2312 | |. move r16, TMP2 |
| 2313 | #endif | 2313 | |.endif |
| 2314 | |// Note: vm_ffi_call must be the last function in this object file! | 2314 | |// Note: vm_ffi_call must be the last function in this object file! |
| 2315 | | | 2315 | | |
| 2316 | |//----------------------------------------------------------------------- | 2316 | |//----------------------------------------------------------------------- |
| @@ -2390,14 +2390,14 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2390 | |5: // Either or both types are not numbers. | 2390 | |5: // Either or both types are not numbers. |
| 2391 | | lw CARG2, LO(RA) | 2391 | | lw CARG2, LO(RA) |
| 2392 | | lw CARG3, LO(RD) | 2392 | | lw CARG3, LO(RD) |
| 2393 | if (LJ_HASFFI) { | 2393 | |.if FFI |
| 2394 | | li TMP3, LJ_TCDATA | 2394 | | li TMP3, LJ_TCDATA |
| 2395 | | beq TMP0, TMP3, ->vmeta_equal_cd | 2395 | | beq TMP0, TMP3, ->vmeta_equal_cd |
| 2396 | } | 2396 | |.endif |
| 2397 | |. sltiu AT, TMP0, LJ_TISPRI // Not a primitive? | 2397 | |. sltiu AT, TMP0, LJ_TISPRI // Not a primitive? |
| 2398 | if (LJ_HASFFI) { | 2398 | |.if FFI |
| 2399 | | beq TMP1, TMP3, ->vmeta_equal_cd | 2399 | | beq TMP1, TMP3, ->vmeta_equal_cd |
| 2400 | } | 2400 | |.endif |
| 2401 | |. xor TMP3, CARG2, CARG3 // Same tv? | 2401 | |. xor TMP3, CARG2, CARG3 // Same tv? |
| 2402 | | xor TMP1, TMP1, TMP0 // Same type? | 2402 | | xor TMP1, TMP1, TMP0 // Same type? |
| 2403 | | sltiu CARG1, TMP0, LJ_TISTABUD+1 // Table or userdata? | 2403 | | sltiu CARG1, TMP0, LJ_TISTABUD+1 // Table or userdata? |
| @@ -2434,10 +2434,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2434 | | lw STR:TMP3, LO(RA) | 2434 | | lw STR:TMP3, LO(RA) |
| 2435 | | subu RD, KBASE, RD | 2435 | | subu RD, KBASE, RD |
| 2436 | | lhu TMP2, -4+OFS_RD(PC) | 2436 | | lhu TMP2, -4+OFS_RD(PC) |
| 2437 | if (LJ_HASFFI) { | 2437 | |.if FFI |
| 2438 | | li AT, LJ_TCDATA | 2438 | | li AT, LJ_TCDATA |
| 2439 | | beq TMP0, AT, ->vmeta_equal_cd | 2439 | | beq TMP0, AT, ->vmeta_equal_cd |
| 2440 | } | 2440 | |.endif |
| 2441 | |. lw STR:TMP1, -4(RD) // KBASE-4-str_const*4 | 2441 | |. lw STR:TMP1, -4(RD) // KBASE-4-str_const*4 |
| 2442 | | addiu TMP0, TMP0, -LJ_TSTR | 2442 | | addiu TMP0, TMP0, -LJ_TSTR |
| 2443 | | decode_RD4b TMP2 | 2443 | | decode_RD4b TMP2 |
| @@ -2467,11 +2467,11 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2467 | | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | 2467 | | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) |
| 2468 | | sltiu AT, TMP0, LJ_TISNUM | 2468 | | sltiu AT, TMP0, LJ_TISNUM |
| 2469 | | decode_RD4b TMP2 | 2469 | | decode_RD4b TMP2 |
| 2470 | if (LJ_HASFFI) { | 2470 | |.if FFI |
| 2471 | | beqz AT, >5 | 2471 | | beqz AT, >5 |
| 2472 | } else { | 2472 | |.else |
| 2473 | | beqz AT, >1 | 2473 | | beqz AT, >1 |
| 2474 | } | 2474 | |.endif |
| 2475 | |. addu TMP2, TMP2, TMP3 | 2475 | |. addu TMP2, TMP2, TMP3 |
| 2476 | | c.eq.d f0, f2 | 2476 | | c.eq.d f0, f2 |
| 2477 | if (vk) { | 2477 | if (vk) { |
| @@ -2484,14 +2484,14 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2484 | | addu PC, PC, TMP2 | 2484 | | addu PC, PC, TMP2 |
| 2485 | } | 2485 | } |
| 2486 | | ins_next | 2486 | | ins_next |
| 2487 | if (LJ_HASFFI) { | 2487 | |.if FFI |
| 2488 | |5: | 2488 | |5: |
| 2489 | | li AT, LJ_TCDATA | 2489 | | li AT, LJ_TCDATA |
| 2490 | | beq TMP0, AT, ->vmeta_equal_cd | 2490 | | beq TMP0, AT, ->vmeta_equal_cd |
| 2491 | |. nop | 2491 | |. nop |
| 2492 | | b <1 | 2492 | | b <1 |
| 2493 | |. nop | 2493 | |. nop |
| 2494 | } | 2494 | |.endif |
| 2495 | break; | 2495 | break; |
| 2496 | 2496 | ||
| 2497 | case BC_ISEQP: case BC_ISNEP: | 2497 | case BC_ISEQP: case BC_ISNEP: |
| @@ -2503,10 +2503,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2503 | | lhu TMP2, OFS_RD(PC) | 2503 | | lhu TMP2, OFS_RD(PC) |
| 2504 | | not TMP1, TMP1 | 2504 | | not TMP1, TMP1 |
| 2505 | | addiu PC, PC, 4 | 2505 | | addiu PC, PC, 4 |
| 2506 | if (LJ_HASFFI) { | 2506 | |.if FFI |
| 2507 | | li AT, LJ_TCDATA | 2507 | | li AT, LJ_TCDATA |
| 2508 | | beq TMP0, AT, ->vmeta_equal_cd | 2508 | | beq TMP0, AT, ->vmeta_equal_cd |
| 2509 | } | 2509 | |.endif |
| 2510 | |. xor TMP0, TMP0, TMP1 | 2510 | |. xor TMP0, TMP0, TMP1 |
| 2511 | | decode_RD4b TMP2 | 2511 | | decode_RD4b TMP2 |
| 2512 | | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) | 2512 | | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535) |
| @@ -2781,7 +2781,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2781 | | ins_next2 | 2781 | | ins_next2 |
| 2782 | break; | 2782 | break; |
| 2783 | case BC_KCDATA: | 2783 | case BC_KCDATA: |
| 2784 | #if LJ_HASFFI | 2784 | |.if FFI |
| 2785 | | // RA = dst*8, RD = cdata_const*8 (~) | 2785 | | // RA = dst*8, RD = cdata_const*8 (~) |
| 2786 | | srl TMP1, RD, 1 | 2786 | | srl TMP1, RD, 1 |
| 2787 | | subu TMP1, KBASE, TMP1 | 2787 | | subu TMP1, KBASE, TMP1 |
| @@ -2792,7 +2792,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 2792 | | sw TMP0, LO(RA) | 2792 | | sw TMP0, LO(RA) |
| 2793 | | sw TMP2, HI(RA) | 2793 | | sw TMP2, HI(RA) |
| 2794 | | ins_next2 | 2794 | | ins_next2 |
| 2795 | #endif | 2795 | |.endif |
| 2796 | break; | 2796 | break; |
| 2797 | case BC_KSHORT: | 2797 | case BC_KSHORT: |
| 2798 | | // RA = dst*8, RD = int16_literal*8 | 2798 | | // RA = dst*8, RD = int16_literal*8 |
| @@ -3538,9 +3538,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3538 | 3538 | ||
| 3539 | case BC_ITERN: | 3539 | case BC_ITERN: |
| 3540 | | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) | 3540 | | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8) |
| 3541 | #if LJ_HASJIT | 3541 | |.if JIT |
| 3542 | | // NYI: add hotloop, record BC_ITERN. | 3542 | | // NYI: add hotloop, record BC_ITERN. |
| 3543 | #endif | 3543 | |.endif |
| 3544 | | addu RA, BASE, RA | 3544 | | addu RA, BASE, RA |
| 3545 | | lw TAB:RB, -16+LO(RA) | 3545 | | lw TAB:RB, -16+LO(RA) |
| 3546 | | lw RC, -8+LO(RA) // Get index from control var. | 3546 | | lw RC, -8+LO(RA) // Get index from control var. |
| @@ -3803,9 +3803,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3803 | /* -- Loops and branches ------------------------------------------------ */ | 3803 | /* -- Loops and branches ------------------------------------------------ */ |
| 3804 | 3804 | ||
| 3805 | case BC_FORL: | 3805 | case BC_FORL: |
| 3806 | #if LJ_HASJIT | 3806 | |.if JIT |
| 3807 | | hotloop | 3807 | | hotloop |
| 3808 | #endif | 3808 | |.endif |
| 3809 | | // Fall through. Assumes BC_IFORL follows. | 3809 | | // Fall through. Assumes BC_IFORL follows. |
| 3810 | break; | 3810 | break; |
| 3811 | 3811 | ||
| @@ -3885,9 +3885,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3885 | break; | 3885 | break; |
| 3886 | 3886 | ||
| 3887 | case BC_ITERL: | 3887 | case BC_ITERL: |
| 3888 | #if LJ_HASJIT | 3888 | |.if JIT |
| 3889 | | hotloop | 3889 | | hotloop |
| 3890 | #endif | 3890 | |.endif |
| 3891 | | // Fall through. Assumes BC_IITERL follows. | 3891 | | // Fall through. Assumes BC_IITERL follows. |
| 3892 | break; | 3892 | break; |
| 3893 | 3893 | ||
| @@ -3918,9 +3918,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3918 | | // RA = base*8, RD = target (loop extent) | 3918 | | // RA = base*8, RD = target (loop extent) |
| 3919 | | // Note: RA/RD is only used by trace recorder to determine scope/extent | 3919 | | // Note: RA/RD is only used by trace recorder to determine scope/extent |
| 3920 | | // This opcode does NOT jump, it's only purpose is to detect a hot loop. | 3920 | | // This opcode does NOT jump, it's only purpose is to detect a hot loop. |
| 3921 | #if LJ_HASJIT | 3921 | |.if JIT |
| 3922 | | hotloop | 3922 | | hotloop |
| 3923 | #endif | 3923 | |.endif |
| 3924 | | // Fall through. Assumes BC_ILOOP follows. | 3924 | | // Fall through. Assumes BC_ILOOP follows. |
| 3925 | break; | 3925 | break; |
| 3926 | 3926 | ||
| @@ -3930,7 +3930,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3930 | break; | 3930 | break; |
| 3931 | 3931 | ||
| 3932 | case BC_JLOOP: | 3932 | case BC_JLOOP: |
| 3933 | #if LJ_HASJIT | 3933 | |.if JIT |
| 3934 | | // RA = base*8 (ignored), RD = traceno*8 | 3934 | | // RA = base*8 (ignored), RD = traceno*8 |
| 3935 | | lw TMP1, DISPATCH_J(trace)(DISPATCH) | 3935 | | lw TMP1, DISPATCH_J(trace)(DISPATCH) |
| 3936 | | srl RD, RD, 1 | 3936 | | srl RD, RD, 1 |
| @@ -3944,7 +3944,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3944 | | lw TMP2, TRACE:TMP2->mcode | 3944 | | lw TMP2, TRACE:TMP2->mcode |
| 3945 | | jr TMP2 | 3945 | | jr TMP2 |
| 3946 | |. addiu JGL, DISPATCH, GG_DISP2G+32768 | 3946 | |. addiu JGL, DISPATCH, GG_DISP2G+32768 |
| 3947 | #endif | 3947 | |.endif |
| 3948 | break; | 3948 | break; |
| 3949 | 3949 | ||
| 3950 | case BC_JMP: | 3950 | case BC_JMP: |
| @@ -3956,9 +3956,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop) | |||
| 3956 | /* -- Function headers -------------------------------------------------- */ | 3956 | /* -- Function headers -------------------------------------------------- */ |
| 3957 | 3957 | ||
| 3958 | case BC_FUNCF: | 3958 | case BC_FUNCF: |
| 3959 | #if LJ_HASJIT | 3959 | |.if JIT |
| 3960 | | hotcall | 3960 | | hotcall |
| 3961 | #endif | 3961 | |.endif |
| 3962 | case BC_FUNCV: /* NYI: compiled vararg functions. */ | 3962 | case BC_FUNCV: /* NYI: compiled vararg functions. */ |
| 3963 | | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow. | 3963 | | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow. |
| 3964 | break; | 3964 | break; |
