Admit member call spread sources - #3025
Merged
rogeralsing merged 1 commit intoJun 1, 2026
Merged
Conversation
rogeralsing
deleted the
codex/unified-bytecode-loop-65-spread-source-member-calls
branch
June 1, 2026 22:53
There was a problem hiding this comment.
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+CallInvocationBoundaryfor 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"` | |
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
Verification