Admit this and new.target computed keys - #3018
Merged
rogeralsing merged 1 commit intoJun 1, 2026
Merged
Conversation
rogeralsing
deleted the
codex/unified-bytecode-loop-58-this-newtarget-computed-keys
branch
June 1, 2026 22:05
There was a problem hiding this comment.
Pull request overview
This PR expands the unified bytecode production fast path to treat this and new.target as supported operations inside computed property key spans, and emits the corresponding unified bytecode load opcodes during computed-key compilation.
Changes:
- Updated unified bytecode production eligibility checks to accept computed keys containing
this/new.target. - Updated unified bytecode compiler computed-key span emission to generate
LoadThis/LoadNewTargetinstructions. - Added/updated test coverage to validate both eligibility (owned opcodes) and runtime fast-path invocation for these computed-key cases.
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 | Adds invocation tests ensuring computed logical property writes with this / new.target keys hit the unified-bytecode-production fast path and behave correctly. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Updates eligibility expectations so this / new.target computed keys are accepted and asserts the presence of the corresponding owned load opcode plus computed compound set/write opcodes. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Extends “simple operand” and computed-key span support to include LoadThis and LoadNewTarget. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Extends computed-key span validation and emission to support LoadThis / LoadNewTarget and compile them into unified bytecode instructions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
thisandnew.targetloads inside computed property key spans&&=computed-key decline rows to accepted opcode and route-hit coverageVerification
UnifiedBytecodeProductionEligibilityTests.Evaluate_LogicalAndAssignment_ThisAndNewTargetComputedKeys_AcceptWithOwnedOpcodes|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedLogicalPropertyWriteWithThisKey_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedLogicalPropertyWriteWithNewTargetKey_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedLogicalPropertyWrite_UsesUnifiedBytecodeProductionFastPathAndPreservesShortCircuitSemantics|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedLogicalPropertyWriteWithExpressionKey_UsesUnifiedBytecodeProductionFastPathAndPreservesShortCircuitSemantics|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedLogicalPropertyWriteWithBinaryRhs_UsesUnifiedBytecodeProductionFastPath'\n- rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests|FullyQualifiedNameUnifiedBytecodeProductionSpreadCallTests|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests|FullyQualifiedNameExpressionProgramLoweringTests|FullyQualifiedNameExpressionProgramCoverageMapTests|FullyQualifiedName~AstFreeExecutionAssertionTests'\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