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
#include "lj_libdef.h"
/* -- jit.opt module ------------------------------------------------------ */
+#if LJ_HASJIT
+
#define LJLIB_MODULE_jit_opt
-#if LJ_HASJIT
/* Parse optimization level. */
static int jitopt_level(jit_State *J, const char *str)
{
}
return 0; /* No match. */
}
-#endif
/* jit.opt.start(flags...) */
LJLIB_CF(jit_opt_start)
{
-#if LJ_HASJIT
jit_State *J = L2J(L);
int nargs = (int)(L->top - L->base);
if (nargs == 0) {
lj_err_callerv(L, LJ_ERR_JITOPT, str);
}
}
-#else
- lj_err_caller(L, LJ_ERR_NOJIT);
-#endif
return 0;
}
#include "lj_libdef.h"
+#endif
+
/* -- JIT compiler initialization ----------------------------------------- */
#if LJ_HASJIT
#ifndef LUAJIT_DISABLE_JITUTIL
LJ_LIB_REG(L, "jit.util", jit_util);
#endif
+#if LJ_HASJIT
LJ_LIB_REG(L, "jit.opt", jit_opt);
+#endif
L->top -= 2;
jit_init(L);
return 1;
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 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
ERRDEF(STRGSRV, "invalid replacement value (a %s)")
ERRDEF(BADMODN, "name conflict for module " LUA_QS)
#if LJ_HASJIT
+#if LJ_TARGET_X86ORX64
ERRDEF(NOJIT, "JIT compiler disabled, CPU does not support SSE2")
+#else
+ERRDEF(NOJIT, "JIT compiler disabled")
+#endif
#elif defined(LJ_ARCH_NOJIT)
ERRDEF(NOJIT, "no JIT compiler for this architecture (yet)")
#else
}
return 0;
}
+#else
+ UNUSED(J);
#endif
if (!(tvistab(o) || tvisudata(o) || tvisthread(o)))
return 1;