Skip to content

Admit captured property writes to production bytecode - #3041

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-81-captured-write
Jun 2, 2026
Merged

Admit captured property writes to production bytecode#3041
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-81-captured-write

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit simple-return named and computed property writes from captured ordinary dynamic identifier bases
  • thread dynamic identifier admission through first-boundary property-set eligibility/compiler helpers without adding fallback execution
  • add eligibility and public route-hit coverage for captured arrow and ordinary closure property write expressions
  • update the unified bytecode expansion contract to describe the new captured property write boundary

Proof

  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedNameEvaluate_NamedPropertyWriteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_ComputedPropertyWriteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameArrowFunction_CapturedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedComputedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedComputedPropertyWriteExpression_UsesUnifiedBytecodeProductionFastPath"
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests"
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests"
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProduction"
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~ActivationSemanticsProofPackTests"
  • rtk dotnet build -c Release
  • rtk rg "EvaluateExpression\(|ProfileEvaluateExpression\(" src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner* (no matches)
  • rtk ./tools/profile forloop --memory (6.86 MB)
  • rtk git diff --check

Copilot AI review requested due to automatic review settings June 2, 2026 01:35
@rogeralsing
rogeralsing merged commit f7caa4a into main Jun 2, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-81-captured-write branch June 2, 2026 01:36

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 the unified bytecode “production” fast-path to admit additional first-boundary property-write shapes where the assignment base is a captured ordinary dynamic identifier (in the same spirit as the existing dynamic-base property-read admission). It threads dynamic-identifier admission through the production eligibility checks and the compiler helpers (without introducing mixed/fallback execution), and adds targeted tests plus contract documentation updates.

Changes:

  • Extend production eligibility to treat first-boundary named/computed property writes as eligible when the base is an admitted ordinary dynamic identifier read.
  • Update unified bytecode compilation helpers to emit LoadDynamicIdentifier for eligible simple operands in first-boundary property-set shapes (including computed-key spans).
  • Add eligibility and invocation tests covering captured property-write expressions for both arrow and ordinary closures, and update the unified bytecode expansion contract.

Reviewed changes

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

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Adds invocation-level coverage that captured property-write expressions route through the unified-bytecode production fast-path.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Adds eligibility coverage asserting dynamic-identifier-base property writes are accepted when ordinary dynamic reads are admitted.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Widens first-boundary property-write candidacy to accept activation-resolved or admitted plain dynamic-identifier base reads.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Threads allowsDynamicIdentifiers through first-boundary property-set compilation and computed-key span support, enabling LoadDynamicIdentifier emission where eligible.
docs/unified-bytecode-expansion-contract.md Updates the contract to describe the newly admitted captured dynamic-base property-write boundary.

💡 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