Admit typeof implicit arguments#3030
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends production unified-bytecode routing to allow the specific case of typeof arguments when it refers to the implicit arguments object, compiling it as a literal "object" while keeping other implicit arguments behaviors (access/update/call-target) declined.
Changes:
- Admit plans whose only implicit-
argumentsdependency istypeof argumentsby scanning for that bounded pattern. - Compile
typeof arguments(implicit, non-slot-resolved) as aLoadLiteral "object"in unified bytecode instead of declining compilation. - Update eligibility/invocation tests and the unified-bytecode expansion contract documentation to reflect the new admitted route.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Updates invocation test to expect production unified-bytecode fast-path logging for typeof arguments. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Updates eligibility test to accept typeof arguments and assert "object" is emitted as a literal constant. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Adds bounded plan scan for the “only typeof arguments” pattern and removes the prior typeof arguments decline in expression scanning. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Compiles implicit typeof arguments as a literal "object" when it cannot be resolved to an activation slot. |
| src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs | Adds an activation-descriptor gate to bypass ArgumentsObjectDependency for the bounded typeof arguments case. |
| docs/unified-bytecode-expansion-contract.md | Documents the new behavior for ArgumentsObjectDependency/pre-gate:usesArguments regarding implicit typeof arguments. |
💡 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_TypeOfImplicitArgumentsObject_AcceptsLiteralObjectType|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_ArgumentsAccess_DeclinesWithArgumentsDependency|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.TypeOfImplicitArgumentsObject_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.TypeOfParameterNamedArguments_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ParameterNamedArguments_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameExpressionProgramCoverageMapTests.UnifiedBytecodeExpansionContract_ListsRequiredHeadingsAndCurrentEnums'UnifiedBytecodeProductionEligibilityTests|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests|FullyQualifiedNameUnifiedBytecodeProductionSpreadCallTests|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests|FullyQualifiedNameExpressionProgramLoweringTests|FullyQualifiedNameExpressionProgramCoverageMapTests|FullyQualifiedName~AstFreeExecutionAssertionTests'