diff options
author | Mike Pall <mike> | 2012-01-23 22:20:28 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2012-01-23 22:24:11 +0100 |
commit | 5bed11e6b4c2bbf0cbec0f00efe998289236b217 (patch) | |
tree | 5ed76367d5157df37b358a5874d34a21dc7d60b0 /src/lj_dispatch.h | |
parent | 7d2774e4c5ee7c649ccb41f75bfbbb1e7f370a96 (diff) | |
download | luajit2-5bed11e6b4c2bbf0cbec0f00efe998289236b217.tar.gz |
MIPS: Add interpreter. Enable MIPS build rules.
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 @@ #include "lj_jit.h" #endif +#if LJ_TARGET_MIPS +/* Need our own global offset table for the dreaded MIPS calling conventions. */ +#if LJ_HASJIT +#define JITGOTDEF(_) _(lj_trace_exit) _(lj_trace_hot) +#else +#define JITGOTDEF(_) +#endif +#if LJ_HASFFI +#define FFIGOTDEF(_) \ + _(lj_meta_equal_cd) _(lj_ccallback_enter) _(lj_ccallback_leave) +#else +#define FFIGOTDEF(_) +#endif +#define GOTDEF(_) \ + _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \ + _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \ + _(pow) _(fmod) _(ldexp) \ + _(lj_dispatch_call) _(lj_dispatch_ins) _(lj_err_throw) \ + _(lj_ffh_coroutine_wrap_err) _(lj_func_closeuv) _(lj_func_newL_gc) \ + _(lj_gc_barrieruv) _(lj_gc_step) _(lj_gc_step_fixtop) _(lj_meta_arith) \ + _(lj_meta_call) _(lj_meta_cat) _(lj_meta_comp) _(lj_meta_equal) \ + _(lj_meta_for) _(lj_meta_len) _(lj_meta_tget) _(lj_meta_tset) \ + _(lj_state_growstack) _(lj_str_fromnum) _(lj_str_fromnumber) _(lj_str_new) \ + _(lj_tab_dup) _(lj_tab_get) _(lj_tab_getinth) _(lj_tab_len) _(lj_tab_new) \ + _(lj_tab_newkey) _(lj_tab_next) _(lj_tab_reasize) \ + JITGOTDEF(_) FFIGOTDEF(_) + +enum { +#define GOTENUM(name) LJ_GOT_##name, +GOTDEF(GOTENUM) +#undef GOTENUM + LJ_GOT__MAX +}; +#endif + /* Type of hot counter. Must match the code in the assembler VM. */ /* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */ typedef uint16_t HotCount; @@ -35,6 +70,9 @@ typedef uint16_t HotCount; typedef struct GG_State { lua_State L; /* Main thread. */ global_State g; /* Global state. */ +#if LJ_TARGET_MIPS + ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */ +#endif #if LJ_HASJIT jit_State J; /* JIT state. */ HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */ |