Skip to content

Admit this and new.target computed keys - #3018

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-58-this-newtarget-computed-keys
Jun 1, 2026
Merged

Admit this and new.target computed keys#3018
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-58-this-newtarget-computed-keys

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • allow this and new.target loads inside computed property key spans
  • emit the matching unified bytecode load instructions from computed key compilation
  • move the previous logical &&= computed-key decline rows to accepted opcode and route-hit coverage

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.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

Copilot AI review requested due to automatic review settings June 1, 2026 22:05
@rogeralsing
rogeralsing merged commit 9e39076 into main Jun 1, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-58-this-newtarget-computed-keys branch June 1, 2026 22:05

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 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 / LoadNewTarget instructions.
  • 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.

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