Admit captured arrow reads to production bytecode - #3038
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR widens “production unified bytecode” routing to admit additional safe arrow-function and property-read shapes that rely on read-only dynamic identifier lookups (ordinary environment reads), and updates the proof-pack/contract documentation and tests accordingly.
Changes:
- Allow first-boundary named property-read chains whose base is an admitted dynamic identifier read (when ordinary dynamic reads are enabled).
- Extend arrow-function production fast-path gating to allow read-only ordinary environment identifier reads (and related named property reads) as VM-owned dependencies.
- Update and add tests + contract text to reflect the expanded eligibility surface.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Updates arrow invocation test to assert the production unified bytecode fast-path for captured outer environment reads. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Adds eligibility coverage for named property reads with a dynamic-identifier base when dynamic reads are admitted. |
| tests/Asynkron.JsEngine.Tests/ExpressionProgramCoverageMapTests.cs | Adjusts proof-pack inventory linkage to reference an appropriate “no unified route” control test after arrow admission changes. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Expands first-boundary named property-read candidate detection to include admitted dynamic identifier base reads; updates decline reasoning text. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Compiles first-boundary named property-read chains using a loader that can emit LoadDynamicIdentifier for admitted dynamic bases. |
| src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs | Broadens arrow fast-path gating and activation descriptor flags so admitted arrow shapes can opt into ordinary dynamic identifier environment operations. |
| docs/unified-bytecode-expansion-contract.md | Updates the expansion contract ledger and arrow pre-gate narrative to reflect the widened admitted dependency set. |
💡 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
Verification
UnifiedBytecodeProductionEligibilityTests.Evaluate_NamedPropertyReadWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ArrowFunction_CapturedOuterEnvironmentRead_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ArrowFunction_LexicalThis_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ArrowFunction_LexicalNewTarget_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.SimpleArrowFunction_UsesUnifiedBytecodeProductionFastPath'