Admit expression keys for computed member calls - #3019
Merged
rogeralsing merged 1 commit intoJun 1, 2026
Merged
Conversation
rogeralsing
deleted the
codex/unified-bytecode-loop-59-computed-call-expression-key
branch
June 1, 2026 22:13
There was a problem hiding this comment.
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
thispreservation 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
box[left + right]()out of the CallDependency decline row and add route-hit coverage that preservesthisVerification
UnifiedBytecodeProductionEligibilityTests.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