diff options
author | Mike Pall <mike> | 2012-09-24 16:56:07 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-09-24 16:56:07 +0200 |
commit | d9c5eba1bb0ad59a40f4d79fd331cdf1f9f4b81e (patch) | |
tree | e5665e12599a5c1a925bf88adf1525947ac322eb /src | |
parent | 2ff4afeb4f7d73eb0bd90092866cfdb4e8caa2f3 (diff) | |
download | luajit-d9c5eba1bb0ad59a40f4d79fd331cdf1f9f4b81e.tar.gz luajit-d9c5eba1bb0ad59a40f4d79fd331cdf1f9f4b81e.tar.bz2 luajit-d9c5eba1bb0ad59a40f4d79fd331cdf1f9f4b81e.zip |
Remove some library functions for no-JIT/no-FFI builds.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib_jit.c | 27 | ||||
-rw-r--r-- | src/lj_crecord.h | 13 | ||||
-rw-r--r-- | src/lj_errmsg.h | 4 | ||||
-rw-r--r-- | src/lj_record.c | 2 |
4 files changed, 12 insertions, 34 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c index 68328b67..a455a130 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -412,30 +412,16 @@ LJLIB_CF(jit_util_ircalladdr) | |||
412 | return 0; | 412 | return 0; |
413 | } | 413 | } |
414 | 414 | ||
415 | #else | ||
416 | |||
417 | static int trace_nojit(lua_State *L) | ||
418 | { | ||
419 | UNUSED(L); | ||
420 | return 0; | ||
421 | } | ||
422 | #define lj_cf_jit_util_traceinfo trace_nojit | ||
423 | #define lj_cf_jit_util_traceir trace_nojit | ||
424 | #define lj_cf_jit_util_tracek trace_nojit | ||
425 | #define lj_cf_jit_util_tracesnap trace_nojit | ||
426 | #define lj_cf_jit_util_tracemc trace_nojit | ||
427 | #define lj_cf_jit_util_traceexitstub trace_nojit | ||
428 | #define lj_cf_jit_util_ircalladdr trace_nojit | ||
429 | |||
430 | #endif | 415 | #endif |
431 | 416 | ||
432 | #include "lj_libdef.h" | 417 | #include "lj_libdef.h" |
433 | 418 | ||
434 | /* -- jit.opt module ------------------------------------------------------ */ | 419 | /* -- jit.opt module ------------------------------------------------------ */ |
435 | 420 | ||
421 | #if LJ_HASJIT | ||
422 | |||
436 | #define LJLIB_MODULE_jit_opt | 423 | #define LJLIB_MODULE_jit_opt |
437 | 424 | ||
438 | #if LJ_HASJIT | ||
439 | /* Parse optimization level. */ | 425 | /* Parse optimization level. */ |
440 | static int jitopt_level(jit_State *J, const char *str) | 426 | static int jitopt_level(jit_State *J, const char *str) |
441 | { | 427 | { |
@@ -502,12 +488,10 @@ static int jitopt_param(jit_State *J, const char *str) | |||
502 | } | 488 | } |
503 | return 0; /* No match. */ | 489 | return 0; /* No match. */ |
504 | } | 490 | } |
505 | #endif | ||
506 | 491 | ||
507 | /* jit.opt.start(flags...) */ | 492 | /* jit.opt.start(flags...) */ |
508 | LJLIB_CF(jit_opt_start) | 493 | LJLIB_CF(jit_opt_start) |
509 | { | 494 | { |
510 | #if LJ_HASJIT | ||
511 | jit_State *J = L2J(L); | 495 | jit_State *J = L2J(L); |
512 | int nargs = (int)(L->top - L->base); | 496 | int nargs = (int)(L->top - L->base); |
513 | if (nargs == 0) { | 497 | if (nargs == 0) { |
@@ -522,14 +506,13 @@ LJLIB_CF(jit_opt_start) | |||
522 | lj_err_callerv(L, LJ_ERR_JITOPT, str); | 506 | lj_err_callerv(L, LJ_ERR_JITOPT, str); |
523 | } | 507 | } |
524 | } | 508 | } |
525 | #else | ||
526 | lj_err_caller(L, LJ_ERR_NOJIT); | ||
527 | #endif | ||
528 | return 0; | 509 | return 0; |
529 | } | 510 | } |
530 | 511 | ||
531 | #include "lj_libdef.h" | 512 | #include "lj_libdef.h" |
532 | 513 | ||
514 | #endif | ||
515 | |||
533 | /* -- JIT compiler initialization ----------------------------------------- */ | 516 | /* -- JIT compiler initialization ----------------------------------------- */ |
534 | 517 | ||
535 | #if LJ_HASJIT | 518 | #if LJ_HASJIT |
@@ -670,7 +653,9 @@ LUALIB_API int luaopen_jit(lua_State *L) | |||
670 | #ifndef LUAJIT_DISABLE_JITUTIL | 653 | #ifndef LUAJIT_DISABLE_JITUTIL |
671 | LJ_LIB_REG(L, "jit.util", jit_util); | 654 | LJ_LIB_REG(L, "jit.util", jit_util); |
672 | #endif | 655 | #endif |
656 | #if LJ_HASJIT | ||
673 | LJ_LIB_REG(L, "jit.opt", jit_opt); | 657 | LJ_LIB_REG(L, "jit.opt", jit_opt); |
658 | #endif | ||
674 | L->top -= 2; | 659 | L->top -= 2; |
675 | jit_init(L); | 660 | jit_init(L); |
676 | return 1; | 661 | return 1; |
diff --git a/src/lj_crecord.h b/src/lj_crecord.h index c2a3758d..ab0e27e7 100644 --- a/src/lj_crecord.h +++ b/src/lj_crecord.h | |||
@@ -24,19 +24,6 @@ LJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd); | |||
24 | LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd); | 24 | LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd); |
25 | LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd); | 25 | LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd); |
26 | LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); | 26 | LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); |
27 | #else | ||
28 | #define recff_cdata_index recff_nyi | ||
29 | #define recff_cdata_call recff_nyi | ||
30 | #define recff_cdata_arith recff_nyi | ||
31 | #define recff_clib_index recff_nyi | ||
32 | #define recff_ffi_new recff_nyi | ||
33 | #define recff_ffi_errno recff_nyi | ||
34 | #define recff_ffi_string recff_nyi | ||
35 | #define recff_ffi_copy recff_nyi | ||
36 | #define recff_ffi_fill recff_nyi | ||
37 | #define recff_ffi_typeof recff_nyi | ||
38 | #define recff_ffi_istype recff_nyi | ||
39 | #define recff_ffi_abi recff_nyi | ||
40 | #endif | 27 | #endif |
41 | 28 | ||
42 | #endif | 29 | #endif |
diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h index da40e848..f368da5a 100644 --- a/src/lj_errmsg.h +++ b/src/lj_errmsg.h | |||
@@ -102,7 +102,11 @@ ERRDEF(STRFMTW, "invalid format (width or precision too long)") | |||
102 | ERRDEF(STRGSRV, "invalid replacement value (a %s)") | 102 | ERRDEF(STRGSRV, "invalid replacement value (a %s)") |
103 | ERRDEF(BADMODN, "name conflict for module " LUA_QS) | 103 | ERRDEF(BADMODN, "name conflict for module " LUA_QS) |
104 | #if LJ_HASJIT | 104 | #if LJ_HASJIT |
105 | #if LJ_TARGET_X86ORX64 | ||
105 | ERRDEF(NOJIT, "JIT compiler disabled, CPU does not support SSE2") | 106 | ERRDEF(NOJIT, "JIT compiler disabled, CPU does not support SSE2") |
107 | #else | ||
108 | ERRDEF(NOJIT, "JIT compiler disabled") | ||
109 | #endif | ||
106 | #elif defined(LJ_ARCH_NOJIT) | 110 | #elif defined(LJ_ARCH_NOJIT) |
107 | ERRDEF(NOJIT, "no JIT compiler for this architecture (yet)") | 111 | ERRDEF(NOJIT, "no JIT compiler for this architecture (yet)") |
108 | #else | 112 | #else |
diff --git a/src/lj_record.c b/src/lj_record.c index 7620ae4c..5910dab4 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1292,6 +1292,8 @@ static int rec_upvalue_constify(jit_State *J, GCupval *uvp) | |||
1292 | } | 1292 | } |
1293 | return 0; | 1293 | return 0; |
1294 | } | 1294 | } |
1295 | #else | ||
1296 | UNUSED(J); | ||
1295 | #endif | 1297 | #endif |
1296 | if (!(tvistab(o) || tvisudata(o) || tvisthread(o))) | 1298 | if (!(tvistab(o) || tvisudata(o) || tvisthread(o))) |
1297 | return 1; | 1299 | return 1; |