|
@@ -18,8 +18,10 @@
|
|
|
#include "lj_obj.h"
|
|
|
#include "lj_gc.h"
|
|
|
#include "lj_bc.h"
|
|
|
+#if LJ_HASJIT
|
|
|
#include "lj_ir.h"
|
|
|
#include "lj_ircall.h"
|
|
|
+#endif
|
|
|
#include "lj_frame.h"
|
|
|
#include "lj_dispatch.h"
|
|
|
#if LJ_HASFFI
|
|
@@ -250,6 +252,7 @@ BCDEF(BCNAME)
|
|
|
NULL
|
|
|
};
|
|
|
|
|
|
+#if LJ_HASJIT
|
|
|
const char *const ir_names[] = {
|
|
|
#define IRNAME(name, m, m1, m2) #name,
|
|
|
IRDEF(IRNAME)
|
|
@@ -290,7 +293,9 @@ static const char *const trace_errors[] = {
|
|
|
#include "lj_traceerr.h"
|
|
|
NULL
|
|
|
};
|
|
|
+#endif
|
|
|
|
|
|
+#if LJ_HASJIT
|
|
|
static const char *lower(char *buf, const char *s)
|
|
|
{
|
|
|
char *p = buf;
|
|
@@ -301,6 +306,7 @@ static const char *lower(char *buf, const char *s)
|
|
|
*p = '\0';
|
|
|
return buf;
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
/* Emit C source code for bytecode-related definitions. */
|
|
|
static void emit_bcdef(BuildCtx *ctx)
|
|
@@ -318,7 +324,9 @@ static void emit_bcdef(BuildCtx *ctx)
|
|
|
/* Emit VM definitions as Lua code for debug modules. */
|
|
|
static void emit_vmdef(BuildCtx *ctx)
|
|
|
{
|
|
|
+#if LJ_HASJIT
|
|
|
char buf[80];
|
|
|
+#endif
|
|
|
int i;
|
|
|
fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n");
|
|
|
fprintf(ctx->fp, "return {\n\n");
|
|
@@ -327,6 +335,7 @@ static void emit_vmdef(BuildCtx *ctx)
|
|
|
for (i = 0; bc_names[i]; i++) fprintf(ctx->fp, "%-6s", bc_names[i]);
|
|
|
fprintf(ctx->fp, "\",\n\n");
|
|
|
|
|
|
+#if LJ_HASJIT
|
|
|
fprintf(ctx->fp, "irnames = \"");
|
|
|
for (i = 0; ir_names[i]; i++) fprintf(ctx->fp, "%-6s", ir_names[i]);
|
|
|
fprintf(ctx->fp, "\",\n\n");
|
|
@@ -355,6 +364,7 @@ static void emit_vmdef(BuildCtx *ctx)
|
|
|
for (i = 0; trace_errors[i]; i++)
|
|
|
fprintf(ctx->fp, "\"%s\",\n", trace_errors[i]);
|
|
|
fprintf(ctx->fp, "},\n\n");
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
/* -- Argument parsing ---------------------------------------------------- */
|