Admit implicit arguments object updates - #3034
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands production unified-bytecode routing to correctly handle implicit arguments identifier updates (e.g., arguments++) by reusing the existing dynamic-identifier update opcode, and ensures typeof arguments stays correct when arguments is reassigned under the bounded arguments-object lane.
Changes:
- Admit
UpdateIdentifieroperations on the implicitargumentsbinding when ordinary dynamic identifier environment operations are enabled. - Route
typeof argumentsthroughTypeOfDynamicIdentifierwhen the bounded arguments-object dynamic-identifier lane is active (otherwise keep the"object"literal fast-path). - Update eligibility/invocation tests and the unified-bytecode expansion contract documentation to reflect the new admitted shapes.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Updates invocation test to expect the unified-bytecode production fast path for arguments++ and verify runtime semantics after reassignment. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Updates eligibility tests to accept implicit arguments update via dynamic identifier ops and adjusts typeof arguments assertions. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Broadens the implicit-arguments dependency scan to include identifier updates and relaxes update-expression decline when dynamic identifiers are allowed. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Allows arguments updates to compile to UpdateDynamicIdentifier and conditionally routes typeof arguments via dynamic identifier lookup. |
| src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs | Switches to the renamed/expanded implicit-arguments dependency helper to gate the bounded arguments-object dynamic-identifier lane. |
| docs/unified-bytecode-expansion-contract.md | Updates the contract text to reflect that implicit arguments reads/updates are admitted and typeof arguments uses the bounded route. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3077
to
3080
| Assert.Contains( | ||
| result.Program.Instructions, | ||
| instruction => instruction.OpCode is UnifiedBytecodeOpCode.LoadLiteral or UnifiedBytecodeOpCode.TypeOfDynamicIdentifier); | ||
| } |
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_UpdateImplicitArgumentsObject_AcceptsDynamicIdentifierUpdate|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_ArgumentsAccess_AcceptsImplicitArgumentsObjectRead|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_TypeOfImplicitArgumentsObject_AcceptsObjectType|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_CallImplicitArgumentsObject_DeclinesWithArgumentsDependency|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.UpdateImplicitArgumentsObject_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ImplicitArgumentsObjectRead_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.TypeOfImplicitArgumentsObject_UsesUnifiedBytecodeProductionFastPath'UnifiedBytecodeProductionEligibilityTests|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests|FullyQualifiedNameUnifiedBytecodeProductionSpreadCallTests|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests|FullyQualifiedNameExpressionProgramLoweringTests|FullyQualifiedNameExpressionProgramCoverageMapTests|FullyQualifiedName~AstFreeExecutionAssertionTests'