Skip to content

Admit implicit arguments object updates - #3034

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

Admit implicit arguments object updates#3034
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-74-arguments-update

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • Admit bounded implicit arguments object updates such as arguments++ through production unified bytecode.
  • Reuse the existing dynamic identifier update opcode now that the production route materializes the arguments binding.
  • Make typeof arguments use the dynamic binding path when the bounded arguments-object lane is active, preserving correctness after arguments is reassigned.

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.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'
  • 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:51
@rogeralsing
rogeralsing merged commit eff6b1a into main Jun 1, 2026
1 check passed
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-74-arguments-update branch June 1, 2026 23:51

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 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 UpdateIdentifier operations on the implicit arguments binding when ordinary dynamic identifier environment operations are enabled.
  • Route typeof arguments through TypeOfDynamicIdentifier when 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);
}
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