Skip to content

Conversation

@davidwrighton
Copy link
Member

  • The JIT did not match the behavior specified in the ECMA 335 standard. However, since its behavior is long-standing, instead of fixing the JIT, I'm proposing a new section in the ECMA augments document.
  • I've written tests for the scenarios where the conversion happens
  • And I've fixed the interpreter compiler to match the behavior the JIT has for these scenarios

- The JIT did not match the behavior specified in the ECMA 335 standard. However, since its behavior is long-standing, instead of fixing the JIT, I'm proposing a new section in the ECMA augments document.
- I've written tests for the scenarios where the conversion happens
- And I've fixed the interpreter compiler to match the behavior the JIT has for these scenarios
@davidwrighton davidwrighton requested a review from BrzVlad as a code owner October 2, 2025 23:14
Copilot AI review requested due to automatic review settings October 2, 2025 23:14
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 2, 2025
@davidwrighton davidwrighton requested review from AndyAyersMS and removed request for Copilot October 2, 2025 23:15
Copy link
Contributor

Copilot AI left a comment

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 aligns the interpreter's implicit argument conversion behavior with the existing JIT behavior, which deviates from the ECMA 335 standard. Instead of changing the long-standing JIT behavior, the PR documents this deviation in the ECMA augments specification.

Key changes:

  • Modified the interpreter compiler to handle implicit argument conversions consistently with the JIT
  • Added tests for implicit argument conversion scenarios
  • Documented the deviation from ECMA 335 standard in the augments specification

Reviewed Changes

Copilot reviewed 3 out of 8 changed files in this pull request and generated 4 comments.

File Description
src/coreclr/interpreter/compiler.h Added enableImplicitArgConversionRules parameter to EmitStind method
src/coreclr/interpreter/compiler.cpp Updated EmitStind implementation and call sites to handle implicit conversions consistently with JIT behavior
docs/design/specs/Ecma-335-Augments.md Added documentation of implicit argument coercion deviation from ECMA 335 standard

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that the jit has done this wrong for so long. Augments looks fine but you may want to retitle as copilot suggests.

Copy link
Member

@kg kg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a test!

@davidwrighton davidwrighton merged commit 9833f60 into dotnet:main Oct 9, 2025
101 of 103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants