diff options
author | Mike Pall <mike> | 2010-02-28 21:58:40 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-02-28 21:58:40 +0100 |
commit | 8cc50cf6b1c791e9d7694b5f47dc03f9456d08e1 (patch) | |
tree | a0c1bcb22cf7fc88b4937c1b48da145aeec01686 /src | |
parent | 2e22d33d9d256e9a1551229f1b51e2a6f02da2f6 (diff) | |
download | luajit-8cc50cf6b1c791e9d7694b5f47dc03f9456d08e1.tar.gz luajit-8cc50cf6b1c791e9d7694b5f47dc03f9456d08e1.tar.bz2 luajit-8cc50cf6b1c791e9d7694b5f47dc03f9456d08e1.zip |
Conditionally compile functions that are unused with JIT disabled.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_dispatch.h | 2 | ||||
-rw-r--r-- | src/lj_gc.c | 2 | ||||
-rw-r--r-- | src/lj_gc.h | 4 | ||||
-rw-r--r-- | src/lj_state.c | 2 | ||||
-rw-r--r-- | src/lj_str.c | 2 | ||||
-rw-r--r-- | src/lj_str.h | 2 | ||||
-rw-r--r-- | src/lj_tab.c | 2 | ||||
-rw-r--r-- | src/lj_tab.h | 2 |
8 files changed, 18 insertions, 0 deletions
diff --git a/src/lj_dispatch.h b/src/lj_dispatch.h index 5ef9dcd4..fda78d8e 100644 --- a/src/lj_dispatch.h +++ b/src/lj_dispatch.h | |||
@@ -59,7 +59,9 @@ typedef struct GG_State { | |||
59 | 59 | ||
60 | /* Dispatch table management. */ | 60 | /* Dispatch table management. */ |
61 | LJ_FUNC void lj_dispatch_init(GG_State *GG); | 61 | LJ_FUNC void lj_dispatch_init(GG_State *GG); |
62 | #if LJ_HASJIT | ||
62 | LJ_FUNC void lj_dispatch_init_hotcount(global_State *g); | 63 | LJ_FUNC void lj_dispatch_init_hotcount(global_State *g); |
64 | #endif | ||
63 | LJ_FUNC void lj_dispatch_update(global_State *g); | 65 | LJ_FUNC void lj_dispatch_update(global_State *g); |
64 | 66 | ||
65 | /* Instruction dispatch callback for hooks or when recording. */ | 67 | /* Instruction dispatch callback for hooks or when recording. */ |
diff --git a/src/lj_gc.c b/src/lj_gc.c index d769c0c8..19cc9e7b 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c | |||
@@ -631,6 +631,7 @@ void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L) | |||
631 | lj_gc_step(L); | 631 | lj_gc_step(L); |
632 | } | 632 | } |
633 | 633 | ||
634 | #if LJ_HASJIT | ||
634 | /* Perform multiple GC steps. Called from JIT-compiled code. */ | 635 | /* Perform multiple GC steps. Called from JIT-compiled code. */ |
635 | void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps) | 636 | void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps) |
636 | { | 637 | { |
@@ -638,6 +639,7 @@ void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps) | |||
638 | while (steps-- > 0 && lj_gc_step(L) == 0) | 639 | while (steps-- > 0 && lj_gc_step(L) == 0) |
639 | ; | 640 | ; |
640 | } | 641 | } |
642 | #endif | ||
641 | 643 | ||
642 | /* Perform a full GC cycle. */ | 644 | /* Perform a full GC cycle. */ |
643 | void lj_gc_fullgc(lua_State *L) | 645 | void lj_gc_fullgc(lua_State *L) |
diff --git a/src/lj_gc.h b/src/lj_gc.h index 49545c2e..3c4f2d24 100644 --- a/src/lj_gc.h +++ b/src/lj_gc.h | |||
@@ -46,7 +46,9 @@ LJ_FUNC void lj_gc_finalizeudata(lua_State *L); | |||
46 | LJ_FUNC void lj_gc_freeall(global_State *g); | 46 | LJ_FUNC void lj_gc_freeall(global_State *g); |
47 | LJ_FUNCA int LJ_FASTCALL lj_gc_step(lua_State *L); | 47 | LJ_FUNCA int LJ_FASTCALL lj_gc_step(lua_State *L); |
48 | LJ_FUNCA void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L); | 48 | LJ_FUNCA void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L); |
49 | #if LJ_HASJIT | ||
49 | LJ_FUNC void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps); | 50 | LJ_FUNC void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps); |
51 | #endif | ||
50 | LJ_FUNC void lj_gc_fullgc(lua_State *L); | 52 | LJ_FUNC void lj_gc_fullgc(lua_State *L); |
51 | 53 | ||
52 | /* GC check: drive collector forward if the GC threshold has been reached. */ | 54 | /* GC check: drive collector forward if the GC threshold has been reached. */ |
@@ -62,7 +64,9 @@ LJ_FUNC void lj_gc_barrierback(global_State *g, GCtab *t); | |||
62 | LJ_FUNC void lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v); | 64 | LJ_FUNC void lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v); |
63 | LJ_FUNCA void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv); | 65 | LJ_FUNCA void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv); |
64 | LJ_FUNC void lj_gc_closeuv(global_State *g, GCupval *uv); | 66 | LJ_FUNC void lj_gc_closeuv(global_State *g, GCupval *uv); |
67 | #if LJ_HASJIT | ||
65 | LJ_FUNC void lj_gc_barriertrace(global_State *g, void *T); | 68 | LJ_FUNC void lj_gc_barriertrace(global_State *g, void *T); |
69 | #endif | ||
66 | 70 | ||
67 | /* Barrier for stores to table objects. TValue and GCobj variant. */ | 71 | /* Barrier for stores to table objects. TValue and GCobj variant. */ |
68 | #define lj_gc_barriert(L, t, tv) \ | 72 | #define lj_gc_barriert(L, t, tv) \ |
diff --git a/src/lj_state.c b/src/lj_state.c index 2287efca..275dde44 100644 --- a/src/lj_state.c +++ b/src/lj_state.c | |||
@@ -18,7 +18,9 @@ | |||
18 | #include "lj_meta.h" | 18 | #include "lj_meta.h" |
19 | #include "lj_state.h" | 19 | #include "lj_state.h" |
20 | #include "lj_frame.h" | 20 | #include "lj_frame.h" |
21 | #if LJ_HASJIT | ||
21 | #include "lj_mcode.h" | 22 | #include "lj_mcode.h" |
23 | #endif | ||
22 | #include "lj_trace.h" | 24 | #include "lj_trace.h" |
23 | #include "lj_dispatch.h" | 25 | #include "lj_dispatch.h" |
24 | #include "lj_vm.h" | 26 | #include "lj_vm.h" |
diff --git a/src/lj_str.c b/src/lj_str.c index 78f81e6a..9aa62582 100644 --- a/src/lj_str.c +++ b/src/lj_str.c | |||
@@ -181,6 +181,7 @@ GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np) | |||
181 | return lj_str_new(L, s, len); | 181 | return lj_str_new(L, s, len); |
182 | } | 182 | } |
183 | 183 | ||
184 | #if LJ_HASJIT | ||
184 | /* Convert integer to string. */ | 185 | /* Convert integer to string. */ |
185 | GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k) | 186 | GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k) |
186 | { | 187 | { |
@@ -191,6 +192,7 @@ GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k) | |||
191 | if (k < 0) *--p = '-'; | 192 | if (k < 0) *--p = '-'; |
192 | return lj_str_new(L, p, (size_t)(s+sizeof(s)-p)); | 193 | return lj_str_new(L, p, (size_t)(s+sizeof(s)-p)); |
193 | } | 194 | } |
195 | #endif | ||
194 | 196 | ||
195 | /* -- String formatting --------------------------------------------------- */ | 197 | /* -- String formatting --------------------------------------------------- */ |
196 | 198 | ||
diff --git a/src/lj_str.h b/src/lj_str.h index 5a4fcb9a..cdb04568 100644 --- a/src/lj_str.h +++ b/src/lj_str.h | |||
@@ -23,7 +23,9 @@ LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s); | |||
23 | LJ_FUNC int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n); | 23 | LJ_FUNC int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n); |
24 | LJ_FUNC int LJ_FASTCALL lj_str_tonum(GCstr *str, TValue *n); | 24 | LJ_FUNC int LJ_FASTCALL lj_str_tonum(GCstr *str, TValue *n); |
25 | LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np); | 25 | LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np); |
26 | #if LJ_HASJIT | ||
26 | LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k); | 27 | LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k); |
28 | #endif | ||
27 | 29 | ||
28 | /* String formatting. */ | 30 | /* String formatting. */ |
29 | LJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp); | 31 | LJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp); |
diff --git a/src/lj_tab.c b/src/lj_tab.c index 43737aa9..427b6118 100644 --- a/src/lj_tab.c +++ b/src/lj_tab.c | |||
@@ -160,6 +160,7 @@ GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits) | |||
160 | return t; | 160 | return t; |
161 | } | 161 | } |
162 | 162 | ||
163 | #if LJ_HASJIT | ||
163 | GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize) | 164 | GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize) |
164 | { | 165 | { |
165 | GCtab *t = newtab(L, ahsize & 0xffffff, ahsize >> 24); | 166 | GCtab *t = newtab(L, ahsize & 0xffffff, ahsize >> 24); |
@@ -167,6 +168,7 @@ GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize) | |||
167 | if (t->hmask > 0) clearhpart(t); | 168 | if (t->hmask > 0) clearhpart(t); |
168 | return t; | 169 | return t; |
169 | } | 170 | } |
171 | #endif | ||
170 | 172 | ||
171 | /* Duplicate a table. */ | 173 | /* Duplicate a table. */ |
172 | GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt) | 174 | GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt) |
diff --git a/src/lj_tab.h b/src/lj_tab.h index 8e4e9316..f8ace6c1 100644 --- a/src/lj_tab.h +++ b/src/lj_tab.h | |||
@@ -11,7 +11,9 @@ | |||
11 | #define hsize2hbits(s) ((s) ? ((s)==1 ? 1 : 1+lj_fls((uint32_t)((s)-1))) : 0) | 11 | #define hsize2hbits(s) ((s) ? ((s)==1 ? 1 : 1+lj_fls((uint32_t)((s)-1))) : 0) |
12 | 12 | ||
13 | LJ_FUNCA GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits); | 13 | LJ_FUNCA GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits); |
14 | #if LJ_HASJIT | ||
14 | LJ_FUNC GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize); | 15 | LJ_FUNC GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize); |
16 | #endif | ||
15 | LJ_FUNCA GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt); | 17 | LJ_FUNCA GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt); |
16 | LJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t); | 18 | LJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t); |
17 | LJ_FUNCA void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize); | 19 | LJ_FUNCA void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize); |