Parent: #746 Parents of parent: #465, #498 Predecessor: #747
Problem
#747 moved complete base-class instance initialization into constructor bytecode, leaving the causal plain_policy_class_constructor_semantics boundary only on derived constructors. The VM already checks uninitialized this for super-property operations, but an ordinary activation does not yet own the derived this cell, super() construction/binding transition, post-super brands/fields, or derived completion rules.
Scope
- Represent each derived constructor activation with an initially unbound
thiscell shared by lexical arrows, plus exact save/restore through nested/tail calls, throws/finally, recursion, debugger/stack frames, and OOM. - Lower
super(...args)canonically: capture the current superclass before argument effects; evaluate arguments left-to-right; validate/construct with the most-derivednew.target; reject repeated calls only after superclass side effects; bind the returned object once; then install private brands and run compiled instance elements in source order. - Direct-forward synthesized default constructors without consulting an observable spread iterator.
- Enforce derived completion: an explicit object return wins without
super(); a non-undefinedprimitive return throws;undefined/fallthrough reads the boundthisand throws when it remains uninitialized. - Preserve
this,superproperties,new.target, direct-eval and field-initializer restrictions, lexical arrows (including an arrow invokingsuper()across an intervening call), current constructor prototype mutation rules, moving GC, and shared no-GIL execution. - Remove
plain_policy_class_constructor_semanticsonly when the entire derived constructor activation lowers; every unsupported nested syntax remains causally fail-closed.
No-workaround rules
- No eager placeholder binding, tree-walker/AST callback from constructor bytecode, source rewriting, duplicated/skipped brands or fields, post-argument superclass lookup, observable default-constructor spread, constructor-shape whitelist, permissive policy default, or hidden fallback in required mode.
- No stacks, queues, jobs, Promise, microtask, Worker lifecycle, or Map/Set iterator changes.
Acceptance
- Forced tree-walker and required bytecode agree on explicit/default derived construction,
extends null, dynamic superclass mutation, argument order, repeated/missingsuper(), object/undefined/primitive returns, and alternate superclass objects. - Public/private fields, auto-accessors, brands, computed names, parameter initialization,
this/super/new.target, direct eval, lexical arrows, exceptions/finally, recursion/reentry, and debugger/watchdog state preserve exact ordering. - Moving-GC/compaction, deterministic OOM restoration, native shared-chunk no-GIL, TSan, focused compiler/VM/frontend, full units, threadfuzz, and exact nonzero relevant Test262 accounting pass with zero regressions.
- Admission inventory compiles complete derived constructors, retains causal barriers for incomplete nested lowering, and introduces no interpreter callback or hidden fallback.
- A conventional commit lands directly on
mainand cross-links #465, #498, #746, and #747.