code wiki / _hdl_build / nx_js_consumer_swap_gate.nx
nx_js_consumer_swap_gate.nx
buildroot/runtime/_hdl_build/nx_js_consumer_swap_gate.nx
about
nx_js_consumer_swap_gate.nx -- CONSUMER SWAP: route the renderer's page scripts through the VM/JIT
(compile_run_doc via the doc hook) instead of the tree-walker, with a tree-walker FALLBACK for features
the VM can't compile (template ${}). Proves (A) byte-IDENTICAL serialized DOM: rendering each page with
the hook OFF (tree-walker) vs ON (VM/JIT) must produce the exact same HTML -- a strong DOM-correctness
net covering innerHTML/createElement/appendChild/setAttribute/querySelector/textContent/setTimeout
hydration; (B) FALLBACK: a template-${} script (VM declines) still renders correctly via the tree-walker;
(C) SPEEDUP on a script-heavy page. This is the payoff wiring that makes real page scripts run on the fast
engine. expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_js_vm.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 11 | func cs_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 12 | func cs_n(v: i64) -> i64 |
| 26 | func cs_hlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 28 | func swap_case(html: *u8, label: *u8, pp: *i64, tp: *i64) -> i64 |
| 59 | func cs_contains(buf: *u8, blen: i64, needle: *u8) -> i64 |
| 74 | func vm_expect(html: *u8, needle: *u8, label: *u8, pp: *i64, tp: *i64) -> i64 |
| 89 | func main(argc: i64, argv: *i64) -> i64 |