code wiki / _hdl_build / nx_js_vm.nx

nx_js_vm.nx

buildroot/runtime/_hdl_build/nx_js_vm.nx

214931 B4436 linesdepth 7pulls 23 transitivereach 59 importersview sourcekind librarytopic js
docsdependenciesstructsconstsfunctions

about

nx_js_compile.nx -- BYTECODE-VM rungs 2+3+4a+4b: the AST->BYTECODE COMPILER + a TAGGED-VALUE stack VM. rung2: walk nx_js_parse's AST once, emit bytecode (number/ident/assign/binary/var/while/if/block). rung3: the VM stack + vars carry the engine's 2-slot [tag,payload] value model (VAL_NUM/STR/BOOL/...). rung4a: logical short-circuit && || + unary ! - + typeof. rung4b (FUNCTIONS + OBJECTS -- the real-bundle rung): function decls/exprs/arrows compile to a FUNCTION TABLE + inline bodies (JMP over); calls run on CALL FRAMES; CLOSURES are arena-allocated env records chained by lexical parent (variables resolve at COMPILE time to depth+slot -- no name lookup at runtime); objects/arrays/member/index reuse the engine's obj_*/arr_*/ev_get_prop model; `this` rides an env-header binding (env-chain walk == the tree-walker's THIS_NS lookup); `new` allocates + binds this + keeps the object unless the ctor returns one; natives dispatch through js_native_apply (the value-based core split out of js_invoke_native); for/do-while/ternary/ break/continue/switch/for-of/for-in/??/compound-assign/destructuring/spread all compile. The VM has an ERROR CHANNEL (BC_ERROR + honest halts) so rc parity with js_run_source is gated. NAMED OPENS (rung-4c/5): template ${} interpolation (no-interp templates work) -- BC_ERROR; VM closures passed to callback natives (forEach/map/setTimeout/then) need the rung-5 VM re-entry (js_call_core expects tree closures; VM closure records carry VMF_MAGIC so the wire can detect); per-iteration for-of capture + for-scope vars are FUNCTION-scoped here (real-JS var semantics; the tree-walker gives for-loops their own child env -- divergence only for post-loop var reads). license_tier: ORIGINAL

dependencies 3 imports · 59 importers

nx_x86emit.nx nx_itoa_lib.nx nx_js_eval.nx nx_js_vm.nx nx_js_arena_gate.nx nx_js_arena_probe.nx nx_js_autoglobal_hoist_gate.nx nx_js_binopfuse_gate.nx nx_js_callapply_gate.nx nx_js_callcost_probe.nx nx_js_compile.nx nx_js_consumer_swap_gate.nx nx_js_earley_diag.nx nx_js_error_gate.nx

diagram shows first 10 each side; +0 more imports, +49 more importers in the complete lists below.

imports: nx_x86emit.nxnx_itoa_lib.nxnx_js_eval.nx

imported by: nx_js_arena_gate.nxnx_js_arena_probe.nxnx_js_autoglobal_hoist_gate.nxnx_js_binopfuse_gate.nxnx_js_callapply_gate.nxnx_js_callcost_probe.nxnx_js_compile.nxnx_js_consumer_swap_gate.nxnx_js_earley_diag.nxnx_js_error_gate.nxnx_js_evalorder_gate.nxnx_js_f64lit_probe.nxnx_js_feedback_gate.nxnx_js_floatfuse_probe.nxnx_js_fnprop_diag.nxnx_js_gc_gate.nxnx_js_h2h_bench.nxnx_js_h2h_probe.nxnx_js_indel_gate.nxnx_js_instanceof_gate.nxnx_js_jit_gate.nxnx_js_jit_keystone.nxnx_js_jitgc_gate.nxnx_js_missingarg_gate.nxnx_js_navier_diag.nxnx_js_objchurn_probe.nxnx_js_objproto_gate.nxnx_js_octane_crypto.nxnx_js_octane_deltablue.nxnx_js_octane_earley.nxnx_js_octane_memcensus.nxnx_js_octane_navier.nxnx_js_octane_next_run.nxnx_js_octane_raytrace.nxnx_js_octane_regexp.nxnx_js_octane_regexp_ck.nxnx_js_octane_richards.nxnx_js_octane_splay.nxnx_js_or_diag.nxnx_js_poly_ic_gate.nxnx_js_probes_nojit.nxnx_js_probes_run.nxnx_js_probes_vm.nxnx_js_proto_gate.nxnx_js_proto_probe.nxnx_js_proto_vm_gate.nxnx_js_random_probe.nxnx_js_realbench.nxnx_js_regalloc_probe.nxnx_js_regex_features_gate.nxnx_js_rich_diag.nxnx_js_rt_memprobe.nxnx_js_safepoint_cost.nxnx_js_semantics_gate.nxnx_js_shape_gate.nxnx_js_sota_bench.nxnx_js_splay_diag.nxnx_js_strcoerce_gate.nxnx_js_update_gate.nx

