Skip to content

Admit captured computed reads to production bytecode - #3040

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

Admit captured computed reads to production bytecode#3040
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-80-captured-computed

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit first-boundary computed property reads from captured ordinary dynamic identifier bases when ordinary dynamic reads are already allowed
  • add eligibility and public route-hit coverage for captured arrow and ordinary closure obj[key] reads
  • update the unified bytecode expansion contract to include captured computed read coverage

Proof

  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedNameEvaluate_ComputedPropertyReadWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameArrowFunction_CapturedComputedPropertyRead_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~FunctionExpression_CapturedComputedPropertyRead_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:20
@rogeralsing
rogeralsing merged commit 462fa48 into main Jun 2, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-80-captured-computed branch June 2, 2026 01:21

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 widens the production unified-bytecode “first boundary” property-read support so captured computed reads (e.g., obj[key]) can use the same production bytecode fast path already available for certain captured named reads, specifically when ordinary dynamic identifier reads are already admitted.

Changes:

  • Extend eligibility/compilation logic to treat plain dynamic-identifier reads as valid first-boundary bases for computed property reads when dynamic identifier operations are allowed.
  • Add invocation tests proving the unified-bytecode production fast path is hit for captured computed property reads in both arrow functions and ordinary closures.
  • Update the unified-bytecode expansion contract documentation to reflect captured computed-read coverage.

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 route-hit coverage asserting the production fast path is used for captured obj[key] reads in arrow and function-expression closures.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Adds an eligibility test ensuring computed reads with a dynamic identifier base are accepted when ordinary dynamic reads are admitted.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Broadens first-boundary computed-read base eligibility to include plain dynamic identifier reads when dynamic identifier ops are allowed.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Emits LoadDynamicIdentifier for first-boundary computed-read bases that are not activation-resolvable when dynamic identifiers are allowed.
docs/unified-bytecode-expansion-contract.md Updates the contract text to explicitly include captured computed property reads in the admitted routes.

💡 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