Skip to content

Commit 4fb2321

Browse files
authored
Admit captured compound property writes to bytecode (#3043)
1 parent 0efefb9 commit 4fb2321

5 files changed

Lines changed: 440 additions & 52 deletions

File tree

docs/unified-bytecode-expansion-contract.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ statement interpretation.
126126
- Simple-return arrows can route with captured lexical `this` / `new.target`
127127
values and read-only captured environment reads, including named and computed
128128
property reads from those dynamic identifier bases. Simple-return named and
129-
computed property writes, updates, and deletes to captured dynamic identifier
130-
bases are also VM-owned. The production invocation bridge resolves those
131-
captured values before entering the VM and avoids sloppy-call `this` coercion
132-
for arrows.
129+
computed property writes, compound/logical writes, updates, and deletes to
130+
captured dynamic identifier bases are also VM-owned. The production invocation
131+
bridge resolves those captured values before entering the VM and avoids
132+
sloppy-call `this` coercion for arrows.
133133
Arrows that need a lexical-this environment or super binding still decline.
134134
- Simple base class constructors with public or private instance fields and
135135
simple derived constructors with public or private instance fields can route through
@@ -335,7 +335,7 @@ must still obey the no-mixed-execution rule.
335335
| `CallDependency` | Direct eval outside the one-argument non-spread eval-identifier boundary, out-of-boundary call-target preparation, and complex call arguments excluding admitted simple/binary template-literal substitutions, simple/binary computed object keys, and zero-argument activation-resolved identifier-call computed object keys | Existing sync IR call route | Wider call invocation lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests"` |
336336
| `DynamicLookupDependency` | Unresolved identifier loads/stores/update outside the admitted ordinary, with-backed, and direct-eval-backed dynamic-name paths; plans that need direct eval plus post-eval dynamic identifier reads now route when captured activation, with-chain, and arguments-object dependencies are absent | Existing sync IR / environment lookup route | Dynamic-name lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_DirectEvalDeclaredVarRead_AcceptsOrdinaryDynamicNameProgram"` |
337337
| `PropertyReadBoundaryOutOfScope` | Named/computed property reads outside the admitted activation-resolved and read-only dynamic-identifier-base boundaries, including captured closure dynamic bases | Existing sync IR property route | Property read widening lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_ComputedPropertyReadOutsideFirstBoundary_DeclinesWithBoundaryCode"` |
338-
| `PropertyWriteDependency` | Property writes and compound/logical property writes outside the admitted direct property-write shapes, supported computed expression-key mutation shapes, simple-return dynamic-base named/computed property writes, simple nested named receiver assignment shape, nested named compound-write shape, and nested named logical-write shape | Existing sync IR property-write route | Property write widening lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_LogicalAndAssignment_UnsupportedShapes_DeclineWithExplicitCodes"` |
338+
| `PropertyWriteDependency` | Property writes and compound/logical property writes outside the admitted direct property-write shapes, supported computed expression-key mutation shapes, simple-return dynamic-base named/computed property writes and compound/logical writes, simple nested named receiver assignment shape, nested named compound-write shape, and nested named logical-write shape | Existing sync IR property-write route | Property write widening lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_LogicalAndAssignment_UnsupportedShapes_DeclineWithExplicitCodes"` |
339339
| `PropertyUpdateDependency` | Property and identifier update expressions outside the admitted direct update, computed expression-key update, simple-return dynamic-base named/computed property update, and simple nested named receiver update boundary | Existing sync IR update route | Property update lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_NestedNamedPropertyUpdate_AcceptsOwnedPropertyOpcodes"` |
340340
| `DeleteDependency` | `delete` expressions outside the admitted ordinary named/computed property delete lane, simple-return dynamic-base named/computed property delete lane, ordinary dynamic-key computed delete lane, and with-backed dynamic-name delete lane | Existing sync IR delete route | Delete semantics lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_NestedComputedPropertyDeleteDynamicKey_AcceptsOrdinaryDynamicNameOpcode"` |
341341
| `SuperPropertyDependency` | Out-of-boundary super call targets; super property reads/writes/updates are admitted by dedicated VM opcodes | Existing class / constructor route for remaining call-target shapes | Super semantics lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_SuperPropertyAccess_AcceptsOwnedOpcodes"` |
@@ -358,7 +358,7 @@ not always have a `UnifiedBytecodeProductionDeclineCode`.
358358
| Pre-gate key | Owning source / current example | Current fallback route | Planned batch / lane | Proof command |
359359
|---|---|---|---|---|
360360
| `pre-gate:IsClassConstructor` | Class constructor invokers outside the admitted simple base constructor route and explicit derived-constructor `super(...)` route with post-super `this` body reads/writes | Constructor route | Constructor boundary lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests"` |
361-
| `pre-gate:IsArrowFunction` | Arrow functions outside the admitted simple-return route whose lowered body proves no super, call-target, unadmitted identifier assignment/update/delete, compound/logical assignment, nested function/class literal, or other unowned dependency. Captured lexical `this` / `new.target`, statically resolved flat-slot reads, ordinary environment identifier reads, and named/computed property reads, simple property writes, property updates, or property deletes from those dynamic identifier bases are VM-owned; lexical-this environments remain a separate pre-gate. | Existing arrow invocation route | Arrow route lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests"` |
361+
| `pre-gate:IsArrowFunction` | Arrow functions outside the admitted simple-return route whose lowered body proves no super, call-target, unadmitted identifier assignment/update/delete, nested function/class literal, or other unowned dependency. Captured lexical `this` / `new.target`, statically resolved flat-slot reads, ordinary environment identifier reads, and named/computed property reads, simple property writes, compound/logical property writes, property updates, or property deletes from those dynamic identifier bases are VM-owned; lexical-this environments remain a separate pre-gate. | Existing arrow invocation route | Arrow route lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests"` |
362362
| `pre-gate:IsAsyncLike` | Async and formerly-async ordinary invokers | Async route | Resumable async/generator lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_AsyncLikeActivation_DeclinesBeforePlanInspection"` |
363363
| `pre-gate:IsGenerator` | Generator functions before ordinary sync production routing | Generator route | Resumable async/generator lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_GeneratorActivation_DeclinesBeforePlanInspection"` |
364364
| `pre-gate:hasParameterExpressions` | Default/rest/destructured parameter expressions | Existing parameter environment route | Parameter semantics lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests"` |
@@ -466,20 +466,20 @@ the final post-compile production subset check before VM entry.
466466
computed via `CoerceThisValueForNonStrict` in `TryInvokeProductionUnifiedBytecode`,
467467
so the VM's `LoadThis` opcode always receives the correctly coerced value.
468468
- Simple-return arrow functions whose lowered body has no super, call-target,
469-
unadmitted identifier assignment/update/delete, compound/logical assignment,
470-
nested function/class literal, or other unowned dependency may route.
469+
unadmitted identifier assignment/update/delete, nested function/class literal,
470+
or other unowned dependency may route.
471471
Captured lexical `this` / `new.target`, flat-slot reads, ordinary environment
472472
identifier reads, and named/computed property reads, simple property writes,
473-
property updates, or property deletes from those dynamic identifier bases are
474-
VM-owned.
473+
compound/logical property writes, property updates, or property deletes from
474+
those dynamic identifier bases are VM-owned.
475475
Dependency-bearing arrows still decline via the `IsArrowFunction`,
476476
captured-activation, or `_lexicalThisEnvironment is not null` pre-gates.
477477
- Simple-return ordinary function expressions that capture an outer activation
478478
may route when the body uses the same ordinary environment identifier,
479-
named/computed property read, simple property write, property update, or
480-
property delete subset. Captured identifier writes, identifier updates,
481-
identifier deletes, calls, `arguments`, eval, with-backed closures,
482-
super/private/home-object shapes, block-body mutations, and nested
479+
named/computed property read, simple property write, compound/logical property
480+
write, property update, or property delete subset. Captured identifier writes,
481+
identifier updates, identifier deletes, calls, `arguments`, eval, with-backed
482+
closures, super/private/home-object shapes, block-body mutations, and nested
483483
function/class literals remain outside this route.
484484
- There is no retained `this` decline in the production activation descriptor;
485485
future shapes that cannot thread `this` through the VM should introduce a

0 commit comments

Comments
 (0)