MIPS: Add interpreter. Enable MIPS build rules.
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user