Skip to content

Admit implicit arguments object reads#3033

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-73-arguments-read
Jun 1, 2026
Merged

Admit implicit arguments object reads#3033
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-73-arguments-read

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • Admit bounded implicit arguments object reads through production unified bytecode.
  • Compile implicit arguments loads as environment-backed dynamic identifier loads so the existing activation environment materializes the arguments object.
  • Extend the first-boundary computed read path for arguments[index] while keeping arguments update and call forms declined.

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_ArgumentsAccess_AcceptsImplicitArgumentsObjectRead|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_TypeOfImplicitArgumentsObject_AcceptsLiteralObjectType|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_UpdateImplicitArgumentsObject_DeclinesWithDynamicLookupDependency|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_CallImplicitArgumentsObject_DeclinesWithArgumentsDependency|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ImplicitArgumentsObjectRead_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.TypeOfImplicitArgumentsObject_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.UpdateImplicitArgumentsObject_DeclinesAndFallsBack'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests|FullyQualifiedNameUnifiedBytecodeProductionSpreadCallTests|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests|FullyQualifiedNameExpressionProgramLoweringTests|FullyQualifiedNameExpressionProgramCoverageMapTests|FullyQualifiedName~AstFreeExecutionAssertionTests'
  • rtk dotnet build src/Asynkron.JsEngine/Asynkron.JsEngine.csproj -c Release
  • rtk rg 'EvaluateExpression(|ProfileEvaluateExpression(' src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner*
  • rtk git diff --check

Copilot AI review requested due to automatic review settings June 1, 2026 23:43
@rogeralsing rogeralsing merged commit b019b95 into main Jun 1, 2026
@rogeralsing rogeralsing deleted the codex/unified-bytecode-loop-73-arguments-read branch June 1, 2026 23:43

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 read-only uses of the implicit arguments object (e.g., arguments[0]) by compiling those loads as environment-backed dynamic identifier reads, and by extending the first-boundary computed read candidate logic accordingly.

Changes:

  • Update unified-bytecode production eligibility to allow implicit arguments identifier reads when ordinary dynamic identifier environment operations are permitted.
  • Extend the computed property read “first boundary” compilation/eligibility path to treat implicit arguments reads as valid bases (compiled via LoadDynamicIdentifier).
  • Update tests and the expansion contract documentation to reflect that implicit arguments reads now take the unified-bytecode production fast path.

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 assert implicit arguments[0] uses the production fast path.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates eligibility test to accept implicit arguments read and assert dynamic identifier load is present.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Broadens eligibility scanning/candidate detection to permit implicit arguments reads under allowed dynamic identifier operations.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Allows compiling implicit arguments loads (as dynamic identifier loads) and wires this into first-boundary computed reads.
src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs Reworks activation gating to enable the new implicit arguments read path.
docs/unified-bytecode-expansion-contract.md Updates the eligibility/contract ledger to reflect the new admitted arguments read behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3940 to 3948
private bool CanUseProductionUnifiedBytecodeImplicitArgumentsObjectReadPath(ExecutionPlan plan)
{
return _usesArguments &&
_argumentsObjectNeeded &&
!_hasDirectEvalInBodyOrParameters &&
!_hasClosureWithObject &&
!_hasCapturedActivationInClosure &&
UnifiedBytecodeProductionEligibility.ContainsOnlyTypeOfImplicitArgumentsObjectDependency(plan);
UnifiedBytecodeProductionEligibility.ContainsOnlyImplicitArgumentsObjectReadDependency(plan);
}
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