Skip to content

Admit object spread computed property keys - #3017

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-57-object-spread-computed-key
Jun 1, 2026
Merged

Admit object spread computed property keys#3017
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-57-object-spread-computed-key

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • allow supported object literal spans, including spread-only object literals, as computed property key payloads
  • thread string constants through computed property key span compilation so object literal keys can emit safely
  • replace the old readComputedSpreadKey fallback assertion with production fast-path coverage

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_PropertyReadAdjacentFamilies_DeclineWithExplicitCodes|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedPropertyReadWithSpreadObjectKey_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ObjectLiteralSpread_UsesUnifiedBytecodeProductionFastPathAndCopiesSymbolKeys|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ObjectLiteralConstruction_UsesUnifiedBytecodeProductionFastPathAndCoercesComputedKeys|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedPropertyReadWithOrdinaryDynamicKey_UsesUnifiedBytecodeProductionFastPath'\n- rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests|FullyQualifiedNameUnifiedBytecodeProductionSpreadCallTests|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests|FullyQualifiedNameExpressionProgramLoweringTests|FullyQualifiedNameExpressionProgramCoverageMapTests|FullyQualifiedNameAstFreeExecutionAssertionTests'\n- rtk dotnet build src/Asynkron.JsEngine/Asynkron.JsEngine.csproj -c Release\n- rtk rg "EvaluateExpression\\(|ProfileEvaluateExpression\\(" src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner*\n- rtk git diff --check

Copilot AI review requested due to automatic review settings June 1, 2026 21:55
@rogeralsing
rogeralsing merged commit 0224bc5 into main Jun 1, 2026

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 unified-bytecode production support for computed property keys by allowing certain object literal spans (including object spreads) to be compiled as part of the computed-key “payload”, and ensures the unified-bytecode compiler correctly threads string constants so object literal property names can be emitted safely in that context.

Changes:

  • Allow admitted simple object-literal spans (including spread-only) inside computed property key spans for production eligibility and compilation.
  • Thread stringConstants through computed property key span compilation and stage/commit string constants in boundary compilation paths that can now emit object literals.
  • Update tests to validate the unified-bytecode production fast-path is used (instead of asserting fallback) and adjust eligibility expectations accordingly.

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 Replaces a fallback-based test with a fast-path assertion for computed keys that use spread-only object literals.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates expected decline code to reflect new eligibility and improves assertion diagnostics.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Relaxes eligibility rules to admit object spreads in computed-key payloads when they’re part of admitted object literal spans; adds support for CreateObject in computed-key span measurement.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Extends computed property key span compilation to emit simple object literal spans (including spreads) and stages/threads string constants so object literal property names are correctly recorded.

💡 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