Admit captured property writes to production bytecode - #3041
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the unified bytecode “production” fast-path to admit additional first-boundary property-write shapes where the assignment base is a captured ordinary dynamic identifier (in the same spirit as the existing dynamic-base property-read admission). It threads dynamic-identifier admission through the production eligibility checks and the compiler helpers (without introducing mixed/fallback execution), and adds targeted tests plus contract documentation updates.
Changes:
- Extend production eligibility to treat first-boundary named/computed property writes as eligible when the base is an admitted ordinary dynamic identifier read.
- Update unified bytecode compilation helpers to emit
LoadDynamicIdentifierfor eligible simple operands in first-boundary property-set shapes (including computed-key spans). - Add eligibility and invocation tests covering captured property-write expressions for both arrow and ordinary closures, and update the unified bytecode expansion contract.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Adds invocation-level coverage that captured property-write expressions route through the unified-bytecode production fast-path. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Adds eligibility coverage asserting dynamic-identifier-base property writes are accepted when ordinary dynamic reads are admitted. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Widens first-boundary property-write candidacy to accept activation-resolved or admitted plain dynamic-identifier base reads. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Threads allowsDynamicIdentifiers through first-boundary property-set compilation and computed-key span support, enabling LoadDynamicIdentifier emission where eligible. |
| docs/unified-bytecode-expansion-contract.md | Updates the contract to describe the newly admitted captured dynamic-base property-write boundary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proof
Evaluate_NamedPropertyWriteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_ComputedPropertyWriteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameArrowFunction_CapturedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedComputedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedComputedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath"