Skip to content

Admit implicit arguments object calls#3035

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-75-arguments-call
Jun 2, 2026
Merged

Admit implicit arguments object calls#3035
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-75-arguments-call

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit implicit real arguments object call targets into production unified bytecode routing
  • resolve real arguments checks by identifier/slot ownership instead of packed flag aliases
  • update the expansion contract and add route-hit coverage for implicit arguments call and assignment

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.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'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProduction'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~ActivationSemanticsProofPackTests'
  • rtk dotnet build Asynkron.JsEngine.sln -c Release
  • rtk rg 'EvaluateExpression(|ProfileEvaluateExpression(' src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner*
  • rtk git diff --check
  • rtk ./tools/profile forloop --memory

Copilot AI review requested due to automatic review settings June 2, 2026 00:10
@rogeralsing rogeralsing merged commit 98e30ef into main Jun 2, 2026
1 check passed
@rogeralsing rogeralsing deleted the codex/unified-bytecode-loop-75-arguments-call branch June 2, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants