-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Generalize IsBitwiseEquatable to field-wise IEquatable value types #130723
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
Open
tannergooding
wants to merge
26
commits into
dotnet:main
Choose a base branch
from
tannergooding:tannergooding-runtimehelpers-isbitwiseequatable
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8b612a6
Generalize IsBitwiseEquatable to field-wise IEquatable value types
tannergooding f2fd52a
Fix IsNotTightlyPacked for multi-byte value-type fields
tannergooding 5334651
Recognize recursive value-type fields in IsBitwiseEquatable
tannergooding 5efb9f5
Recognize record struct EqualityComparer<T>.Default.Equals in IsBitwi…
tannergooding ec0e64e
Keep inline array types uncached in CanCompareBitsOrUseFastGetHashCode
tannergooding dbc47aa
Address review feedback on token decode and comments
tannergooding 4b35aa7
Guard the ILC field-wise scan against a truncated IL stream
tannergooding 06fbe39
Add CoreCLR test coverage for IsBitwiseEquatable
tannergooding 2c79ee3
Force optimized IL and correct Guid case in the CoreCLR test
tannergooding 0f7aa7e
Gate the CoreCLR IsBitwiseEquatable test off Mono
tannergooding 5a57cd2
Treat enum fields as bitwise-comparable in the VM Equals scanner
tannergooding 16b9789
Guard the ILC field-wise scan against malformed IL
tannergooding aeeebda
Use MemberData so the test builds in the merged runner
tannergooding 165ff66
Exercise IsBitwiseEquatable via UnsafeAccessor and drop the ILC unit …
tannergooding eee0912
Recognize long-form branches and unify the IsBitwiseEquatable decision
tannergooding 0826af2
Make Guid.Equals a field-wise comparison
tannergooding 8dc6c24
Funnel bitwise-equatable struct equality through Equals
tannergooding 3e13ed0
Cover long-form branches in the BitwiseEquatable test
tannergooding d4be11d
Rethrow terminal exceptions from the IsBitwiseEquatable scan
tannergooding 9b36292
Document the tearing consideration on IsBitwiseEquatable
tannergooding 2fb72c9
Apply suggestions from code review
tannergooding 627879f
Potential fix for pull request finding
tannergooding 82db303
Bail out early on generic value types in the field-wise scan
tannergooding 89c6fc4
Guard the field-wise scan against writing past the field array
tannergooding ac384b3
Address review feedback on the field-wise equality scan
tannergooding 1df9e78
Support generic value types in the field-wise equality scan
tannergooding 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
10 changes: 10 additions & 0 deletions
10
src/coreclr/nativeaot/Test.CoreLib/src/System/IEquatable.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace System | ||
| { | ||
| public interface IEquatable<T> | ||
| { | ||
| bool Equals(T other); | ||
| } | ||
| } |
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
388 changes: 388 additions & 0 deletions
388
src/coreclr/tools/Common/TypeSystem/IL/Stubs/ComparerIntrinsics.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.