Conditionally compile functions that are unused with JIT disabled.

master
Mike Pall 2010-02-28 21:58:40 +01:00
parent 2e22d33d9d
commit 8cc50cf6b1
8 changed files with 18 additions and 0 deletions

View File

@ -59,7 +59,9 @@ typedef struct GG_State {
/* Dispatch table management. */
LJ_FUNC void lj_dispatch_init(GG_State *GG);
#if LJ_HASJIT
LJ_FUNC void lj_dispatch_init_hotcount(global_State *g);
#endif
LJ_FUNC void lj_dispatch_update(global_State *g);
/* Instruction dispatch callback for hooks or when recording. */

View File

@ -631,6 +631,7 @@ void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L)
lj_gc_step(L);
}
#if LJ_HASJIT
/* Perform multiple GC steps. Called from JIT-compiled code. */
void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps)
{
@ -638,6 +639,7 @@ void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps)
while (steps-- > 0 && lj_gc_step(L) == 0)
;
}
#endif
/* Perform a full GC cycle. */
void lj_gc_fullgc(lua_State *L)

View File

@ -46,7 +46,9 @@ LJ_FUNC void lj_gc_finalizeudata(lua_State *L);
LJ_FUNC void lj_gc_freeall(global_State *g);
LJ_FUNCA int LJ_FASTCALL lj_gc_step(lua_State *L);
LJ_FUNCA void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L);
#if LJ_HASJIT
LJ_FUNC void LJ_FASTCALL lj_gc_step_jit(lua_State *L, MSize steps);
#endif
LJ_FUNC void lj_gc_fullgc(lua_State *L);
/* 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);
LJ_FUNC void lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v);
LJ_FUNCA void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv);
LJ_FUNC void lj_gc_closeuv(global_State *g, GCupval *uv);
#if LJ_HASJIT
LJ_FUNC void lj_gc_barriertrace(global_State *g, void *T);
#endif
/* Barrier for stores to table objects. TValue and GCobj variant. */
#define lj_gc_barriert(L, t, tv) \

View File

@ -18,7 +18,9 @@
#include "lj_meta.h"
#include "lj_state.h"
#include "lj_frame.h"
#if LJ_HASJIT
#include "lj_mcode.h"
#endif
#include "lj_trace.h"
#include "lj_dispatch.h"
#include "lj_vm.h"

View File

@ -181,6 +181,7 @@ GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np)
return lj_str_new(L, s, len);
}
#if LJ_HASJIT
/* Convert integer to string. */
GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k)
{
@ -191,6 +192,7 @@ GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k)
if (k < 0) *--p = '-';
return lj_str_new(L, p, (size_t)(s+sizeof(s)-p));
}
#endif
/* -- String formatting --------------------------------------------------- */

View File

@ -23,7 +23,9 @@ LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s);
LJ_FUNC int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n);
LJ_FUNC int LJ_FASTCALL lj_str_tonum(GCstr *str, TValue *n);
LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np);
#if LJ_HASJIT
LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k);
#endif
/* String formatting. */
LJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp);

View File

@ -160,6 +160,7 @@ GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits)
return t;
}
#if LJ_HASJIT
GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize)
{
GCtab *t = newtab(L, ahsize & 0xffffff, ahsize >> 24);
@ -167,6 +168,7 @@ GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize)
if (t->hmask > 0) clearhpart(t);
return t;
}
#endif
/* Duplicate a table. */
GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt)

View File

@ -11,7 +11,9 @@
#define hsize2hbits(s) ((s) ? ((s)==1 ? 1 : 1+lj_fls((uint32_t)((s)-1))) : 0)
LJ_FUNCA GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits);
#if LJ_HASJIT
LJ_FUNC GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize);
#endif
LJ_FUNCA GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt);
LJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t);
LJ_FUNCA void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize);