Skip to content

Admit default derived constructors to production bytecode#3037

Merged
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-77-default-derived
Jun 2, 2026
Merged

Admit default derived constructors to production bytecode#3037
rogeralsing merged 1 commit into
mainfrom
codex/unified-bytecode-loop-77-default-derived

Conversation

@rogeralsing

Copy link
Copy Markdown
Contributor

Summary

  • admit synthetic default-derived constructors to the production unified bytecode route
  • bind the generated rest parameter as a JsArray for production slots and constructor environments
  • forward default-derived super(...args) from the rest array without invoking iterator spread semantics
  • remove the stale default-derived production pre-gate docs row

Verification

  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests.DefaultDerivedConstructor_UsesProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests.DefaultDerivedConstructor_ForwardsArgumentsWithoutIteratorProtocol|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests.SuperConstructWithSpread_UsesProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests.SuperConstruct_InitializesThis|FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests.Evaluate_DefaultDerivedConstructor_AcceptsSuperConstructInvocationBoundary|FullyQualifiedNameExpressionProgramCoverageMapTests.UnifiedBytecodeExpansionContract_ListsRequiredHeadingsAndCurrentEnums'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionConstructCallTests'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProduction'
  • rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~ActivationSemanticsProofPackTests'
  • rtk rg 'EvaluateExpression(|ProfileEvaluateExpression(' src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner*
  • rtk dotnet build Asynkron.JsEngine.sln -c Release
  • rtk ./tools/profile forloop --memory

Copilot AI review requested due to automatic review settings June 2, 2026 00:33
@rogeralsing rogeralsing merged commit 9c659cd into main Jun 2, 2026
1 check passed
@rogeralsing rogeralsing deleted the codex/unified-bytecode-loop-77-default-derived branch June 2, 2026 00:34

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 production unified-bytecode “construct” fast path to include synthetic default-derived constructors (i.e., class Derived extends Base {}), ensuring their implicit super(...args) behavior is handled efficiently and with the intended argument-forwarding semantics.

Changes:

  • Admits default-derived constructors into the production unified-bytecode eligibility/fast-path flow (including the super-construct invocation boundary).
  • Binds the synthetic rest parameter as a JsArray in production slots/environments and forwards super(...args) by extracting items directly (avoiding generic spread materialization).
  • Updates tests and the unified-bytecode expansion contract docs to reflect the new admission rules (and removes the stale pre-gate entry).

Reviewed changes

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

Show a summary per file
File Description
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs Adds eligibility coverage to ensure default-derived constructors can pass production gating and include the super-construct boundary + spread masks.
tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionConstructCallTests.cs Updates/extends construct-call tests to assert default-derived constructors take the production fast path and validate forwarding behavior expectations.
tests/Asynkron.JsEngine.Tests/ExpressionProgramCoverageMapTests.cs Removes the “pre-gate:IsDefaultDerivedConstructor” heading expectation to match the updated contract/gating model.
src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeVirtualMachine.cs Adds a specialized forwarding path for default-derived super(...args) to avoid generic spread materialization.
src/Asynkron.JsEngine/Ast/TypedAstEvaluator.SyncFunctionInvoker.cs Adjusts production-slot/environment parameter binding to support a synthetic rest argument array for default-derived constructors and admits the new parameter shape.
docs/unified-bytecode-expansion-contract.md Updates contract text to document default-derived constructor admission and removes the stale pre-gate row.

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

Comment on lines +665 to +667
Array.prototype[Symbol.iterator] = function() {
throw new Error('iterator should not run');
};
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