structs

none

consts

23const BC_MAGIC_262144: i64 = 262144
24const BC_MAGIC_65536: i64 = 65536
25const BC_MAGIC_1000000: i64 = 1000000
26const BC_MAGIC_3000: i64 = 3000
27const BC_MAGIC_2147483647: i64 = 2147483647
28const BC_MAGIC_2147483648: i64 = 2147483648
29const BC_MAGIC_1099511627776: i64 = 1099511627776
30const BC_MAGIC_1000000007: i64 = 1000000007
31const BC_MAGIC_1234567891234567: i64 = 1234567891234567
32const BC_MAGIC_4000: i64 = 4000
45const BC_PUSH: i64 = 1 // push [VAL_NUM, arg]
46const BC_PUSHK: i64 = 2 // push pool[arg] (typed constant: string/bool/null/float/globalns/native)
47const BC_LOAD: i64 = 3 // push CURRENT env slot arg
48const BC_STORE: i64 = 4 // current env slot arg = pop
49const BC_POP: i64 = 5
50const BC_JMPF: i64 = 6 // if !truthy(pop) pc=arg else +2
51const BC_JMP: i64 = 7
52const BC_RET: i64 = 8 // program end: out = top, halt rc 0
53const BC_BINOP: i64 = 9 // arg = OP_*; b=pop a=pop push vm_binary(op,a,b)
54const BC_DUP: i64 = 10 // duplicate top value
55const BC_JMPT: i64 = 11 // if truthy(pop) pc=arg else +2 (for || short-circuit)
56const BC_UNOP: i64 = 12 // arg = OP_NOT/OP_NEG/OP_POS/OP_TYPEOF; push unary(op, pop)
58const BC_PUSHU: i64 = 13 // push undefined
59const BC_LOADU: i64 = 14 // arg = depth*VM_UPK+slot; walk parent chain, push
60const BC_STOREU: i64 = 15 // arg = depth*VM_UPK+slot; walk parent chain, store pop
61const BC_JMPNN: i64 = 16 // v=pop; if v is NOT null/undefined pc=arg else +2 (?? short-circuit)
62const BC_CLOSURE: i64 = 17 // arg = ftab idx; push VAL_FUNC closure [VMF_MAGIC, fidx, current env]
63const BC_CALL: i64 = 18 // arg = argc; stack [.. fn a0..]; VM fn -> frame push; native -> js_native_apply
64const BC_RETV: i64 = 19 // return from function: pop result, pop frame, restore, push result
65const BC_CALLM: i64 = 20 // arg = kidx*CM_PACK+argc; stack [.. recv a0..]; method resolve like js_eval_call
66const BC_GETPROP: i64 = 21 // arg = key pool idx; pop base, push base.key (mirrors js_eval_member)
67const BC_GETPROPQ:i64 = 22 // optional-chain variant: null/undefined base -> undefined
68const BC_SETPROP: i64 = 23 // arg = key pool idx; stack [base val] -> set; push val
69const BC_GETIDX: i64 = 24 // stack [base key] -> push base[key] (mirrors js_eval_index)
70const BC_SETIDX: i64 = 25 // stack [base key val] -> set; push val
71const BC_ARR: i64 = 26 // push a fresh empty VAL_ARRAY
72const BC_APUSH: i64 = 27 // stack [arr v] -> append v; keep arr
73const BC_SPREAD: i64 = 28 // stack [arr src] -> append all of src's elements (non-array: skip); keep arr
74const BC_OBJ: i64 = 29 // push a fresh empty VAL_OBJECT
75const BC_OPROP: i64 = 30 // arg = key pool idx; stack [obj v] -> obj[key]=v; keep obj
76const BC_THIS: i64 = 31 // push the nearest env-chain `this` binding (absent -> undefined)
77const BC_NEW: i64 = 32 // arg = argc; stack [.. ctor a0..]; native -> js_construct_native; VM fn -> new-frame
78const BC_ERROR: i64 = 33 // halt rc=1 (ReferenceError/unsupported-node parity with the tree-walker)
79const BC_KEYS: i64 = 34 // pop obj (MUST be VAL_OBJECT else halt) -> push array of its key strings
80const BC_ITERCHK: i64 = 35 // top MUST be VAL_ARRAY else halt (for-of parity with the tree-walker)
81const BC_SWAP: i64 = 36 // swap top two values
82const BC_ROT: i64 = 37 // [a b c] -> [b c a] (third-from-top moves to top)
83const BC_IDXSOFT: i64 = 38 // arg = int index; pop v; push v[arg] if array in-range else undefined (destructuring)
84const BC_PROPSOFT:i64 = 39 // arg = key pool idx; pop v; push v.key if object+present else undefined
85const BC_TRY: i64 = 40 // arg = catch-handler pc; push [catchpc, sp, env, fp] onto the handler stack
86const BC_TRYPOP: i64 = 41 // leave a try block normally: pop the top handler
87const BC_THROW: i64 = 42 // pop value; unwind to the nearest handler (push value at its entry) or halt rc=1
88const BC_CLASSMETHOD: i64 = 43 // arg=method-name key pool idx; stack [ctor method] -> obj_set(func_prototype(ctor), key, method); leave [ctor]
89const BC_DUP2: i64 = 44 // duplicate the top TWO values: [.. a b] -> [.. a b a b] (single-eval compound index assign)
90const BC_DELIDX: i64 = 45 // delete: [.. base keyval] -> [.. true]; obj_delete(base, ToString(key)) when base is an object
92const VM_UPK: i64 = 65536 // LOADU/STOREU packing: arg = depth*VM_UPK + slot
93const CM_PACK: i64 = 1024 // CALLM packing: arg = keypoolidx*CM_PACK + argc (argc < 1024; argbuf caps 256)
97const VMC_CODEI: i64 = 262144 // max instructions
98const VMC_POOLN: i64 = 32768 // max pool constants
99const VMC_MAXF: i64 = 2048 // max compiled functions
100const VMC_MAXSC: i64 = 128 // max lexical function-nesting depth (compile-time)
101const VMC_MAXV: i64 = 4096 // max vars per function scope
102const VMC_STACKN: i64 = 16384 // operand stack (values)
103const VMC_MAXFR: i64 = 8192 // max call depth
104const VMC_ARENA: i64 = 33554432 // 32MB env/closure arena (bump; envs never freed -- matches the tree-walker)
105const VMC_PATCH: i64 = 2048 // max pending break/continue patches
106const VMC_MAXCASE: i64 = 256 // max switch cases
107const VMC_MAXH: i64 = 1024 // max active try handlers (depth)
108const VMC_MAXFE: i64 = 128 // max compile-time nested try (finally-stack) depth
111const ENVR_HDR: i64 = 4
113const FR_ENT: i64 = 6 // [ret_pc, saved_env, base, newobj, arena_hp0, esc0] -- last 2 = escape-aware arena reclaim
115const FT_ENT: i64 = 4
181const VS_PC: i64 = 0
182const VS_SP: i64 = 1
183const VS_ENV: i64 = 2
184const VS_FP: i64 = 3
185const VS_HP: i64 = 4 // arena bump offset (bytes)
186const VS_RC: i64 = 5
187const VS_RUN: i64 = 6
188const VS_ARENA: i64 = 7 // arena base (i64)
189const VS_STACK: i64 = 8
190const VS_CODE: i64 = 9
191const VS_POOL: i64 = 10
192const VS_FTAB: i64 = 11
193const VS_CTX: i64 = 12
194const VS_GENV: i64 = 13
195const VS_FRAMES: i64 = 14
196const VS_ARGBUF: i64 = 15 // reusable 256-arg buffer for native calls (values COPIED out by natives)
197const VS_T1: i64 = 16 // scratch cell (thisv)
198const VS_T2: i64 = 17 // scratch cell (results)
199const VS_OUT: i64 = 18 // final result cell
200const VS_HSTK: i64 = 19 // handler stack ptr (HS_ENT per entry)
201const VS_HN: i64 = 20 // active handler count
202const VS_HFLOOR: i64 = 21 // handler floor: a NESTED (re-entry) run may not unwind past handlers below this
203const VS_SLB: i64 = 22 // pre-allocated scratch cell for vm_loop's left operand (sota-bench finding:
204const VS_SRB: i64 = 23 // mmap-per-vm_loop-entry cost 3 syscalls PER CALLBACK re-entry; cells are
205const VS_SOB: i64 = 24 // transient within one instruction, so outer/nested loops share safely)
206const VS_ICACHE: i64 = 25 // INLINE-CACHE array (P4): 2 i64 per instruction site, indexed by pc; shape-keyed.
207const VS_CBBASE: i64 = 26 // native code-buffer base (for resolving a callee's absolute native entry)
208const VS_FNADDR: i64 = 27 // ptr to fnaddr[fidx] = native OFFSET of that JIT'd function's entry (-1 = none)
209const VS_ENTRYSP: i64 = 28 // saved native RSP at blob entry -> a JIT error longjmps here (depth-independent unwind)
210const VS_POOLN: i64 = 29 // # const-pool entries (cc[CC_NP]) -> GC scans pool[0..POOLN*2] as a root (string literals)
211const VS_SZ: i64 = 32
212const HS_ENT: i64 = 4 // [catch pc, sp at BC_TRY, env, fp at BC_TRY]
285const POLY_WAYS: i64 = 4
1323const CC_CODE: i64 = 0
1324const CC_NP: i64 = 1
1325const CC_POOL: i64 = 2
1326const CC_PCNT: i64 = 3
1327const CC_FTAB: i64 = 4
1328const CC_FCNT: i64 = 5
1329const CC_SCT: i64 = 6 // scope table ptr: per scope [vtab ptr, count, parent idx]
1330const CC_SCUR: i64 = 7 // current scope index
1331const CC_CTX: i64 = 8
1332const CC_BRK: i64 = 9 // break patch list ptr
1333const CC_BRKN: i64 = 10
1334const CC_CON: i64 = 11 // continue patch list ptr
1335const CC_CONN: i64 = 12
1336const CC_BRKD: i64 = 13 // active break-target depth (loops + switches)
1337const CC_COND: i64 = 14 // active continue-target depth (loops)
1338const CC_TMPID: i64 = 15 // hidden-temp uniquifier
1339const CC_INFN: i64 = 16 // >0 = compiling inside a function body (return -> BC_RETV)
1340const CC_FINS: i64 = 17 // finally-stack ptr: one entry PER ACTIVE TRY being compiled (FE_ENT each)
1341const CC_FINN: i64 = 18 // active try count (compile-time nesting)
1342const CC_FINFLOOR: i64 = 19 // function-local floor into the finally stack (returns stop here)
1343const CC_ARGSLOT: i64 = 21 // `arguments` slot in the CURRENT function (-1 = unused); saved/restored per c_function
1344const CC_UNSUP: i64 = 20 // set when the compiler DECLINES a FEATURE it can't compile (template ${},
1347const CC_SZ: i64 = 24
1348const SC_ENT: i64 = 3
1349const VT_ENT: i64 = 3 // vtab entry [tok start, tok len, name-src ptr]; hidden temps: start=-1000000-id, len 0, src 0.
1352const FE_ENT: i64 = 3 // finally-stack entry: [finally BLOCK node (-1 none), brkd at entry, cond at entry]
3429const RA_REGBUDGET: i64 = 6 // max boxed values (locals + peak stack) that fit x86-64 GP regs (2 regs each, minus RSP+scratch)

