Handle Implicit arguments consistently between interpreter and JIT#120339
Merged
davidwrighton merged 7 commits intodotnet:mainfrom Oct 9, 2025
Merged
Conversation
Member
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
Contributor
There was a problem hiding this comment.
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 |
kg
reviewed
Oct 2, 2025
kg
reviewed
Oct 2, 2025
kg
reviewed
Oct 2, 2025
Co-authored-by: Katelyn Gadd <kg@luminance.org>
AndyAyersMS
approved these changes
Oct 2, 2025
Member
AndyAyersMS
left a comment
There was a problem hiding this comment.
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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.