phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0

This commit is contained in:
nyash-codex
2025-11-06 15:41:52 +09:00
parent 2dc370223d
commit 77d4fd72b3
1658 changed files with 6288 additions and 2612 deletions

View File

@ -0,0 +1,30 @@
// Map.get with both receiver and key as function parameters
// Expect: JIT hostcall allow for nyash.map.get_hh (Handle,Handle)
// Run:
// NYASH_JIT_EXEC=1 NYASH_JIT_THRESHOLD=1 NYASH_JIT_HOSTCALL=1 NYASH_JIT_EVENTS=1 \
// ./target/release/nyash --backend vm examples/jit_map_get_param_hh.hako
box Helper {
birth() {
// no-op constructor
}
getv(m, k) {
return m.get(k)
}
}
static box Main {
main() {
local m, k, v
m = new MapBox()
k = "key1"
v = "value1"
// Mutating ops fall back to VM by policy (read-only JIT)
m.set(k, v)
// Use user-defined box Helper so that getv is lowered into a MIR function
local h
h = new Helper()
// Both m and k are parameters of Helper.getv/2 → JIT can use HH path
return h.getv(m, k)
}
}