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

9313 B162 linesdepth 8pulls 24 transitivereach 0 importersview sourcekind gate/prooftopic js
docsdependenciesstructsconstsfunctions

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

nx_js_vm.nx nx_js_consumer_swap_gate.nx

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

main cs_w swap_case cs_hlen js_vm_doc_bind js_vm_doc_enable js_vm_doc_bind ↻ cs_w ↻ cs_n vm_expect js_vm_doc_enable ↻ cs_hlen ↻ js_vm_doc_bind ↻ cs_w ↻ cs_contains cs_hlen ↻ cs_n ↻ cs_hlen ↻ js_vm_doc_bind ↻ sys_now_us sys_mmap sys_clock_gettime_mono js_vm_doc_enable ↻

structs

none

consts

none

functions

11func 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 }
12func cs_n(v: i64) -> i64
called by 2: swap_casemain
26func cs_hlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
28func swap_case(html: *u8, label: *u8, pp: *i64, tp: *i64) -> i64
59func cs_contains(buf: *u8, blen: i64, needle: *u8) -> i64
called by 1: vm_expect calls 1: cs_hlen
74func vm_expect(html: *u8, needle: *u8, label: *u8, pp: *i64, tp: *i64) -> i64
89func main(argc: i64, argv: *i64) -> i64