-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Handle Implicit arguments consistently between interpreter and JIT #120339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Implicit arguments consistently between interpreter and JIT #120339
Conversation
davidwrighton
commented
Oct 2, 2025
- 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
There was a problem hiding this 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 |
Co-authored-by: Katelyn Gadd <[email protected]>
There was a problem hiding this 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.
…hub.com/davidwrighton/runtime into make_implicit_arg_conversion_consistent
There was a problem hiding this 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!