-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Make Type.IsEnum and Type.GetEnumUnderlyingType intrinsics #71685
Merged
Merged
Changes from 57 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
2744c1c
Make Type.GetTypeCode an intrinsic
MichalPetryka f20053b
Change IsEnum to an intrinsic
MichalPetryka 195bad6
Fix formatting
MichalPetryka f60efb6
Fix formatting 2
MichalPetryka 4317f2d
Formatting fix 3
MichalPetryka 616be5d
Fix test
MichalPetryka dff9f04
Fallback to the FCall for nint/nuint enums
MichalPetryka 6959e90
Fix compilation
MichalPetryka c27672c
Add missing Intrinsic
MichalPetryka 1745d84
Fix void handling
MichalPetryka 509842b
Fix compilation
MichalPetryka e1300f4
Fix formatting
MichalPetryka 94f19da
Add typeof support to IsKnownConstant
MichalPetryka b07b12f
Merge branch 'main' into enum-underlyingtype
MichalPetryka c3dc12f
Move the helper
MichalPetryka eb0bc1b
Add missing break
MichalPetryka 098d472
Revert some changes, simplify code
MichalPetryka f05b1b2
Use gtIsTypeHandleToRuntimeTypeHelper
MichalPetryka 02cd252
Fix test
MichalPetryka 753dca2
Add __reftype tests
MichalPetryka b5a2c78
Merge remote-tracking branch 'original/main' into enum-underlyingtype
MichalPetryka a65d81c
Make more places use gtIsTypeof
MichalPetryka 9f1eb3e
Fix tests
MichalPetryka 4f99338
Move the IsEnum check
MichalPetryka d2957e7
Update EnumTests.cs
MichalPetryka 791476b
Apply suggestions, add more tests
MichalPetryka 1f2bf41
Add impTypeGetTypeCode to the header
MichalPetryka d0769b9
Fix formatting
MichalPetryka 2a121d5
Update EnumGetUnderlyingTypeEnums.il
MichalPetryka 9ffdf78
Merge remote-tracking branch 'original/main' into enum-underlyingtype
MichalPetryka efc9f64
Make the IsActualEnum helper an intrinsic
MichalPetryka 0b3b868
Update EnumGetUnderlyingType.cs
MichalPetryka 9d8b3c6
Fix tests
MichalPetryka 559c815
Merge branch 'main' into enum-underlyingtype
MichalPetryka 7edab59
Merge remote-tracking branch 'original/main' into enum-underlyingtype
MichalPetryka f2ec8a9
Remove GetTypeCode intrinsics
MichalPetryka 245098c
Merge
MichalPetryka 1a609d1
Create a new JIT-EE api, add GetEnumUnderlyingType back
MichalPetryka a1291e7
Fix formatting
MichalPetryka 2f17cda
Apply suggestions
MichalPetryka 3e1e52e
Revert unnecessary whitespace
MichalPetryka e519f0c
Optimize GetTypeCode with IsKnownConstant
MichalPetryka 6d5e308
Fix typo
MichalPetryka 9c70c8f
Change the code to make the inliner happy
MichalPetryka 40a349a
Handle all types in GetTypeCode
MichalPetryka 846e57c
Check for custom types
MichalPetryka 159f147
Apply suggestions from code review
MichalPetryka c0d9dea
Fix build, do suggested changes
MichalPetryka b8be7f2
Remove accidental edit
MichalPetryka 7664920
Fix build
MichalPetryka 30afabc
Fix build
MichalPetryka 3e14c6e
Fix build
MichalPetryka d57b8ae
Fix NativeAOT build
MichalPetryka ee8ce1d
Merge
MichalPetryka d2d72df
Remove merge leftovers
MichalPetryka c1b3bf2
Fix generated files
MichalPetryka 64def53
Revert changes in non CoreCLR specific code
MichalPetryka 28561ac
Update src/libraries/System.Text.Json/src/System/Text/Json/Serializat…
jkotas 9f108e9
Update src/libraries/System.Private.CoreLib/src/System/Enum.cs
jkotas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Seems like you should try and leverage
gtGetTypeProducerKind
and/orgtIsTypeHandleToRuntimeTypeHelper
here.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.
gtGetTypeProducerKind
doesn't seem particularly useful here since we don't know the exact type with .GetType() and we don't want to return null types here so I've usedgtIsTypeHandleToRuntimeTypeHelper
and added tests for NRE withType.GetTypeFromHandle(default)
(which I assume generates the(actually only __reftype seems to generate it)._MAYBENULL
helper variant)