aboutsummaryrefslogtreecommitdiff
path: root/src/vm_mips.dasc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/vm_mips.dasc27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/vm_mips.dasc b/src/vm_mips.dasc
index 34645bf1..bfdcfc1e 100644
--- a/src/vm_mips.dasc
+++ b/src/vm_mips.dasc
@@ -2466,7 +2466,8 @@ static void build_subroutines(BuildCtx *ctx)
2466 | addiu DISPATCH, JGL, -GG_DISP2G-32768 2466 | addiu DISPATCH, JGL, -GG_DISP2G-32768
2467 | sw BASE, L->base 2467 | sw BASE, L->base
2468 |1: 2468 |1:
2469 | bltz CRET1, >9 // Check for error from exit. 2469 | sltiu TMP0, CRET1, -LUA_ERRERR // Check for error from exit.
2470 | beqz TMP0, >9
2470 |. lw LFUNC:RB, FRAME_FUNC(BASE) 2471 |. lw LFUNC:RB, FRAME_FUNC(BASE)
2471 | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float). 2472 | .FPU lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
2472 | sll MULTRES, CRET1, 3 2473 | sll MULTRES, CRET1, 3
@@ -2480,14 +2481,16 @@ static void build_subroutines(BuildCtx *ctx)
2480 | .FPU cvt.d.s TOBIT, TOBIT 2481 | .FPU cvt.d.s TOBIT, TOBIT
2481 | // Modified copy of ins_next which handles function header dispatch, too. 2482 | // Modified copy of ins_next which handles function header dispatch, too.
2482 | lw INS, 0(PC) 2483 | lw INS, 0(PC)
2483 | addiu PC, PC, 4 2484 | addiu CRET1, CRET1, 17 // Static dispatch?
2484 | // Assumes TISNIL == ~LJ_VMST_INTERP == -1 2485 | // Assumes TISNIL == ~LJ_VMST_INTERP == -1
2485 | sw TISNIL, DISPATCH_GL(vmstate)(DISPATCH) 2486 | sw TISNIL, DISPATCH_GL(vmstate)(DISPATCH)
2487 | decode_RD8a RD, INS
2488 | beqz CRET1, >5
2489 |. addiu PC, PC, 4
2486 | decode_OP4a TMP1, INS 2490 | decode_OP4a TMP1, INS
2487 | decode_OP4b TMP1 2491 | decode_OP4b TMP1
2488 | sltiu TMP2, TMP1, BC_FUNCF*4
2489 | addu TMP0, DISPATCH, TMP1 2492 | addu TMP0, DISPATCH, TMP1
2490 | decode_RD8a RD, INS 2493 | sltiu TMP2, TMP1, BC_FUNCF*4
2491 | lw AT, 0(TMP0) 2494 | lw AT, 0(TMP0)
2492 | decode_RA8a RA, INS 2495 | decode_RA8a RA, INS
2493 | beqz TMP2, >2 2496 | beqz TMP2, >2
@@ -2515,6 +2518,22 @@ static void build_subroutines(BuildCtx *ctx)
2515 | jr AT 2518 | jr AT
2516 |. addu RA, RA, BASE 2519 |. addu RA, RA, BASE
2517 | 2520 |
2521 |5: // Dispatch to static entry of original ins replaced by BC_JLOOP.
2522 | lw TMP0, DISPATCH_J(trace)(DISPATCH)
2523 | decode_RD4b RD
2524 | addu TMP0, TMP0, RD
2525 | lw TRACE:TMP2, 0(TMP0)
2526 | lw INS, TRACE:TMP2->startins
2527 | decode_OP4a TMP1, INS
2528 | decode_OP4b TMP1
2529 | addu TMP0, DISPATCH, TMP1
2530 | decode_RD8a RD, INS
2531 | lw AT, GG_DISP2STATIC(TMP0)
2532 | decode_RA8a RA, INS
2533 | decode_RD8b RD
2534 | jr AT
2535 |. decode_RA8b RA
2536 |
2518 |9: // Rethrow error from the right C frame. 2537 |9: // Rethrow error from the right C frame.
2519 | load_got lj_err_trace 2538 | load_got lj_err_trace
2520 | sub CARG2, r0, CRET1 2539 | sub CARG2, r0, CRET1