diff options
Diffstat (limited to 'src/lj_dispatch.c')
-rw-r--r-- | src/lj_dispatch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c index e2605e96..54cc9006 100644 --- a/src/lj_dispatch.c +++ b/src/lj_dispatch.c | |||
@@ -19,13 +19,15 @@ | |||
19 | #include "lj_vm.h" | 19 | #include "lj_vm.h" |
20 | #include "luajit.h" | 20 | #include "luajit.h" |
21 | 21 | ||
22 | #define GG_DISP_STATIC BC__MAX | ||
23 | |||
22 | /* -- Dispatch table management ------------------------------------------- */ | 24 | /* -- Dispatch table management ------------------------------------------- */ |
23 | 25 | ||
24 | /* Initialize instruction dispatch table and hot counters. */ | 26 | /* Initialize instruction dispatch table and hot counters. */ |
25 | void lj_dispatch_init(GG_State *GG) | 27 | void lj_dispatch_init(GG_State *GG) |
26 | { | 28 | { |
27 | uint32_t i; | 29 | uint32_t i; |
28 | ASMFunction *disp = GG->dispatch; | 30 | ASMFunction *disp = GG2DISP(GG); |
29 | for (i = 0; i < BC__MAX; i++) | 31 | for (i = 0; i < BC__MAX; i++) |
30 | disp[GG_DISP_STATIC+i] = disp[i] = makeasmfunc(lj_bc_ofs[i]); | 32 | disp[GG_DISP_STATIC+i] = disp[i] = makeasmfunc(lj_bc_ofs[i]); |
31 | /* The JIT engine is off by default. luaopen_jit() turns it on. */ | 33 | /* The JIT engine is off by default. luaopen_jit() turns it on. */ |
@@ -57,7 +59,7 @@ void lj_dispatch_update(global_State *g) | |||
57 | #endif | 59 | #endif |
58 | mode |= (g->hookmask & HOOK_EVENTMASK) ? 2 : 0; | 60 | mode |= (g->hookmask & HOOK_EVENTMASK) ? 2 : 0; |
59 | if (oldmode != mode) { /* Mode changed? */ | 61 | if (oldmode != mode) { /* Mode changed? */ |
60 | ASMFunction *disp = G2GG(g)->dispatch; | 62 | ASMFunction *disp = GG2DISP(G2GG(g)); |
61 | ASMFunction f_forl, f_iterl, f_loop; | 63 | ASMFunction f_forl, f_iterl, f_loop; |
62 | g->dispatchmode = mode; | 64 | g->dispatchmode = mode; |
63 | if ((mode & 5) == 1) { /* Hotcount if JIT is on, but not when recording. */ | 65 | if ((mode & 5) == 1) { /* Hotcount if JIT is on, but not when recording. */ |