Skip to content

Admit member call spread sources - #3025

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-65-spread-source-member-calls
Jun 1, 2026
Merged

Admit member call spread sources#3025
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-65-spread-source-member-calls

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit direct named member calls as array and object literal spread sources in production unified bytecode
  • emit nested member-call operands through PrepareNamedCallTarget and CallInvocationBoundary inside simple literal spans
  • convert stale ObjectLiteralOrSpreadDependency tests to route-hit coverage and update the decline contract row

Verification

  • Focused route proof: 6 tests passed
  • Broad unified-bytecode/lowering pack: 900 tests passed
  • Build: 0 errors, 0 warnings
  • AST seam scan: no EvaluateExpression/ProfileEvaluateExpression matches
  • git diff --check clean

Copilot AI review requested due to automatic review settings June 1, 2026 22:53
@rogeralsing
rogeralsing merged commit d2a0104 into main Jun 1, 2026
@rogeralsing
rogeralsing deleted the codex/unified-bytecode-loop-65-spread-source-member-calls branch June 1, 2026 22:53

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 widens production unified-bytecode eligibility/compilation to admit direct named member calls (e.g. source.slice(0)) as array/object literal spread sources, and adds/updates tests and contract documentation to reflect the new acceptance.

Changes:

  • Extend eligibility logic to treat certain direct named member-call operand sequences as admissible within “simple” array/object literal spans (especially for spreads).
  • Extend unified-bytecode compilation of simple array/object literal spans to emit PrepareNamedCallTarget + CallInvocationBoundary for those direct named calls.
  • Update/replace eligibility + invocation tests and adjust the unified-bytecode expansion contract ledger entry.

Reviewed changes

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

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs Adds runtime route-hit coverage asserting fast-path usage for spreads sourced from direct named member calls.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Updates prior decline tests to acceptance and asserts expected opcodes are present in the produced program.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs Expands literal-span measurement and adds helpers to recognize direct named member-call operand spans; updates spread/call-target decline logic accordingly.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs Teaches simple literal span compilation to emit nested direct named member-call boundaries; updates array span helper signature/call sites.
docs/unified-bytecode-expansion-contract.md Updates the decline ledger row text and proof command for ObjectLiteralOrSpreadDependency.

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

Comment on lines +3617 to +3630
if (TryMeasureSimpleDirectNamedCallOperandSpan(
program,
i,
identifierConstants,
activationSlots,
out var callSpanLength))
{
i += callSpanLength;
}
else if (IsSimpleOperand(elementOp, identifierConstants, activationSlots))
{
i++;
}
else
Comment on lines 9268 to 9272
if (!TryAppendSimpleArrayLiteralSpan(
expressionProgram, rhsStart, activationSlots, unified, literalConstants,
expressionProgram, rhsStart, activationSlots, unified, literalConstants, stringConstants,
callTargetConstants: null, slotLayout: null,
out var arraySpanLen, out reason) ||
rhsStart + arraySpanLen - 1 != rhsEnd)
Comment on lines +3981 to +4006
private static bool IsOperationInSimpleArrayLiteralSpan(
ExpressionProgram program,
int operationIndex,
ReadOnlySpan<IdentifierOperand> identifierConstants,
ActivationSlotShape activationSlots)
{
for (var startIndex = 0; startIndex <= operationIndex; startIndex++)
{
if (program.GetOperation(startIndex).Kind != ExpressionOpKind.CreateArray)
{
continue;
}

if (TryMeasureSimpleArrayLiteralSpan(
program,
startIndex,
identifierConstants,
activationSlots,
out var spanLength) &&
operationIndex < startIndex + spanLength)
{
return true;
}
}

return false;
Comment on lines +6688 to +6692
out _))
{
reason = "Spread sources only admit direct named member calls with simple arguments.";
return false;
}
| `SuperPropertyDependency` | Out-of-boundary super call targets; super property reads/writes/updates are admitted by dedicated VM opcodes | Existing class / constructor route for remaining call-target shapes | Super semantics lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_SuperPropertyAccess_AcceptsOwnedOpcodes"` |
| `OptionalChainDependency` | Optional chains outside the admitted optional property-read, optional-call, and exact optional named/computed delete boundaries | Existing sync IR optional-chain route | Optional-chain widening lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_OptionalChainNamedPrefixPlainCallExpressionPlan_AcceptsExecutableInvocationBoundary"` |
| `ObjectLiteralOrSpreadDependency` | Non-simple object spread sources, unsupported array spread, and object methods/accessors only when they appear inside restricted simple literal spans | Existing sync IR literal/spread route for remaining spans | Literal/spread lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_NonSimpleSourceArraySpread_DeclinesWithExplicitCode"` |
| `ObjectLiteralOrSpreadDependency` | Object/array spread sources outside simple operands and direct named member-call spread sources, and object methods/accessors only when they appear inside restricted simple literal spans | Existing sync IR literal/spread route for remaining spans | Literal/spread lane | `rtk dotnet test tests/Asynkron.JsEngine.Tests --filter "FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests&FullyQualifiedName~Evaluate_ObjectLiteralUnsupportedFeatures_DeclineWithExplicitCodes"` |
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