-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
JIT: Avoid boxing ArgumentNullException.ThrowIfNull arguments in Tier-0 #104815
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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.
I was thinking we'd catch this in impBoxPatternMatch
to avoid creating and then removing all the BOX IR, but that would require recognizing and intrinsic from its IL, which I guess could be clunky. This works too.
No worries, I hadn't gotten around to this yet. |
The problem with that, - we'd need to do a redundant "resolveToken" call on |
@jakobbotsch @AndyAyersMS could you please review the Nullable<> part? |
Co-authored-by: Jakob Botsch Nielsen <[email protected]>
Closes #104512
Example:
Current codegen for
Test<int>
in Tier0:New codegen for
Test<int>
in Tier0:@AndyAyersMS I hope I didn't step on your foot since it's was assigned to you, it's just that it looked trivial and I decided to file a quick fix 🙂
In theory, we could solve this by a limitted version of inlining in tier0, but that is tricky and may regress startup time/lead to unnecessary type load events, etc.