Skip to content

Admit ternary property-read operands - #3023

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-63-conditional-property-operands
Jun 1, 2026
Merged

Admit ternary property-read operands#3023
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-63-conditional-property-operands

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit nonoptional, nonprivate activation-resolved named property-read operands inside conditional expression programs
  • convert the stale this.flag ? this.value : other property-read boundary decline into route coverage
  • update the unified bytecode expansion contract proof command for the JumpIfFalse prototype guard

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests.Evaluate_ConditionalExpression_ThisPropertyConditionAndArms_Accepts|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.Ternary_ThisPropertyConditionAndArm_UsesProductionFastPath|FullyQualifiedName~ExpressionProgramLoweringTests.ObjectSpreadLiteral_SpreadOnlyShape_MatchesJavaScriptBehavior|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.CallWithObjectLiteralArg_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~ExpressionProgramCoverageMapTests.UnifiedBytecodeExpansionContract_ListsRequiredHeadingsAndCurrentEnums'\n- rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests|FullyQualifiedName~UnifiedBytecodeProductionSpreadCallTests|FullyQualifiedName~UnifiedBytecodeProductionConstructCallTests|FullyQualifiedName~ExpressionProgramLoweringTests|FullyQualifiedName~ExpressionProgramCoverageMapTests|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:32
@rogeralsing
rogeralsing merged commit 05716be into main Jun 1, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-63-conditional-property-operands branch June 1, 2026 22:32

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 eligibility rules to allow activation-resolved, non-optional, non-private named property reads (e.g., this.flag, this.value) within ternary (cond ? a : b) expression programs, and updates the test/proof surface accordingly.

Changes:

  • Update production-eligibility logic to admit certain GetNamedProperty operands when the expression program contains a ternary (JumpIfConditionalFalse).
  • Replace the prior “declines” eligibility test with an “accepts” test for this.flag ? this.a : other, and add a runtime fast-path invocation test for this.flag ? this.value : other.
  • Refresh the unified bytecode expansion contract proof command to point at the updated eligibility test.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Adds an invocation test asserting ternary with this.* property reads uses the production fast path.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Converts the prior decline test into an acceptance test for ternary property-read operands.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Adds a new eligibility “admit” shape for activation-resolved named property reads in conditional-expression programs.
docs/unified-bytecode-expansion-contract.md Updates the proof command reference for the prototype-guard:JumpIfFalse row.

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

Comment on lines +1911 to +1914
if (FindFirstOperation(program, ExpressionOpKind.JumpIfConditionalFalse) < 0)
{
return false;
}
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