mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Remove some library functions for no-JIT/no-FFI builds.
This commit is contained in:
parent
2ff4afeb4f
commit
d9c5eba1bb
@ -412,30 +412,16 @@ LJLIB_CF(jit_util_ircalladdr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static int trace_nojit(lua_State *L)
|
|
||||||
{
|
|
||||||
UNUSED(L);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#define lj_cf_jit_util_traceinfo trace_nojit
|
|
||||||
#define lj_cf_jit_util_traceir trace_nojit
|
|
||||||
#define lj_cf_jit_util_tracek trace_nojit
|
|
||||||
#define lj_cf_jit_util_tracesnap trace_nojit
|
|
||||||
#define lj_cf_jit_util_tracemc trace_nojit
|
|
||||||
#define lj_cf_jit_util_traceexitstub trace_nojit
|
|
||||||
#define lj_cf_jit_util_ircalladdr trace_nojit
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "lj_libdef.h"
|
#include "lj_libdef.h"
|
||||||
|
|
||||||
/* -- jit.opt module ------------------------------------------------------ */
|
/* -- jit.opt module ------------------------------------------------------ */
|
||||||
|
|
||||||
|
#if LJ_HASJIT
|
||||||
|
|
||||||
#define LJLIB_MODULE_jit_opt
|
#define LJLIB_MODULE_jit_opt
|
||||||
|
|
||||||
#if LJ_HASJIT
|
|
||||||
/* Parse optimization level. */
|
/* Parse optimization level. */
|
||||||
static int jitopt_level(jit_State *J, const char *str)
|
static int jitopt_level(jit_State *J, const char *str)
|
||||||
{
|
{
|
||||||
@ -502,12 +488,10 @@ static int jitopt_param(jit_State *J, const char *str)
|
|||||||
}
|
}
|
||||||
return 0; /* No match. */
|
return 0; /* No match. */
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* jit.opt.start(flags...) */
|
/* jit.opt.start(flags...) */
|
||||||
LJLIB_CF(jit_opt_start)
|
LJLIB_CF(jit_opt_start)
|
||||||
{
|
{
|
||||||
#if LJ_HASJIT
|
|
||||||
jit_State *J = L2J(L);
|
jit_State *J = L2J(L);
|
||||||
int nargs = (int)(L->top - L->base);
|
int nargs = (int)(L->top - L->base);
|
||||||
if (nargs == 0) {
|
if (nargs == 0) {
|
||||||
@ -522,14 +506,13 @@ LJLIB_CF(jit_opt_start)
|
|||||||
lj_err_callerv(L, LJ_ERR_JITOPT, str);
|
lj_err_callerv(L, LJ_ERR_JITOPT, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
lj_err_caller(L, LJ_ERR_NOJIT);
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "lj_libdef.h"
|
#include "lj_libdef.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* -- JIT compiler initialization ----------------------------------------- */
|
/* -- JIT compiler initialization ----------------------------------------- */
|
||||||
|
|
||||||
#if LJ_HASJIT
|
#if LJ_HASJIT
|
||||||
@ -670,7 +653,9 @@ LUALIB_API int luaopen_jit(lua_State *L)
|
|||||||
#ifndef LUAJIT_DISABLE_JITUTIL
|
#ifndef LUAJIT_DISABLE_JITUTIL
|
||||||
LJ_LIB_REG(L, "jit.util", jit_util);
|
LJ_LIB_REG(L, "jit.util", jit_util);
|
||||||
#endif
|
#endif
|
||||||
|
#if LJ_HASJIT
|
||||||
LJ_LIB_REG(L, "jit.opt", jit_opt);
|
LJ_LIB_REG(L, "jit.opt", jit_opt);
|
||||||
|
#endif
|
||||||
L->top -= 2;
|
L->top -= 2;
|
||||||
jit_init(L);
|
jit_init(L);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -24,19 +24,6 @@ LJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd);
|
|||||||
LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd);
|
LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd);
|
||||||
LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd);
|
LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd);
|
||||||
LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd);
|
LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd);
|
||||||
#else
|
|
||||||
#define recff_cdata_index recff_nyi
|
|
||||||
#define recff_cdata_call recff_nyi
|
|
||||||
#define recff_cdata_arith recff_nyi
|
|
||||||
#define recff_clib_index recff_nyi
|
|
||||||
#define recff_ffi_new recff_nyi
|
|
||||||
#define recff_ffi_errno recff_nyi
|
|
||||||
#define recff_ffi_string recff_nyi
|
|
||||||
#define recff_ffi_copy recff_nyi
|
|
||||||
#define recff_ffi_fill recff_nyi
|
|
||||||
#define recff_ffi_typeof recff_nyi
|
|
||||||
#define recff_ffi_istype recff_nyi
|
|
||||||
#define recff_ffi_abi recff_nyi
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -102,7 +102,11 @@ ERRDEF(STRFMTW, "invalid format (width or precision too long)")
|
|||||||
ERRDEF(STRGSRV, "invalid replacement value (a %s)")
|
ERRDEF(STRGSRV, "invalid replacement value (a %s)")
|
||||||
ERRDEF(BADMODN, "name conflict for module " LUA_QS)
|
ERRDEF(BADMODN, "name conflict for module " LUA_QS)
|
||||||
#if LJ_HASJIT
|
#if LJ_HASJIT
|
||||||
|
#if LJ_TARGET_X86ORX64
|
||||||
ERRDEF(NOJIT, "JIT compiler disabled, CPU does not support SSE2")
|
ERRDEF(NOJIT, "JIT compiler disabled, CPU does not support SSE2")
|
||||||
|
#else
|
||||||
|
ERRDEF(NOJIT, "JIT compiler disabled")
|
||||||
|
#endif
|
||||||
#elif defined(LJ_ARCH_NOJIT)
|
#elif defined(LJ_ARCH_NOJIT)
|
||||||
ERRDEF(NOJIT, "no JIT compiler for this architecture (yet)")
|
ERRDEF(NOJIT, "no JIT compiler for this architecture (yet)")
|
||||||
#else
|
#else
|
||||||
|
@ -1292,6 +1292,8 @@ static int rec_upvalue_constify(jit_State *J, GCupval *uvp)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
UNUSED(J);
|
||||||
#endif
|
#endif
|
||||||
if (!(tvistab(o) || tvisudata(o) || tvisthread(o)))
|
if (!(tvistab(o) || tvisudata(o) || tvisthread(o)))
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user