Skip to content

Admit expression keys for computed member calls - #3019

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-59-computed-call-expression-key
Jun 1, 2026
Merged

Admit expression keys for computed member calls#3019
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-59-computed-call-expression-key

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • split computed member call receivers from computed key spans instead of assuming the key is one op
  • compile computed member call key spans through the existing computed-property key span emitter
  • move box[left + right]() out of the CallDependency decline row and add route-hit coverage that preserves this

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_PropertyReadAdjacentFamilies_DeclineWithExplicitCodes|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_ComputedMemberCallExpressionPlan_AcceptsExecutableInvocationBoundary|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedMemberCall_UsesUnifiedBytecodeProductionFastPathAndPreservesThis|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedMemberCallWithExpressionKey_UsesUnifiedBytecodeProductionFastPathAndPreservesThis|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedMemberCall_PreservesKeyConversionSideEffectsAndThisBinding'\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 22:12
@rogeralsing
rogeralsing merged commit bd2512f into main Jun 1, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-59-computed-call-expression-key branch June 1, 2026 22: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 extends unified bytecode production support for computed member calls whose property key is an expression (multi-op span), rather than a single operand, while preserving correct this binding during invocation.

Changes:

  • Splits computed member call receiver ops from the computed key span, instead of assuming the key is exactly one operation.
  • Compiles computed member call key spans using the existing computed-property key-span emitter/validator.
  • Updates eligibility expectations and adds an invocation test covering expression keys and this preservation on the fast path.

Reviewed changes

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

File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Adds a route-hit test for box[left + right](...) ensuring fast-path routing and correct this.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates eligibility expectation so computed member calls with expression keys are no longer declined.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Adjusts eligibility analysis to treat computed member call keys as spans (multi-op), not single ops.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Updates computed member call target preparation to emit the computed key as a span via existing key-span emission logic.

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

Comment on lines 2732 to 2736
var computedCallTarget = program.GetOperation(computedCallTargetIndex);
var keyIndex = computedCallTargetIndex - 1;
var keyStartIndex = FindComputedCallKeyStart(program, computedCallTargetIndex, stringConstants);
return !computedCallTarget.IsOptional &&
!computedCallTarget.ShortCircuitOnNullishTarget &&
IsSupportedNamedReceiverChain(
Comment on lines +5406 to 5410
var keyStartIndex = FindComputedCallKeyStart(expressionProgram, callTargetIndexInProgram);
if (!TryAppendNamedReceiverOperations(
expressionProgram,
activationSlots,
unified,
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