Admit captured computed reads to production bytecode - #3040
Merged
rogeralsing merged 1 commit intoJun 2, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR widens the production unified-bytecode “first boundary” property-read support so captured computed reads (e.g., obj[key]) can use the same production bytecode fast path already available for certain captured named reads, specifically when ordinary dynamic identifier reads are already admitted.
Changes:
- Extend eligibility/compilation logic to treat plain dynamic-identifier reads as valid first-boundary bases for computed property reads when dynamic identifier operations are allowed.
- Add invocation tests proving the unified-bytecode production fast path is hit for captured computed property reads in both arrow functions and ordinary closures.
- Update the unified-bytecode expansion contract documentation to reflect captured computed-read coverage.
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 route-hit coverage asserting the production fast path is used for captured obj[key] reads in arrow and function-expression closures. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Adds an eligibility test ensuring computed reads with a dynamic identifier base are accepted when ordinary dynamic reads are admitted. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Broadens first-boundary computed-read base eligibility to include plain dynamic identifier reads when dynamic identifier ops are allowed. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Emits LoadDynamicIdentifier for first-boundary computed-read bases that are not activation-resolvable when dynamic identifiers are allowed. |
| docs/unified-bytecode-expansion-contract.md | Updates the contract text to explicitly include captured computed property reads in the admitted routes. |
💡 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_ComputedPropertyReadWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameArrowFunction_CapturedComputedPropertyRead_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~FunctionExpression_CapturedComputedPropertyRead_UsesUnifiedBytecodeProductionFastPath"