diff options
Diffstat (limited to 'src/lj_dispatch.h')
-rw-r--r-- | src/lj_dispatch.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/lj_dispatch.h b/src/lj_dispatch.h index c50d33ac..7dec0437 100644 --- a/src/lj_dispatch.h +++ b/src/lj_dispatch.h | |||
@@ -12,6 +12,41 @@ | |||
12 | #include "lj_jit.h" | 12 | #include "lj_jit.h" |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #if LJ_TARGET_MIPS | ||
16 | /* Need our own global offset table for the dreaded MIPS calling conventions. */ | ||
17 | #if LJ_HASJIT | ||
18 | #define JITGOTDEF(_) _(lj_trace_exit) _(lj_trace_hot) | ||
19 | #else | ||
20 | #define JITGOTDEF(_) | ||
21 | #endif | ||
22 | #if LJ_HASFFI | ||
23 | #define FFIGOTDEF(_) \ | ||
24 | _(lj_meta_equal_cd) _(lj_ccallback_enter) _(lj_ccallback_leave) | ||
25 | #else | ||
26 | #define FFIGOTDEF(_) | ||
27 | #endif | ||
28 | #define GOTDEF(_) \ | ||
29 | _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \ | ||
30 | _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \ | ||
31 | _(pow) _(fmod) _(ldexp) \ | ||
32 | _(lj_dispatch_call) _(lj_dispatch_ins) _(lj_err_throw) \ | ||
33 | _(lj_ffh_coroutine_wrap_err) _(lj_func_closeuv) _(lj_func_newL_gc) \ | ||
34 | _(lj_gc_barrieruv) _(lj_gc_step) _(lj_gc_step_fixtop) _(lj_meta_arith) \ | ||
35 | _(lj_meta_call) _(lj_meta_cat) _(lj_meta_comp) _(lj_meta_equal) \ | ||
36 | _(lj_meta_for) _(lj_meta_len) _(lj_meta_tget) _(lj_meta_tset) \ | ||
37 | _(lj_state_growstack) _(lj_str_fromnum) _(lj_str_fromnumber) _(lj_str_new) \ | ||
38 | _(lj_tab_dup) _(lj_tab_get) _(lj_tab_getinth) _(lj_tab_len) _(lj_tab_new) \ | ||
39 | _(lj_tab_newkey) _(lj_tab_next) _(lj_tab_reasize) \ | ||
40 | JITGOTDEF(_) FFIGOTDEF(_) | ||
41 | |||
42 | enum { | ||
43 | #define GOTENUM(name) LJ_GOT_##name, | ||
44 | GOTDEF(GOTENUM) | ||
45 | #undef GOTENUM | ||
46 | LJ_GOT__MAX | ||
47 | }; | ||
48 | #endif | ||
49 | |||
15 | /* Type of hot counter. Must match the code in the assembler VM. */ | 50 | /* Type of hot counter. Must match the code in the assembler VM. */ |
16 | /* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */ | 51 | /* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */ |
17 | typedef uint16_t HotCount; | 52 | typedef uint16_t HotCount; |
@@ -35,6 +70,9 @@ typedef uint16_t HotCount; | |||
35 | typedef struct GG_State { | 70 | typedef struct GG_State { |
36 | lua_State L; /* Main thread. */ | 71 | lua_State L; /* Main thread. */ |
37 | global_State g; /* Global state. */ | 72 | global_State g; /* Global state. */ |
73 | #if LJ_TARGET_MIPS | ||
74 | ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */ | ||
75 | #endif | ||
38 | #if LJ_HASJIT | 76 | #if LJ_HASJIT |
39 | jit_State J; /* JIT state. */ | 77 | jit_State J; /* JIT state. */ |
40 | HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */ | 78 | HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */ |