Browse Source

Conditionally compile functions that are unused with JIT disabled.

Mike Pall 15 năm trước cách đây
mục cha
commit
8cc50cf6b1
8 tập tin đã thay đổi với 18 bổ sung0 xóa
  1. 2 0
      src/lj_dispatch.h
  2. 2 0
      src/lj_gc.c
  3. 4 0
      src/lj_gc.h
  4. 2 0
      src/lj_state.c
  5. 2 0
      src/lj_str.c
  6. 2 0
      src/lj_str.h
  7. 2 0
      src/lj_tab.c
  8. 2 0
      src/lj_tab.h

+ 2 - 0
src/lj_dispatch.h

@@ -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. */

+ 2 - 0
src/lj_gc.c

@@ -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)

+ 4 - 0
src/lj_gc.h

@@ -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) \

+ 2 - 0
src/lj_state.c

@@ -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"

+ 2 - 0
src/lj_str.c

@@ -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 --------------------------------------------------- */
 

+ 2 - 0
src/lj_str.h

@@ -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);

+ 2 - 0
src/lj_tab.c

@@ -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)

+ 2 - 0
src/lj_tab.h

@@ -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);