Skip to content

Admit mixed with and ordinary dynamic names#3031

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-71-with-ordinary-dynamic
Jun 1, 2026
Merged

Admit mixed with and ordinary dynamic names#3031
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-71-with-ordinary-dynamic

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • Allow the ordinary dynamic-name production path to coexist with the existing with-backed dynamic-name path.
  • Route with-scope mutation plus outside global dynamic reads through production unified bytecode when direct eval, captured activation, and arguments-object dependencies are absent.
  • Update the expansion contract and convert fallback tests to route-hit coverage.

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_WithThenOutsideDynamicIdentifier_AcceptsMixedDynamicNameProgram|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_WithDynamicIdentifierOperations_AcceptsBoundedDynamicNameProgram|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_OrdinaryDynamicIdentifierOperations_AcceptsEnvironmentOpcodes|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.WithThenOutsideDynamicIdentifier_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.OrdinaryGlobalDynamicIdentifierOperations_UseUnifiedBytecodeProductionFastPath'
  • 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:26
@rogeralsing rogeralsing merged commit 69ade0c into main Jun 1, 2026
@rogeralsing rogeralsing deleted the codex/unified-bytecode-loop-71-with-ordinary-dynamic branch June 1, 2026 23:26

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 updates the production unified-bytecode routing rules to allow a single function to combine a with-backed dynamic-name segment with ordinary (non-with) dynamic identifier operations, enabling the unified-bytecode fast path for this mixed case when key blockers (direct eval, captured activation, arguments-object dependency) are absent.

Changes:

  • Allow the ordinary dynamic-name eligibility/fast-path gate to apply even when the function body contains a with statement.
  • Update eligibility and invocation tests to assert acceptance and fast-path routing for the mixed with + outside dynamic identifier scenario.
  • Update the unified-bytecode expansion contract documentation to reflect the new admitted mixed-lane behavior and updated test references.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Updates the mixed with + outside dynamic identifier test to expect unified-bytecode production fast-path routing (log hit).
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates eligibility expectations to accept the mixed dynamic-name program when ordinary dynamic identifier environment ops are allowed.
src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs Relaxes the ordinary dynamic-name fast-path gate to allow coexistence with with-statement bodies.
docs/unified-bytecode-expansion-contract.md Updates contract text and referenced test filters for the new admitted mixed dynamic-name routing.

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

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