functions

36func bw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
41func bn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 8: jchkjdecmainmainsb_kernelmain+2 calls 1: nxi_out
42func bsl(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 34: mainmainchk2chk2ctchk2+28
118func vm_unary(op: i64, v: *i64, out: *i64) -> i64
127func vm_binary(op: i64, lb: *i64, rb: *i64, out: *i64) -> i64
218func js_ic_ptr_mode(v: i64) -> i64 { jsic_ptr_mode = v; return 0 }
called by 2: schkstime
239func js_fb_enable(on: i64) -> i64
called by 1: main
249func js_fb_get(pc: i64) -> i64 { if fb_table == 0 { return 0 } if pc < 0 { return 0 } if pc >= fb_cap { return 0 } let t: *u8 = fb_table as *u8; return t[pc] & 0xff }
251func js_fb_count(cls: i64) -> i64
called by 1: main
260func fb_record_binop(pc: i64, lt: i64, rt: i64) -> i64
called by 1: vm_loop
278func js_jit_calls_off(v: i64) -> i64 { jit_calls_off = v; return 0 }
287func js_ic_poly_ways(v: i64) -> i64 { jsic_poly_ways = v; return 0 }
called by 2: ptpchk
288func ic_ways() -> i64 { if jsic_poly_ways <= 0 { return POLY_WAYS } if jsic_poly_ways > POLY_WAYS { return POLY_WAYS } return jsic_poly_ways }
291func ic_poly_get(ic: *i64, b: i64, ckey: i64) -> i64
called by 1: vm_ext calls 1: ic_ways
309func ic_poly_put(ic: *i64, b: i64, ckey: i64, off: i64) -> i64
called by 1: vm_ext calls 1: ic_ways
321func vmx_fatal(vs: *i64) -> i64 { vs[VS_RC] = 1; vs[VS_RUN] = 0; return 0 }
324func vmx_unwind(vs: *i64, tt: i64, tp: i64) -> i64
called by 2: vmx_haltvm_ext
345func vmx_halt(vs: *i64) -> i64
394func vmx_alloc(vs: *i64, bytes: i64) -> i64
402func vm_envwalk(env: *i64, depth: i64) -> *i64
called by 1: vm_ext
410func vmx_callfn(vs: *i64, rec: *i64, argc: i64, base: i64, thisflag: i64, ttag: i64, tpay: i64, newobj: i64) -> i64
479func vmx_call_apply(vs: *i64, rec: *i64, base: i64, argc: i64, mode: i64) -> i64
516func vmx_native(vs: *i64, bid: i64, base: i64, argc: i64, hasrecv: i64) -> i64
540func vm_ext(vs: *i64, op: i64, arg: i64) -> i64
1202func gc_set_dbg(v: i64) -> i64 { gc_dbg_on = v; return 0 }
1203func gc_dbg(s: *u8) -> i64 { if gc_dbg_on == 1 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); sys_write(1, "\n" as *u8, 1) } return 0 }
1208func gc_dbg_n(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: gc_collect_vm calls 1: nxi_out
1209func gc_collect_vm(vs: *i64) -> i64
1232func gc_safepoint(vs: *i64) -> i64 { if gc_poll() == 1 { gc_collect_vm(vs) } return 0 }
1233func vm_loop(vs: *i64, fpfloor: i64) -> i64
1277func vm_run(vs: *i64) -> i64 { return vm_loop(vs, 0 - 1) }
called by 1: cr_core calls 1: vm_loop
1284func vm_call_closure(vsaddr: i64, closaddr: i64, argbufaddr: i64, argc: i64, thisaddr: i64, outaddr: i64) -> i64
1354func c_emit(cc: *i64, op: i64, arg: i64) -> i64
1363func c_kconst(cc: *i64, tag: i64, pay: i64) -> i64
1373func c_keyidx(cc: *i64, keyrec: *i64) -> i64 { return c_kconst(cc, VAL_STR, keyrec as i64) }
1374func c_scope_push(cc: *i64) -> i64
1387func c_scope_pop(cc: *i64) -> i64
called by 1: c_function
1395func c_findslot(cc: *i64, si: i64, ns: i64, nl: i64) -> i64
1416func c_resolve(cc: *i64, ns: i64, nl: i64, rbox: *i64) -> i64
1429func c_newslot(cc: *i64, ns: i64, nl: i64) -> i64
1445func c_newtmp(cc: *i64) -> i64
1460func c_brkadd(cc: *i64, j: i64) -> i64 { let l: *i64 = (cc[CC_BRK]) as *i64; let n: i64 = cc[CC_BRKN]; if n < VMC_PATCH { l[n] = j; cc[CC_BRKN] = n + 1 } return 0 }
called by 1: c_stmt
1461func c_conadd(cc: *i64, j: i64) -> i64 { let l: *i64 = (cc[CC_CON]) as *i64; let n: i64 = cc[CC_CONN]; if n < VMC_PATCH { l[n] = j; cc[CC_CONN] = n + 1 } return 0 }
called by 1: c_stmt
1463func c_brkpatch(cc: *i64, from: i64, target: i64) -> i64
1472func c_conpatch(cc: *i64, from: i64, target: i64) -> i64
called by 2: c_stmtc_forx
1487func c_exit_trys(cc: *i64, mode: i64) -> i64
called by 1: c_stmt calls 2: c_emitc_stmt
1517func c_emitload(cc: *i64, depth: i64, slot: i64) -> i64
called by 3: c_identc_updatec_assign calls 1: c_emit
1523func c_emitstore(cc: *i64, depth: i64, slot: i64) -> i64
called by 3: c_exprc_updatec_assign calls 1: c_emit
1534func c_rootslot(cc: *i64, ns: i64, nl: i64, rbox: *i64) -> i64
called by 2: c_predeclc_assign calls 2: c_findslotjp_src
1558func c_args(cc: *i64, callnode: i64) -> i64
1571func c_tmpl_flush(cc: *i64, buf: *u8, bpb: *i64, stb: *i64) -> i64
called by 1: c_template calls 2: c_kconstc_emit
1582func c_tmpl_expr(cc: *i64, bytes: *u8, blen: i64) -> i64
1603func c_template(cc: *i64, node: i64) -> i64
1652func c_function(cc: *i64, fnode: i64) -> i64
1731func c_predecl(cc: *i64, node: i64) -> i64
1796func c_body(cc: *i64, blk: i64, hoistmode: i64) -> i64
1827func c_expr(cc: *i64, node: i64) -> i64
2037func c_ident_resolves(cc: *i64, node: i64) -> i64
2050func c_ident(cc: *i64, node: i64, unused: i64) -> i64
2077func c_update(cc: *i64, node: i64) -> i64
2160func c_assign(cc: *i64, node: i64) -> i64
2219func c_stmt(cc: *i64, node: i64) -> i64
2390func c_vardecl(cc: *i64, node: i64) -> i64
2442func c_forx(cc: *i64, node: i64, mode: i64) -> i64
2493func c_switch(cc: *i64, node: i64) -> i64
2543func c_program(cc: *i64, prog: i64) -> i64
2593func js_jit_disable(v: i64) -> i64 { jit_disabled = v; return 0 }
2595func jit_ran_get() -> i64 { return jit_ran }
called by 2: tckjmain
2601func jit_is_ct(op: i64) -> i64
2622func jit_templatable(op: i64) -> i64
called by 1: jit_compile calls 1: jit_is_ct
2650func jit_addr(cb: *u8, pb: *i64, reg: i64, disp: i64) -> i64
2658func jit_slow_binop(cb: *u8, pb: *i64, op: i64, bsite: *i64, bcnt: *i64) -> i64
2675func jit_float_operand(cb: *u8, pb: *i64, xmm: i64, tagdisp: i64, paydisp: i64, ssite: *i64, scnt: *i64) -> i64
2693func jit_binop(cb: *u8, pb: *i64, op: i64, bsite: *i64, bcnt: *i64) -> i64
2777func jit_binop_fusable(op: i64) -> i64
2798func jit_binop_const(cb: *u8, pb: *i64, op: i64, k: i64, bsite: *i64, bcnt: *i64) -> i64
2875func jit_jmpcond(cb: *u8, pb: *i64, jumpIfTrue: i64, fsite: *i64, ftgt: *i64, fcnt: *i64, targetInstr: i64) -> i64
2906func jit_ct(vs: *i64, op: i64, arg: i64, pc: i64, spbytes: i64) -> i64
calls 1: vm_ext
2915func jit_emit_ct(cb: *u8, pb: *i64, op: i64, arg: i64, pc: i64, bsite: *i64, bcnt: *i64) -> i64
2942func jit_call_prep(vs: *i64, argc: i64) -> i64
3009func jit_retv_prep(vs: *i64) -> i64
3031func jit_callm_prep(vs: *i64, packed: i64) -> i64
3195func jit_new_prep(vs: *i64, argc: i64) -> i64
3276func jit_emit_callseq(cb: *u8, pb: *i64, prepaddr: i64, arg: i64, pc: i64, bsite: *i64, bcnt: *i64) -> i64
3315func jit_emit_safepoint(cb: *u8, pb: *i64) -> i64
3336func jit_emit_retv(cb: *u8, pb: *i64) -> i64
3351func jit_getprop_inline(cb: *u8, pb: *i64, i: i64, arg: i64, bsite: *i64, bcnt: *i64) -> i64
3385func jit_setprop_inline(cb: *u8, pb: *i64, i: i64, arg: i64, bsite: *i64, bcnt: *i64) -> i64
3430func jit_intloop_eligible(code: *i64, np: i64) -> i64
3538func ra_reg(k: i64) -> i64
called by 1: jit_intloop_compile
3547func ra_ccdir(op: i64) -> i64
called by 1: jit_intloop_compile
3555func ra_ccinv(op: i64) -> i64
called by 1: jit_intloop_compile
3571func ra_ult(a: i64, b: i64) -> i64 { // unsigned a < b on raw i64 bits (no unsigned type needed)
called by 1: ra_magic
3581func ra_mulhi_u(a: i64, b: i64) -> i64 { // high 64 bits of the UNSIGNED 128-bit product (raw bits in/out)
called by 1: ra_mulhi_s
3595func ra_mulhi_s(a: i64, b: i64) -> i64 { // signed mulhi from unsigned: identity hi_s = hi_u - (a<0?b:0) - (b<0?a:0)
called by 1: ra_mod_emu calls 1: ra_mulhi_u
3601func ra_ashr1(x: i64) -> i64 { // arithmetic shift right 1 == floor(x/2) (div truncates -> fix odd negatives)
called by 1: ra_mod_emu
3608func ra_magic(ad: i64, out: *i64) -> i64
called by 1: ra_magic_verified calls 1: ra_ult
3644func ra_mod_emu(v: i64, ad: i64, M: i64, s: i64) -> i64
3654func ra_magic_verified(ad: i64, out: *i64) -> i64
3715func jit_intloop_compile(code: *i64, np: i64, vs: *i64) -> i64
3892func jit_compile(code: *i64, np: i64, pool: *i64, ftab: *i64, ftabn: i64, vs: *i64) -> i64
4128func js_jit_probe(src: *u8) -> i64
4160func js_regalloc_probe(src: *u8) -> i64
4195func cr_core(src: *u8, srclen: i64, out: *i64, readname: *u8, dochtml: i64, doclen: i64, decl: i64) -> i64
4312func compile_run(src: *u8, out: *i64) -> i64 { return cr_core(src, bsl(src), out, 0 as *u8, 0, 0, 0) }
called by 63: mainmainchk2dcheckchk2kern+57 calls 2: cr_corebsl
4314func js_vm_run_read(src: *u8, readname: *u8, out: *i64) -> i64 { return cr_core(src, bsl(src), out, readname, 0, 0, 0) }
called by 1: chk_read calls 2: cr_corebsl
4318func compile_run_doc(srcaddr: i64, srclen: i64, dochtml: i64, doclen: i64, outaddr: i64) -> i64
calls 1: cr_core
4323func js_vm_doc_enable() -> i64 { js_vm_doc_bind((&compile_run_doc) as i64); return 0 }
4327func cells_eq(a: *i64, b: *i64) -> i64
4376func chk(src: *u8, label: *u8, pp: *i64, tp: *i64) -> i64
called by 1: main calls 5: bslcompile_runbwcells_eqbn
4408func chk_read(src: *u8, name: *u8, label: *u8, pp: *i64, tp: *i64) -> i64
called by 1: main calls 5: bsljs_vm_run_readbwcells_eqbn