compile optimization

This commit is contained in:
2026-02-10 16:37:11 -06:00
parent 3d71f4a363
commit d75ce916d7
18 changed files with 1528 additions and 113 deletions

View File

@@ -323,6 +323,7 @@ int cell_init(int argc, char **argv)
/* Default: run script through bootstrap pipeline */
int use_mcode = 0;
int emit_qbe = 0;
int arg_start = 1;
const char *shop_override = NULL;
const char *core_override = NULL;
@@ -332,6 +333,10 @@ int cell_init(int argc, char **argv)
if (strcmp(argv[arg_start], "--mcode") == 0) {
use_mcode = 1;
arg_start++;
} else if (strcmp(argv[arg_start], "--emit-qbe") == 0) {
use_mcode = 1; // QBE requires mcode pipeline
emit_qbe = 1;
arg_start++;
} else if (strcmp(argv[arg_start], "--shop") == 0) {
if (arg_start + 1 >= argc) {
printf("ERROR: --shop requires a path argument\n");
@@ -416,6 +421,7 @@ int cell_init(int argc, char **argv)
JS_SetPropertyStr(ctx, hidden_env, "shop_path",
shop_path ? JS_NewString(ctx, shop_path) : JS_NULL);
JS_SetPropertyStr(ctx, hidden_env, "use_mcode", JS_NewBool(ctx, use_mcode));
JS_SetPropertyStr(ctx, hidden_env, "emit_qbe", JS_NewBool(ctx, emit_qbe));
JS_SetPropertyStr(ctx, hidden_env, "actorsym", JS_DupValue(ctx, cli_rt->actor_sym_ref.val));
JS_SetPropertyStr(ctx, hidden_env, "json", js_json_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "nota", js_nota_use(ctx));