diff options
| author | Mike Pall <mike> | 2013-08-26 18:28:58 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2013-08-26 18:28:58 +0200 |
| commit | 5120240b77e4544b9b7405b4849a6cc63cdbbe1e (patch) | |
| tree | 40bb90b12d912924bc9abf1feb12347b8db6b520 | |
| parent | b33e96f3522e96e816cc46470b19d121bf88cfc8 (diff) | |
| download | luajit-5120240b77e4544b9b7405b4849a6cc63cdbbe1e.tar.gz luajit-5120240b77e4544b9b7405b4849a6cc63cdbbe1e.tar.bz2 luajit-5120240b77e4544b9b7405b4849a6cc63cdbbe1e.zip | |
Use g->jit_base for on/off-trace detection.
| -rw-r--r-- | src/lj_ccallback.c | 2 | ||||
| -rw-r--r-- | src/lj_err.c | 2 | ||||
| -rw-r--r-- | src/lj_gc.c | 8 | ||||
| -rw-r--r-- | src/lj_obj.h | 4 | ||||
| -rw-r--r-- | src/lj_state.c | 9 | ||||
| -rw-r--r-- | src/vm_arm.dasc | 7 | ||||
| -rw-r--r-- | src/vm_mips.dasc | 10 | ||||
| -rw-r--r-- | src/vm_ppc.dasc | 7 | ||||
| -rw-r--r-- | src/vm_x86.dasc | 6 |
9 files changed, 31 insertions, 24 deletions
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c index c975c88f..37f45bf5 100644 --- a/src/lj_ccallback.c +++ b/src/lj_ccallback.c | |||
| @@ -529,7 +529,7 @@ lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf) | |||
| 529 | lua_State *L = cts->L; | 529 | lua_State *L = cts->L; |
| 530 | global_State *g = cts->g; | 530 | global_State *g = cts->g; |
| 531 | lua_assert(L != NULL); | 531 | lua_assert(L != NULL); |
| 532 | if (gcref(g->jit_L)) { | 532 | if (tvref(g->jit_base)) { |
| 533 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK)); | 533 | setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK)); |
| 534 | if (g->panic) g->panic(L); | 534 | if (g->panic) g->panic(L); |
| 535 | exit(EXIT_FAILURE); | 535 | exit(EXIT_FAILURE); |
diff --git a/src/lj_err.c b/src/lj_err.c index 7ae87a82..3b44c984 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
| @@ -453,7 +453,7 @@ LJ_NOINLINE void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode) | |||
| 453 | { | 453 | { |
| 454 | global_State *g = G(L); | 454 | global_State *g = G(L); |
| 455 | lj_trace_abort(g); | 455 | lj_trace_abort(g); |
| 456 | setgcrefnull(g->jit_L); | 456 | setmref(g->jit_base, NULL); |
| 457 | L->status = 0; | 457 | L->status = 0; |
| 458 | #if LJ_UNWIND_EXT | 458 | #if LJ_UNWIND_EXT |
| 459 | err_raise_ext(errcode); | 459 | err_raise_ext(errcode); |
diff --git a/src/lj_gc.c b/src/lj_gc.c index c9eaf21a..8dbf2090 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c | |||
| @@ -475,7 +475,7 @@ static void gc_finalize(lua_State *L) | |||
| 475 | global_State *g = G(L); | 475 | global_State *g = G(L); |
| 476 | GCobj *o = gcnext(gcref(g->gc.mmudata)); | 476 | GCobj *o = gcnext(gcref(g->gc.mmudata)); |
| 477 | cTValue *mo; | 477 | cTValue *mo; |
| 478 | lua_assert(gcref(g->jit_L) == NULL); /* Must not be called on trace. */ | 478 | lua_assert(tvref(g->jit_base) == NULL); /* Must not be called on trace. */ |
| 479 | /* Unchain from list of userdata to be finalized. */ | 479 | /* Unchain from list of userdata to be finalized. */ |
| 480 | if (o == gcref(g->gc.mmudata)) | 480 | if (o == gcref(g->gc.mmudata)) |
| 481 | setgcrefnull(g->gc.mmudata); | 481 | setgcrefnull(g->gc.mmudata); |
| @@ -606,7 +606,7 @@ static size_t gc_onestep(lua_State *L) | |||
| 606 | g->gc.state = GCSatomic; /* End of mark phase. */ | 606 | g->gc.state = GCSatomic; /* End of mark phase. */ |
| 607 | return 0; | 607 | return 0; |
| 608 | case GCSatomic: | 608 | case GCSatomic: |
| 609 | if (gcref(g->jit_L)) /* Don't run atomic phase on trace. */ | 609 | if (tvref(g->jit_base)) /* Don't run atomic phase on trace. */ |
| 610 | return LJ_MAX_MEM; | 610 | return LJ_MAX_MEM; |
| 611 | atomic(g, L); | 611 | atomic(g, L); |
| 612 | g->gc.state = GCSsweepstring; /* Start of sweep phase. */ | 612 | g->gc.state = GCSsweepstring; /* Start of sweep phase. */ |
| @@ -640,7 +640,7 @@ static size_t gc_onestep(lua_State *L) | |||
| 640 | } | 640 | } |
| 641 | case GCSfinalize: | 641 | case GCSfinalize: |
| 642 | if (gcref(g->gc.mmudata) != NULL) { | 642 | if (gcref(g->gc.mmudata) != NULL) { |
| 643 | if (gcref(g->jit_L)) /* Don't call finalizers on trace. */ | 643 | if (tvref(g->jit_base)) /* Don't call finalizers on trace. */ |
| 644 | return LJ_MAX_MEM; | 644 | return LJ_MAX_MEM; |
| 645 | gc_finalize(L); /* Finalize one userdata object. */ | 645 | gc_finalize(L); /* Finalize one userdata object. */ |
| 646 | if (g->gc.estimate > GCFINALIZECOST) | 646 | if (g->gc.estimate > GCFINALIZECOST) |
| @@ -697,7 +697,7 @@ void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L) | |||
| 697 | int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps) | 697 | int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps) |
| 698 | { | 698 | { |
| 699 | lua_State *L = gco2th(gcref(g->jit_L)); | 699 | lua_State *L = gco2th(gcref(g->jit_L)); |
| 700 | L->base = mref(G(L)->jit_base, TValue); | 700 | L->base = tvref(G(L)->jit_base); |
| 701 | L->top = curr_topL(L); | 701 | L->top = curr_topL(L); |
| 702 | while (steps-- > 0 && lj_gc_step(L) == 0) | 702 | while (steps-- > 0 && lj_gc_step(L) == 0) |
| 703 | ; | 703 | ; |
diff --git a/src/lj_obj.h b/src/lj_obj.h index 5a05f38d..e97acef0 100644 --- a/src/lj_obj.h +++ b/src/lj_obj.h | |||
| @@ -536,8 +536,8 @@ typedef struct global_State { | |||
| 536 | lua_CFunction panic; /* Called as a last resort for errors. */ | 536 | lua_CFunction panic; /* Called as a last resort for errors. */ |
| 537 | BCIns bc_cfunc_int; /* Bytecode for internal C function calls. */ | 537 | BCIns bc_cfunc_int; /* Bytecode for internal C function calls. */ |
| 538 | BCIns bc_cfunc_ext; /* Bytecode for external C function calls. */ | 538 | BCIns bc_cfunc_ext; /* Bytecode for external C function calls. */ |
| 539 | GCRef jit_L; /* Current JIT code lua_State or NULL. */ | 539 | GCRef jit_L; /* Current JIT code lua_State. */ |
| 540 | MRef jit_base; /* Current JIT code L->base. */ | 540 | MRef jit_base; /* Current JIT code L->base or NULL. */ |
| 541 | MRef ctype_state; /* Pointer to C type state. */ | 541 | MRef ctype_state; /* Pointer to C type state. */ |
| 542 | GCRef gcroot[GCROOT_MAX]; /* GC roots. */ | 542 | GCRef gcroot[GCROOT_MAX]; /* GC roots. */ |
| 543 | } global_State; | 543 | } global_State; |
diff --git a/src/lj_state.c b/src/lj_state.c index 604ff886..486e66e3 100644 --- a/src/lj_state.c +++ b/src/lj_state.c | |||
| @@ -60,7 +60,7 @@ static void resizestack(lua_State *L, MSize n) | |||
| 60 | GCobj *up; | 60 | GCobj *up; |
| 61 | lua_assert((MSize)(tvref(L->maxstack)-oldst)==L->stacksize-LJ_STACK_EXTRA-1); | 61 | lua_assert((MSize)(tvref(L->maxstack)-oldst)==L->stacksize-LJ_STACK_EXTRA-1); |
| 62 | st = (TValue *)lj_mem_realloc(L, tvref(L->stack), | 62 | st = (TValue *)lj_mem_realloc(L, tvref(L->stack), |
| 63 | (MSize)(L->stacksize*sizeof(TValue)), | 63 | (MSize)(oldsize*sizeof(TValue)), |
| 64 | (MSize)(realsize*sizeof(TValue))); | 64 | (MSize)(realsize*sizeof(TValue))); |
| 65 | setmref(L->stack, st); | 65 | setmref(L->stack, st); |
| 66 | delta = (char *)st - (char *)oldst; | 66 | delta = (char *)st - (char *)oldst; |
| @@ -68,12 +68,12 @@ static void resizestack(lua_State *L, MSize n) | |||
| 68 | while (oldsize < realsize) /* Clear new slots. */ | 68 | while (oldsize < realsize) /* Clear new slots. */ |
| 69 | setnilV(st + oldsize++); | 69 | setnilV(st + oldsize++); |
| 70 | L->stacksize = realsize; | 70 | L->stacksize = realsize; |
| 71 | if ((size_t)(mref(G(L)->jit_base, char) - (char *)oldst) < oldsize) | ||
| 72 | setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta); | ||
| 71 | L->base = (TValue *)((char *)L->base + delta); | 73 | L->base = (TValue *)((char *)L->base + delta); |
| 72 | L->top = (TValue *)((char *)L->top + delta); | 74 | L->top = (TValue *)((char *)L->top + delta); |
| 73 | for (up = gcref(L->openupval); up != NULL; up = gcnext(up)) | 75 | for (up = gcref(L->openupval); up != NULL; up = gcnext(up)) |
| 74 | setmref(gco2uv(up)->v, (TValue *)((char *)uvval(gco2uv(up)) + delta)); | 76 | setmref(gco2uv(up)->v, (TValue *)((char *)uvval(gco2uv(up)) + delta)); |
| 75 | if (obj2gco(L) == gcref(G(L)->jit_L)) | ||
| 76 | setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta); | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | /* Relimit stack after error, in case the limit was overdrawn. */ | 79 | /* Relimit stack after error, in case the limit was overdrawn. */ |
| @@ -90,7 +90,8 @@ void lj_state_shrinkstack(lua_State *L, MSize used) | |||
| 90 | return; /* Avoid stack shrinking while handling stack overflow. */ | 90 | return; /* Avoid stack shrinking while handling stack overflow. */ |
| 91 | if (4*used < L->stacksize && | 91 | if (4*used < L->stacksize && |
| 92 | 2*(LJ_STACK_START+LJ_STACK_EXTRA) < L->stacksize && | 92 | 2*(LJ_STACK_START+LJ_STACK_EXTRA) < L->stacksize && |
| 93 | obj2gco(L) != gcref(G(L)->jit_L)) /* Don't shrink stack of live trace. */ | 93 | /* Don't shrink stack of live trace. */ |
| 94 | (tvref(G(L)->jit_base) == NULL || obj2gco(L) != gcref(G(L)->jit_L))) | ||
| 94 | resizestack(L, L->stacksize >> 1); | 95 | resizestack(L, L->stacksize >> 1); |
| 95 | } | 96 | } |
| 96 | 97 | ||
diff --git a/src/vm_arm.dasc b/src/vm_arm.dasc index 83341e41..b235967f 100644 --- a/src/vm_arm.dasc +++ b/src/vm_arm.dasc | |||
| @@ -2107,9 +2107,9 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2107 | | ldr BASE, [DISPATCH, #DISPATCH_GL(jit_base)] | 2107 | | ldr BASE, [DISPATCH, #DISPATCH_GL(jit_base)] |
| 2108 | | str CARG1, [DISPATCH, #DISPATCH_J(exitno)] | 2108 | | str CARG1, [DISPATCH, #DISPATCH_J(exitno)] |
| 2109 | | mov CARG4, #0 | 2109 | | mov CARG4, #0 |
| 2110 | | str L, [DISPATCH, #DISPATCH_J(L)] | ||
| 2111 | | str BASE, L->base | 2110 | | str BASE, L->base |
| 2112 | | str CARG4, [DISPATCH, #DISPATCH_GL(jit_L)] | 2111 | | str L, [DISPATCH, #DISPATCH_J(L)] |
| 2112 | | str CARG4, [DISPATCH, #DISPATCH_GL(jit_base)] | ||
| 2113 | | sub CARG1, DISPATCH, #-GG_DISP2J | 2113 | | sub CARG1, DISPATCH, #-GG_DISP2J |
| 2114 | | mov CARG2, sp | 2114 | | mov CARG2, sp |
| 2115 | | bl extern lj_trace_exit // (jit_State *J, ExitState *ex) | 2115 | | bl extern lj_trace_exit // (jit_State *J, ExitState *ex) |
| @@ -2133,8 +2133,9 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2133 | | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] | 2133 | | ldr LFUNC:CARG2, [BASE, FRAME_FUNC] |
| 2134 | | str RC, SAVE_MULTRES | 2134 | | str RC, SAVE_MULTRES |
| 2135 | | mov CARG3, #0 | 2135 | | mov CARG3, #0 |
| 2136 | | str BASE, L->base | ||
| 2136 | | ldr CARG2, LFUNC:CARG2->field_pc | 2137 | | ldr CARG2, LFUNC:CARG2->field_pc |
| 2137 | | str CARG3, [DISPATCH, #DISPATCH_GL(jit_L)] | 2138 | | str CARG3, [DISPATCH, #DISPATCH_GL(jit_base)] |
| 2138 | | mv_vmstate CARG4, INTERP | 2139 | | mv_vmstate CARG4, INTERP |
| 2139 | | ldr KBASE, [CARG2, #PC2PROTO(k)] | 2140 | | ldr KBASE, [CARG2, #PC2PROTO(k)] |
| 2140 | | // Modified copy of ins_next which handles function header dispatch, too. | 2141 | | // Modified copy of ins_next which handles function header dispatch, too. |
diff --git a/src/vm_mips.dasc b/src/vm_mips.dasc index 41ed303d..aad4fccf 100644 --- a/src/vm_mips.dasc +++ b/src/vm_mips.dasc | |||
| @@ -2046,13 +2046,14 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2046 | | st_vmstate | 2046 | | st_vmstate |
| 2047 | | sw TMP2, 16+32*8+29*4(sp) // Store sp in RID_SP. | 2047 | | sw TMP2, 16+32*8+29*4(sp) // Store sp in RID_SP. |
| 2048 | | lw L, DISPATCH_GL(jit_L)(DISPATCH) | 2048 | | lw L, DISPATCH_GL(jit_L)(DISPATCH) |
| 2049 | | lw BASE, DISPATCH_GL(jit_base)(DISPATCH) | 2049 | | lw BASE, DISPATCH_GL(jit_base)(DISPATCH) |
| 2050 | | load_got lj_trace_exit | 2050 | | load_got lj_trace_exit |
| 2051 | | sw L, DISPATCH_J(L)(DISPATCH) | 2051 | | sw L, DISPATCH_J(L)(DISPATCH) |
| 2052 | | sw ra, DISPATCH_J(parent)(DISPATCH) // Store trace number. | 2052 | | sw ra, DISPATCH_J(parent)(DISPATCH) // Store trace number. |
| 2053 | | sw BASE, L->base | ||
| 2053 | | sw TMP1, DISPATCH_J(exitno)(DISPATCH) // Store exit number. | 2054 | | sw TMP1, DISPATCH_J(exitno)(DISPATCH) // Store exit number. |
| 2054 | | addiu CARG1, DISPATCH, GG_DISP2J | 2055 | | addiu CARG1, DISPATCH, GG_DISP2J |
| 2055 | | sw BASE, L->base | 2056 | | sw r0, DISPATCH_GL(jit_base)(DISPATCH) |
| 2056 | | call_intern lj_trace_exit // (jit_State *J, ExitState *ex) | 2057 | | call_intern lj_trace_exit // (jit_State *J, ExitState *ex) |
| 2057 | |. addiu CARG2, sp, 16 | 2058 | |. addiu CARG2, sp, 16 |
| 2058 | | // Returns MULTRES (unscaled) or negated error code. | 2059 | | // Returns MULTRES (unscaled) or negated error code. |
| @@ -2068,7 +2069,8 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2068 | |.if JIT | 2069 | |.if JIT |
| 2069 | | // CRET1 = MULTRES or negated error code, BASE, PC and JGL set. | 2070 | | // CRET1 = MULTRES or negated error code, BASE, PC and JGL set. |
| 2070 | | lw L, SAVE_L | 2071 | | lw L, SAVE_L |
| 2071 | | addiu DISPATCH, JGL, -GG_DISP2G-32768 | 2072 | | addiu DISPATCH, JGL, -GG_DISP2G-32768 |
| 2073 | | sw BASE, L->base | ||
| 2072 | |1: | 2074 | |1: |
| 2073 | | bltz CRET1, >3 // Check for error from exit. | 2075 | | bltz CRET1, >3 // Check for error from exit. |
| 2074 | |. lw LFUNC:TMP1, FRAME_FUNC(BASE) | 2076 | |. lw LFUNC:TMP1, FRAME_FUNC(BASE) |
| @@ -2078,7 +2080,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2078 | | sw MULTRES, SAVE_MULTRES | 2080 | | sw MULTRES, SAVE_MULTRES |
| 2079 | | mtc1 TMP3, TOBIT | 2081 | | mtc1 TMP3, TOBIT |
| 2080 | | lw TMP1, LFUNC:TMP1->pc | 2082 | | lw TMP1, LFUNC:TMP1->pc |
| 2081 | | sw r0, DISPATCH_GL(jit_L)(DISPATCH) | 2083 | | sw r0, DISPATCH_GL(jit_base)(DISPATCH) |
| 2082 | | lw KBASE, PC2PROTO(k)(TMP1) | 2084 | | lw KBASE, PC2PROTO(k)(TMP1) |
| 2083 | | cvt.d.s TOBIT, TOBIT | 2085 | | cvt.d.s TOBIT, TOBIT |
| 2084 | | // Modified copy of ins_next which handles function header dispatch, too. | 2086 | | // Modified copy of ins_next which handles function header dispatch, too. |
diff --git a/src/vm_ppc.dasc b/src/vm_ppc.dasc index a7707ccc..d009d005 100644 --- a/src/vm_ppc.dasc +++ b/src/vm_ppc.dasc | |||
| @@ -2542,9 +2542,9 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2542 | | srwi CARG3, CARG3, 2 | 2542 | | srwi CARG3, CARG3, 2 |
| 2543 | | stw L, DISPATCH_J(L)(DISPATCH) | 2543 | | stw L, DISPATCH_J(L)(DISPATCH) |
| 2544 | | subi CARG3, CARG3, 2 | 2544 | | subi CARG3, CARG3, 2 |
| 2545 | | stw TMP1, DISPATCH_GL(jit_L)(DISPATCH) | ||
| 2546 | | stw CARG4, DISPATCH_J(parent)(DISPATCH) | ||
| 2547 | | stp BASE, L->base | 2545 | | stp BASE, L->base |
| 2546 | | stw CARG4, DISPATCH_J(parent)(DISPATCH) | ||
| 2547 | | stw TMP1, DISPATCH_GL(jit_base)(DISPATCH) | ||
| 2548 | | addi CARG1, DISPATCH, GG_DISP2J | 2548 | | addi CARG1, DISPATCH, GG_DISP2J |
| 2549 | | stw CARG3, DISPATCH_J(exitno)(DISPATCH) | 2549 | | stw CARG3, DISPATCH_J(exitno)(DISPATCH) |
| 2550 | | addi CARG2, sp, 16 | 2550 | | addi CARG2, sp, 16 |
| @@ -2568,6 +2568,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2568 | | // CARG1 = MULTRES or negated error code, BASE, PC and JGL set. | 2568 | | // CARG1 = MULTRES or negated error code, BASE, PC and JGL set. |
| 2569 | | lwz L, SAVE_L | 2569 | | lwz L, SAVE_L |
| 2570 | | addi DISPATCH, JGL, -GG_DISP2G-32768 | 2570 | | addi DISPATCH, JGL, -GG_DISP2G-32768 |
| 2571 | | stp BASE, L->base | ||
| 2571 | |1: | 2572 | |1: |
| 2572 | | cmpwi CARG1, 0 | 2573 | | cmpwi CARG1, 0 |
| 2573 | | blt >3 // Check for error from exit. | 2574 | | blt >3 // Check for error from exit. |
| @@ -2576,7 +2577,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2576 | | li TMP2, 0 | 2577 | | li TMP2, 0 |
| 2577 | | stw MULTRES, SAVE_MULTRES | 2578 | | stw MULTRES, SAVE_MULTRES |
| 2578 | | lwz TMP1, LFUNC:TMP1->pc | 2579 | | lwz TMP1, LFUNC:TMP1->pc |
| 2579 | | stw TMP2, DISPATCH_GL(jit_L)(DISPATCH) | 2580 | | stw TMP2, DISPATCH_GL(jit_base)(DISPATCH) |
| 2580 | | lwz KBASE, PC2PROTO(k)(TMP1) | 2581 | | lwz KBASE, PC2PROTO(k)(TMP1) |
| 2581 | | // Setup type comparison constants. | 2582 | | // Setup type comparison constants. |
| 2582 | | li TISNUM, LJ_TISNUM | 2583 | | li TISNUM, LJ_TISNUM |
diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index 62a5e139..b8f1c449 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc | |||
| @@ -2708,7 +2708,6 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2708 | | mov L:RB, [DISPATCH+DISPATCH_GL(jit_L)] | 2708 | | mov L:RB, [DISPATCH+DISPATCH_GL(jit_L)] |
| 2709 | | mov BASE, [DISPATCH+DISPATCH_GL(jit_base)] | 2709 | | mov BASE, [DISPATCH+DISPATCH_GL(jit_base)] |
| 2710 | | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa | 2710 | | mov aword [DISPATCH+DISPATCH_J(L)], L:RBa |
| 2711 | | mov dword [DISPATCH+DISPATCH_GL(jit_L)], 0 | ||
| 2712 | | mov L:RB->base, BASE | 2711 | | mov L:RB->base, BASE |
| 2713 | |.if X64WIN | 2712 | |.if X64WIN |
| 2714 | | lea CARG2, [rsp+4*8] | 2713 | | lea CARG2, [rsp+4*8] |
| @@ -2718,6 +2717,7 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2718 | | lea FCARG2, [esp+16] | 2717 | | lea FCARG2, [esp+16] |
| 2719 | |.endif | 2718 | |.endif |
| 2720 | | lea FCARG1, [DISPATCH+GG_DISP2J] | 2719 | | lea FCARG1, [DISPATCH+GG_DISP2J] |
| 2720 | | mov dword [DISPATCH+DISPATCH_GL(jit_base)], 0 | ||
| 2721 | | call extern lj_trace_exit@8 // (jit_State *J, ExitState *ex) | 2721 | | call extern lj_trace_exit@8 // (jit_State *J, ExitState *ex) |
| 2722 | | // MULTRES or negated error code returned in eax (RD). | 2722 | | // MULTRES or negated error code returned in eax (RD). |
| 2723 | | mov RAa, L:RB->cframe | 2723 | | mov RAa, L:RB->cframe |
| @@ -2765,11 +2765,13 @@ static void build_subroutines(BuildCtx *ctx) | |||
| 2765 | | mov r12, TMPQ | 2765 | | mov r12, TMPQ |
| 2766 | |.endif | 2766 | |.endif |
| 2767 | | test RD, RD; js >3 // Check for error from exit. | 2767 | | test RD, RD; js >3 // Check for error from exit. |
| 2768 | | mov L:RB, SAVE_L | ||
| 2768 | | mov MULTRES, RD | 2769 | | mov MULTRES, RD |
| 2769 | | mov LFUNC:KBASE, [BASE-8] | 2770 | | mov LFUNC:KBASE, [BASE-8] |
| 2770 | | mov KBASE, LFUNC:KBASE->pc | 2771 | | mov KBASE, LFUNC:KBASE->pc |
| 2771 | | mov KBASE, [KBASE+PC2PROTO(k)] | 2772 | | mov KBASE, [KBASE+PC2PROTO(k)] |
| 2772 | | mov dword [DISPATCH+DISPATCH_GL(jit_L)], 0 | 2773 | | mov L:RB->base, BASE |
| 2774 | | mov dword [DISPATCH+DISPATCH_GL(jit_base)], 0 | ||
| 2773 | | set_vmstate INTERP | 2775 | | set_vmstate INTERP |
| 2774 | | // Modified copy of ins_next which handles function header dispatch, too. | 2776 | | // Modified copy of ins_next which handles function header dispatch, too. |
| 2775 | | mov RC, [PC] | 2777 | | mov RC, [PC] |
