zig-js

VM quickening inventory

On this page 4

This page is the architecture boundary for issue #659 under the fast no-JIT roadmap #498. It inventories existing guarded shortcuts; it publishes no performance claim and does not count tree-walker or ordinary-bytecode fallback as quickening coverage.

The complete machine contract—including every guard, miss/dequickening rule, metadata lifetime, no-GIL synchronization ruling, debugger/step boundary, source anchor, and test anchor—is vm-quickening-inventory-v1.json.

Classification boundary

classificationmeaningcurrent families
general_adaptiveSite/opcode behavior selected from runtime identity, shape, or representation guards rather than a whole benchmark-shaped body.6
bounded_structuralA bounded expression/trace decoder with explicit accepted operations and size limits.2
legacy_narrowAn exact bytecode-pattern kernel. It is useful implementation history, not broad dispatch-family coverage.9

Implemented guarded families

familyclassificationsurfacemiss/dequickening boundary
property-inline-cachegeneral_adaptiveget_prop own-data reads; set_prop existing own-data writes; one-hop inherited observationsperform the complete property operation; record only a valid shape-slot observation; replace secondary shapes round-robin after four identities
quick-global-bindinggeneral_adaptiveload_var in an isolated VM executionrun lookupIdent/globalProp; replace the site cache only after complete resolution; decline caching for with and aliases
literal-shape-transitiongeneral_adaptivefixed-name init_prop CreateDataPropertyOrThrow transitionsrun defineLiteralDataProp; record only the resulting direct child transition; computed/spread/accessor literal members stay generic
property-update-tracebounded_structuralup to twenty bytecodes and eight numeric operations ending in set_prop; optional canonical counted-loop tailresume ordinary bytecode at the same load_local; cache an unsupported sentinel only in isolated execution; a tail mismatch keeps the assignment-only trace
four-property-looplegacy_narrowone exact 38-bytecode numeric loop over four named propertiesreturn to the ordinary bytecode loop head without mutation; cache an explicit unsupported plan for nonmatching bytecode
array-opcode-fast-pathsgeneral_adaptivepresent dense get_index; existing dense set_index; Array length read; Array.prototype data read; intrinsic Array.prototype.push callrun ToPropertyKey and generic property/index semantics; dispatch the ordinary callable; never treat a hole or inherited indexed property as dense data
packed-array-sum-looplegacy_narrowone exact eighteen-bytecode counted loop summing dense numeric elementsresume at the ordinary loop head; unsupported structural plans remain explicit
packed-array-push-looplegacy_narrowone exact counted loop pushing a bounded numeric expression; one add-three-and-bitmask expression specializationresume ordinary bytecode at the loop head; generic bounded expression evaluation remains distinct from the add3_bit_and specialization
polymorphic-property-looplegacy_narrowone exact indexed-selector loop reading and writing named own data propertiesresume ordinary loop bytecode before any fused mutation; nonmatching bytecode uses the explicit unsupported array plan
fixed-shape-object-allocation-looplegacy_narrowone exact selector/replacement loop allocating a three-property literalreturn to the loop head before fused mutation; fall back after materializing state at GC/checkpoint boundaries; invalidate prepared shape state when the realm root Shape differs
numeric-leaf-callbounded_structuralstraight-line numeric bytecode leaves; non-arrow static arguments[index] numeric expressions; captured scalar and receiver-property variantsperform the ordinary JS call; cache unsupported bytecode leaves explicitly; AST arguments leaves are revalidated for each exact call arity
numeric-call-looplegacy_narrowexact counted loops calling a direct, method, closure-template, or arguments numeric leafresume ordinary bytecode at the loop head; publish an explicit unsupported call-loop plan
reusable-immediate-closurelegacy_narrowcheckpoint-spanning fallback iterations of the exact closure-template numeric call loopallocate a fresh closure through makeClosure; never reuse when identity could escape or be observed
numeric-recurrencelegacy_narrowone exact pure two-branch additive self-recurrence bytecode bodyperform the ordinary recursive JS call; cache an explicit unsupported recurrence plan
observable-numeric-recurrencelegacy_narrowone exact additive self-recurrence with an observable counter property updateperform ordinary recursive calls/property operations; unsupported shapes use the explicit recurrence-plan tag
binary-arithmetic-sitegeneral_adaptiveadd/subtract/multiply/divide/remainder/power; relational and equality comparisons; bitwise operations and shiftsrecord both changed operand kinds; atomically publish terminal generic state; execute the canonical operation exactly once without replaying coercion or exceptions
native-direct-callgeneral_adaptiveordinary call of a ready baseline/optimizing numeric leaf without heap activation constructionbuild/run the ordinary VM activation or generic call; a managed native miss/deoptimization never becomes a completed direct call

Every legacy pattern above remains labeled legacy_narrow; none is used as evidence that its broader property, index, call, arithmetic, control, or allocation family is covered.

Explicitly unsupported broad families

familyremaining general workexact fallback
property-dispatchgeneral megamorphic named access; arbitrary prototype depth; accessor/proxy/exotic get and set; general compound/update operationsordinary get_prop/set_prop bytecode and the full interpreter property algorithms
index-dispatchsparse and holey arrays; prototype-indexed properties; typed arrays and arguments objects; dynamic ToPropertyKey and proxy/accessor casesordinary get_index/set_index bytecode with full ToPropertyKey and property semantics
call-dispatchgeneral JS call and construct specialization; variadic/spread calls; async/generator calls; polymorphic call-site linking across arbitrary calleesordinary activation/trampoline, callValue, invokeMethod, or construct dispatch
control-dispatchgeneral superinstructions; adaptive branch/control-flow fusion; exception/finally-aware trace formation; debugger-safe dequickening at every statement boundaryordinary branch, completion, handler, and checkpoint bytecodes
allocation-dispatchgeneral object/array/closure allocation specialization; arbitrary literal layouts; escape analysis and scalar replacement; general GC-safe allocation sinkingordinary new_object/new_array/make_closure/literal bytecodes and allocator/GC paths

Drift gate

The validator binds this inventory to 6 plan types, 14 tagged quickening types, 8 chunk metadata fields, 2 structural-candidate flags, and 33 test observability counters. Missing or duplicate identities, missing source/test anchors, unknown status values, and any legacy kernel relabeled as general all fail closed.