Admit implicit arguments object calls#3035
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands production unified-bytecode routing to admit implicit (real) arguments object call targets (and related argument-object interactions), using identifier/activation-slot ownership to distinguish the real implicit arguments binding from parameter/lexical bindings named arguments. It also updates the expansion contract and adds coverage to ensure the unified-bytecode fast path is actually hit for these cases.
Changes:
- Allow implicit
arguments()call targets to route through unified-bytecode production when ordinary dynamic identifier ops are permitted. - Refine “real arguments” detection to use identifier name + activation-slot resolution (vs packed flag aliases).
- Add eligibility + invocation tests and update docs for the expanded contract.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Adds route-hit tests for implicit arguments() call and arguments = … assignment. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Updates/extends eligibility tests for implicit-arguments call target and assignment acceptance under dynamic-identifier allowance. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Updates eligibility scanning/declines for implicit arguments call targets and slot-ownership-based arguments detection. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Adjusts compilation rules around arguments identifier operations, including implicit call target handling. |
| docs/unified-bytecode-expansion-contract.md | Updates documented decline/route contract to include implicit arguments calls/assignments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+95
to
107
| if (operation.Kind is | ||
| ExpressionOpKind.ResolveIdentifierReference or | ||
| ExpressionOpKind.StoreResolvedIdentifier or | ||
| ExpressionOpKind.StoreIdentifier or | ||
| ExpressionOpKind.DeleteIdentifier) | ||
| { | ||
| if (IsImplicitArgumentsIdentifier(operation, identifierConstants, activationSlots)) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
| continue; | ||
| } |
Comment on lines
109
to
123
| if (operation.Kind is not ( | ||
| ExpressionOpKind.LoadIdentifier or | ||
| ExpressionOpKind.LoadIdentifierCallTarget or | ||
| ExpressionOpKind.TypeOfIdentifier or | ||
| ExpressionOpKind.UpdateIdentifier)) | ||
| { | ||
| return false; | ||
| continue; | ||
| } | ||
|
|
||
| if (!IsImplicitArgumentsIdentifier(operation, identifierConstants, activationSlots)) | ||
| { | ||
| continue; | ||
| } | ||
|
|
||
| foundArgumentsRead = true; |
Comment on lines
834
to
851
| case ExpressionOpKind.LoadIdentifierCallTarget: | ||
| if (isCallTargetPreparationCandidate) | ||
| { | ||
| break; | ||
| } | ||
|
|
||
| if (operation.IsArguments) | ||
| { | ||
| declineCode = UnifiedBytecodeProductionDeclineCode.ArgumentsObjectDependency; | ||
| declineReason = | ||
| "arguments call targets are not eligible for production unified bytecode routing."; | ||
| return true; | ||
| if (!allowsDynamicIdentifiers) | ||
| { | ||
| declineCode = UnifiedBytecodeProductionDeclineCode.ArgumentsObjectDependency; | ||
| declineReason = | ||
| "arguments call targets are not eligible for production unified bytecode routing."; | ||
| return true; | ||
| } | ||
|
|
||
| break; | ||
| } |
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_CallImplicitArgumentsObject_AcceptsDynamicIdentifierCallTarget|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_AssignImplicitArgumentsObject_AcceptsActivationSlotWrite|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_UpdateImplicitArgumentsObject_AcceptsDynamicIdentifierUpdate|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_ArgumentsAccess_AcceptsImplicitArgumentsObjectRead|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.CallImplicitArgumentsObject_UsesUnifiedBytecodeProductionFastPathAndThrowsTypeError|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.AssignImplicitArgumentsObject_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.CallParameterNamedArguments_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.NonCallableIdentifierCall_PropagatesTypeErrorThroughUnifiedBytecodeProductionFastPath'