Skip to content

Admit declaration destructuring descriptors - #3029

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-69-destructuring-descriptors
Jun 1, 2026
Merged

Admit declaration destructuring descriptors#3029
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-69-destructuring-descriptors

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • route declaration destructuring defaults and computed binding names through ApplyDeclarationBindingTarget
  • remove duplicate declaration binding-target filters from eligibility and compiler
  • convert default/computed declaration destructuring tests from fallback coverage to route-hit coverage

Verification

  • Focused proof: 10 tests passed
  • Broad unified-bytecode/lowering pack: 904 tests passed
  • Build: 0 errors, 0 warnings
  • AST seam scan: no EvaluateExpression/ProfileEvaluateExpression matches
  • git diff --check clean

Copilot AI review requested due to automatic review settings June 1, 2026 23:12
@rogeralsing
rogeralsing merged commit fa6ff1e into main Jun 1, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-69-destructuring-descriptors branch June 1, 2026 23:13

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 admit declaration destructuring shapes that include defaults and computed binding names by routing them through ApplyDeclarationBindingTarget, and updates tests/docs to reflect the new eligibility and route-hit behavior.

Changes:

  • Routes declaration destructuring defaults/computed binding names through ApplyDeclarationBindingTarget and removes now-redundant eligibility/compiler filters.
  • Updates eligibility tests to expect acceptance (and presence of ApplyDeclarationBindingTarget plus binding-target constants).
  • Updates invocation tests and contract documentation to treat these shapes as production-fast-path hits rather than fallbacks.

Reviewed changes

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

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Converts declaration destructuring default/computed cases to assert production fast-path route-hit logging.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates expectations to accept descriptor opcode (ApplyDeclarationBindingTarget) and require binding-target constants for these destructuring shapes.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Removes duplicate/obsolete declaration binding-target destructuring eligibility filter.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Removes duplicate/obsolete declaration binding-target compilation filter, allowing descriptor opcode usage.
docs/unified-bytecode-expansion-contract.md Updates the DestructuringDependency contract row to reflect the newly admitted declaration destructuring descriptor-backed lane and test filter.

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

Comment on lines 408 to 418
if (instruction is BindingVariableDeclarationInstruction
{
VarKind: VariableKind.Using or VariableKind.AwaitUsing
})
{
declineCode = UnifiedBytecodeProductionDeclineCode.UnsupportedPlanShape;
declineReason = "using declarations require scope-exit disposal and are not eligible for production unified bytecode routing.";
return true;
}

if (instruction is BindingVariableDeclarationInstruction bindingDeclaration &&
!IsSupportedDeclarationBindingTarget(bindingDeclaration.TargetProgram))
{
declineCode = UnifiedBytecodeProductionDeclineCode.DestructuringDependency;
declineReason =
"Binding/destructuring declarations with defaults, computed names, or assignment targets are not eligible for production unified bytecode routing.";
return true;
}

if (instruction is FunctionDeclarationInstruction { Descriptor: not null })
Comment on lines 891 to 897
case BindingVariableDeclarationInstruction
{
AwaitedProgram: null
} declaration:
if (!IsSupportedDeclarationBindingTarget(declaration.TargetProgram))
{
reason =
"Binding declaration targets with defaults, computed names, or assignment targets are not eligible for unified bytecode storage.";
return false;
}

var hasBindingInitializer = declaration.InitializerProgram is not null;
if (declaration.InitializerProgram is { } bindingInitializerProgram)
{
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