code wiki / _hdl_build / nx_js_shape_gate.nx

nx_js_shape_gate.nx

buildroot/runtime/_hdl_build/nx_js_shape_gate.nx

7907 B167 linesdepth 8pulls 24 transitivereach 0 importersview sourcekind gate/prooftopic js
docsdependenciesstructsconstsfunctions

about

nx_js_shape_gate.nx -- P3 SHAPES / hidden classes: prove (A) shape-keyed ICs give IDENTICAL results to the legacy per-object ICs and the tree-walker, and (B) they MEASURABLY win where per-object ICs fail -- a loop over MANY distinct objects of the SAME shape. Per-object ICs miss on every object (different pointers) and fall back to the linear obj_find scan; shape ICs hit across all of them. The signature: reading a LATE property (index ~9) across many objects costs ~the same as reading an EARLY property under shapes (O(1)), but scales with scan depth under per-object ICs. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_js_vm.nx nx_js_shape_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 sg_w js_jit_disable schk bsl js_ic_ptr_mode compile_run cr_core jp_parse_source js_lex js_skip_trivia js_lex_one jp_parse_program jp_tok_kind jp_cur jp_err jp_parse_stmt jp_child_commit jp_new_node jp_pst ev_set c_scope_push c_program c_predecl jp_nkind jp_na jp_nb jp_child_at c_newslot ev_tok_start ev_tok_len c_predecl ↻ jp_nextra c_rootslot jp_nc ev_for_body ev_try_finally jp_nb ↻ jp_child_at ↻ jp_nkind ↻

structs

none

consts

none

functions

10func sg_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: schkmain
11func sg_n(v: i64) -> i64
called by 2: schkmain
26func schk(src: *u8, label: *u8, pp: *i64, tp: *i64) -> i64
69func stime(src: *u8, mode: i64, expp: i64, okbox: *i64) -> i64
90func main(argc: i64, argv: *i64) -> i64