diff options
Diffstat (limited to 'src/lj_dispatch.c')
-rw-r--r-- | src/lj_dispatch.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c index 38fd1709..d99eb878 100644 --- a/src/lj_dispatch.c +++ b/src/lj_dispatch.c | |||
@@ -8,6 +8,10 @@ | |||
8 | 8 | ||
9 | #include "lj_obj.h" | 9 | #include "lj_obj.h" |
10 | #include "lj_err.h" | 10 | #include "lj_err.h" |
11 | #include "lj_func.h" | ||
12 | #include "lj_str.h" | ||
13 | #include "lj_tab.h" | ||
14 | #include "lj_meta.h" | ||
11 | #include "lj_debug.h" | 15 | #include "lj_debug.h" |
12 | #include "lj_state.h" | 16 | #include "lj_state.h" |
13 | #include "lj_frame.h" | 17 | #include "lj_frame.h" |
@@ -16,6 +20,9 @@ | |||
16 | #if LJ_HASJIT | 20 | #if LJ_HASJIT |
17 | #include "lj_jit.h" | 21 | #include "lj_jit.h" |
18 | #endif | 22 | #endif |
23 | #if LJ_HASFFI | ||
24 | #include "lj_ccallback.h" | ||
25 | #endif | ||
19 | #include "lj_trace.h" | 26 | #include "lj_trace.h" |
20 | #include "lj_dispatch.h" | 27 | #include "lj_dispatch.h" |
21 | #include "lj_vm.h" | 28 | #include "lj_vm.h" |
@@ -26,6 +33,18 @@ LJ_STATIC_ASSERT(GG_NUM_ASMFF == FF_NUM_ASMFUNC); | |||
26 | 33 | ||
27 | /* -- Dispatch table management ------------------------------------------- */ | 34 | /* -- Dispatch table management ------------------------------------------- */ |
28 | 35 | ||
36 | #if LJ_TARGET_MIPS | ||
37 | #include <math.h> | ||
38 | LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, | ||
39 | lua_State *co); | ||
40 | |||
41 | #define GOTFUNC(name) (ASMFunction)name, | ||
42 | static const ASMFunction dispatch_got[] = { | ||
43 | GOTDEF(GOTFUNC) | ||
44 | }; | ||
45 | #undef GOTFUNC | ||
46 | #endif | ||
47 | |||
29 | /* Initialize instruction dispatch table and hot counters. */ | 48 | /* Initialize instruction dispatch table and hot counters. */ |
30 | void lj_dispatch_init(GG_State *GG) | 49 | void lj_dispatch_init(GG_State *GG) |
31 | { | 50 | { |
@@ -44,6 +63,9 @@ void lj_dispatch_init(GG_State *GG) | |||
44 | GG->g.bc_cfunc_ext = GG->g.bc_cfunc_int = BCINS_AD(BC_FUNCC, LUA_MINSTACK, 0); | 63 | GG->g.bc_cfunc_ext = GG->g.bc_cfunc_int = BCINS_AD(BC_FUNCC, LUA_MINSTACK, 0); |
45 | for (i = 0; i < GG_NUM_ASMFF; i++) | 64 | for (i = 0; i < GG_NUM_ASMFF; i++) |
46 | GG->bcff[i] = BCINS_AD(BC__MAX+i, 0, 0); | 65 | GG->bcff[i] = BCINS_AD(BC__MAX+i, 0, 0); |
66 | #if LJ_TARGET_MIPS | ||
67 | memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4); | ||
68 | #endif | ||
47 | } | 69 | } |
48 | 70 | ||
49 | #if LJ_HASJIT | 71 | #if LJ_HASJIT |