Skip to content

Admit captured property update and delete bytecode#3042

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-82-captured-update-delete
Jun 2, 2026
Merged

Admit captured property update and delete bytecode#3042
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-82-captured-update-delete

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit captured dynamic-identifier bases for first-boundary named/computed property updates and deletes
  • update compiler helper routing so admitted captured property updates emit LoadDynamicIdentifier instead of declining before the general loop
  • add eligibility and public invocation route tests for captured arrow/function-expression property update/delete shapes
  • refresh the unified bytecode expansion contract for the new captured property mutation surface

Proof

  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedNameEvaluate_NamedPropertyUpdateWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_ComputedPropertyUpdateWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_NamedPropertyDeleteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameEvaluate_ComputedPropertyDeleteWithDynamicIdentifierBase_AcceptsWhenDynamicReadsAreAdmitted|FullyQualifiedNameArrowFunction_CapturedPropertyUpdateExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedPropertyUpdateExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedComputedPropertyUpdateExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedComputedPropertyUpdateExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedPropertyDeleteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedPropertyDeleteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameArrowFunction_CapturedComputedPropertyDeleteExpression_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameFunctionExpression_CapturedComputedPropertyDeleteExpression_UsesUnifiedBytecodeProductionFastPath" — 12 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests" — 384 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionInvocationTests" — 350 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProduction" — 776 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~ActivationSemanticsProofPackTests" — 48 passed
  • rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedNameExpressionProgramCoverageMapTests&FullyQualifiedNameUnifiedBytecodeExpansionContract_ListsRequiredHeadingsAndCurrentEnums" — 1 passed
  • rtk dotnet build -c Release — 11 projects, 0 errors, existing nullable warnings
  • rtk rg "EvaluateExpression\(|ProfileEvaluateExpression\(" src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner* — no matches
  • rtk ./tools/profile forloop --memory — Total allocated 6.86 MB
  • rtk git diff --check

Copilot AI review requested due to automatic review settings June 2, 2026 01:51
@rogeralsing rogeralsing merged commit 0efefb9 into main Jun 2, 2026
@rogeralsing rogeralsing deleted the codex/unified-bytecode-loop-82-captured-update-delete branch June 2, 2026 01:52

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

Extends the unified bytecode production fast path to admit captured dynamic-identifier bases for first-boundary named/computed property updates and deletes (e.g., () => obj.value++, () => delete obj[key]).

Changes:

  • Eligibility: thread allowsDynamicIdentifiers through TryIsFirstBoundaryNamedPropertyDeleteCandidate, TryIsFirstBoundaryComputedPropertyDeleteCandidate, and TryIsFirstBoundaryPropertyUpdateCandidate so dynamic-identifier bases are accepted when admitted.
  • Compiler: add TryAppendActivationOrPlainDynamicIdentifierReadValueLoad helper and route the named/computed property update appenders through it (emitting LoadDynamicIdentifier); plumb allowsDynamicIdentifiers into the computed-key span check.
  • Tests / docs: new eligibility tests and 8 invocation fast-path tests for arrow + function-expression captured update/delete shapes; expansion contract doc updated for the new admitted surface.

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
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Pass allowsDynamicIdentifiers through update/delete candidate checks.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs New helper for activation-or-dynamic-identifier base load; wired into named/computed property update appenders.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Added 4 eligibility acceptance tests for dynamic-identifier-base update/delete shapes.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Added 8 fast-path invocation tests covering arrow/function-expression update/delete (named & computed).
docs/unified-bytecode-expansion-contract.md Update date and decline-code descriptions to reflect newly admitted surface.

💡 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