native boot

This commit is contained in:
2026-02-22 20:47:26 -06:00
parent 7ac5ac63d2
commit 4edc4b7cc5
19 changed files with 59808 additions and 22461 deletions

View File

@@ -681,10 +681,15 @@ ${sw("w", "%fp", "%dest", "%r")}
ret %fp
}`
// get_intrinsic(ctx, fp, dest, lit_idx)
h[] = `export function l $__get_intrinsic_ss(l %ctx, l %fp, l %dest, l %lit_idx) ${lb}
// access_env(ctx, fp, dest, lit_idx) — read env from frame->function->env_record
h[] = `export function l $__access_env_ss(l %ctx, l %fp, l %dest, l %lit_idx) ${lb}
@entry
%r =l call $cell_rt_get_intrinsic_lit(l %ctx, l %lit_idx)
%fn_p =l sub %fp, 24
%fn =l loadl %fn_p
%fn_ptr =l and %fn, -8
%env_p =l add %fn_ptr, 32
%env =l loadl %env_p
%r =l call $cell_rt_access_env(l %ctx, l %env, l %lit_idx)
${alloc_tail("%r")}
}`
@@ -1479,7 +1484,7 @@ var qbe_emit = function(ir, qbe, export_name) {
} else if (is_object(a2)) {
if (a2.make == "intrinsic") {
sl = intern_str(a2.name)
emit(` %fp =l call $__get_intrinsic_ss(l %ctx, l %fp, l ${text(a1)}, l ${text(sl.idx)})`)
emit(` %fp =l call $__access_env_ss(l %ctx, l %fp, l ${text(a1)}, l ${text(sl.idx)})`)
emit_exc_check()
} else if (a2.kind == "number") {
if (a2.number != null && is_integer(a2.number)) {