aboutsummaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorMike Pall <mike>2022-06-08 11:20:28 +0200
committerMike Pall <mike>2022-06-08 11:20:28 +0200
commitb32e94856bf4970261e4d9d925133ba802a62d16 (patch)
treee117c8c956d343b4b0e9764b3954ebcd03920df2 /src/host
parent68bb11405ce8b6356cb90dac010b5c87b933bbab (diff)
downloadluajit-b32e94856bf4970261e4d9d925133ba802a62d16.tar.gz
luajit-b32e94856bf4970261e4d9d925133ba802a62d16.tar.bz2
luajit-b32e94856bf4970261e4d9d925133ba802a62d16.zip
Don't use jit_State during build with JIT disabled.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/buildvm.c10
-rw-r--r--src/host/buildvm_fold.c7
2 files changed, 17 insertions, 0 deletions
diff --git a/src/host/buildvm.c b/src/host/buildvm.c
index 7348bd5b..9ee47ada 100644
--- a/src/host/buildvm.c
+++ b/src/host/buildvm.c
@@ -18,8 +18,10 @@
18#include "lj_obj.h" 18#include "lj_obj.h"
19#include "lj_gc.h" 19#include "lj_gc.h"
20#include "lj_bc.h" 20#include "lj_bc.h"
21#if LJ_HASJIT
21#include "lj_ir.h" 22#include "lj_ir.h"
22#include "lj_ircall.h" 23#include "lj_ircall.h"
24#endif
23#include "lj_frame.h" 25#include "lj_frame.h"
24#include "lj_dispatch.h" 26#include "lj_dispatch.h"
25#if LJ_HASFFI 27#if LJ_HASFFI
@@ -250,6 +252,7 @@ BCDEF(BCNAME)
250 NULL 252 NULL
251}; 253};
252 254
255#if LJ_HASJIT
253const char *const ir_names[] = { 256const char *const ir_names[] = {
254#define IRNAME(name, m, m1, m2) #name, 257#define IRNAME(name, m, m1, m2) #name,
255IRDEF(IRNAME) 258IRDEF(IRNAME)
@@ -290,7 +293,9 @@ static const char *const trace_errors[] = {
290#include "lj_traceerr.h" 293#include "lj_traceerr.h"
291 NULL 294 NULL
292}; 295};
296#endif
293 297
298#if LJ_HASJIT
294static const char *lower(char *buf, const char *s) 299static const char *lower(char *buf, const char *s)
295{ 300{
296 char *p = buf; 301 char *p = buf;
@@ -301,6 +306,7 @@ static const char *lower(char *buf, const char *s)
301 *p = '\0'; 306 *p = '\0';
302 return buf; 307 return buf;
303} 308}
309#endif
304 310
305/* Emit C source code for bytecode-related definitions. */ 311/* Emit C source code for bytecode-related definitions. */
306static void emit_bcdef(BuildCtx *ctx) 312static void emit_bcdef(BuildCtx *ctx)
@@ -318,7 +324,9 @@ static void emit_bcdef(BuildCtx *ctx)
318/* Emit VM definitions as Lua code for debug modules. */ 324/* Emit VM definitions as Lua code for debug modules. */
319static void emit_vmdef(BuildCtx *ctx) 325static void emit_vmdef(BuildCtx *ctx)
320{ 326{
327#if LJ_HASJIT
321 char buf[80]; 328 char buf[80];
329#endif
322 int i; 330 int i;
323 fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); 331 fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n");
324 fprintf(ctx->fp, "return {\n\n"); 332 fprintf(ctx->fp, "return {\n\n");
@@ -327,6 +335,7 @@ static void emit_vmdef(BuildCtx *ctx)
327 for (i = 0; bc_names[i]; i++) fprintf(ctx->fp, "%-6s", bc_names[i]); 335 for (i = 0; bc_names[i]; i++) fprintf(ctx->fp, "%-6s", bc_names[i]);
328 fprintf(ctx->fp, "\",\n\n"); 336 fprintf(ctx->fp, "\",\n\n");
329 337
338#if LJ_HASJIT
330 fprintf(ctx->fp, "irnames = \""); 339 fprintf(ctx->fp, "irnames = \"");
331 for (i = 0; ir_names[i]; i++) fprintf(ctx->fp, "%-6s", ir_names[i]); 340 for (i = 0; ir_names[i]; i++) fprintf(ctx->fp, "%-6s", ir_names[i]);
332 fprintf(ctx->fp, "\",\n\n"); 341 fprintf(ctx->fp, "\",\n\n");
@@ -355,6 +364,7 @@ static void emit_vmdef(BuildCtx *ctx)
355 for (i = 0; trace_errors[i]; i++) 364 for (i = 0; trace_errors[i]; i++)
356 fprintf(ctx->fp, "\"%s\",\n", trace_errors[i]); 365 fprintf(ctx->fp, "\"%s\",\n", trace_errors[i]);
357 fprintf(ctx->fp, "},\n\n"); 366 fprintf(ctx->fp, "},\n\n");
367#endif
358} 368}
359 369
360/* -- Argument parsing ---------------------------------------------------- */ 370/* -- Argument parsing ---------------------------------------------------- */
diff --git a/src/host/buildvm_fold.c b/src/host/buildvm_fold.c
index 7f9ac058..edb55768 100644
--- a/src/host/buildvm_fold.c
+++ b/src/host/buildvm_fold.c
@@ -5,6 +5,7 @@
5 5
6#include "buildvm.h" 6#include "buildvm.h"
7#include "lj_obj.h" 7#include "lj_obj.h"
8#if LJ_HASJIT
8#include "lj_ir.h" 9#include "lj_ir.h"
9 10
10/* Context for the folding hash table generator. */ 11/* Context for the folding hash table generator. */
@@ -226,4 +227,10 @@ void emit_fold(BuildCtx *ctx)
226 227
227 makehash(ctx); 228 makehash(ctx);
228} 229}
230#else
231void emit_fold(BuildCtx *ctx)
232{
233 UNUSED(ctx);
234}
235#endif
229 236