-
Couldn't load subscription status.
- Fork 5.2k
[NativeAOT] Make casting logic closer to CoreCLR #89548
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
Changes from 11 commits
957ac35
7cdbbaa
48ed2b1
2c287d8
b814698
7913942
e7b30dd
3a38456
0dbd156
3515468
3be5c28
5ee7cd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5469,8 +5469,8 @@ GenTree* Compiler::impCastClassOrIsInstToTree( | |
| } | ||
| else if (isCastClass) | ||
| { | ||
| // Jit can only inline expand CHKCASTCLASS and CHKCASTARRAY helpers. | ||
| canExpandInline = (helper == CORINFO_HELP_CHKCASTCLASS) || (helper == CORINFO_HELP_CHKCASTARRAY); | ||
| // Jit can always inline expand CHKCASTCLASS | ||
| canExpandInline = (helper == CORINFO_HELP_CHKCASTCLASS); | ||
|
|
||
| // For ChkCastAny we ignore cases where the class is known to be abstract or is an interface. | ||
| if (helper == CORINFO_HELP_CHKCASTANY) | ||
|
|
@@ -5480,7 +5480,7 @@ GenTree* Compiler::impCastClassOrIsInstToTree( | |
| canExpandInline = !isAbstract; | ||
| } | ||
| } | ||
| else if ((helper == CORINFO_HELP_ISINSTANCEOFCLASS) || (helper == CORINFO_HELP_ISINSTANCEOFARRAY)) | ||
| else if ((helper == CORINFO_HELP_ISINSTANCEOFCLASS) || (helper == CORINFO_HELP_ISINSTANCEOFANY)) | ||
| { | ||
| // If the class is exact, the jit can expand the IsInst check inline. | ||
jkotas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| canExpandInline = isClassExact; | ||
|
|
@@ -5616,8 +5616,8 @@ GenTree* Compiler::impCastClassOrIsInstToTree( | |
| GenTree* condTrue; | ||
| if (isCastClass) | ||
| { | ||
| assert((helper == CORINFO_HELP_CHKCASTCLASS) || (helper == CORINFO_HELP_CHKCASTARRAY) || | ||
| (helper == CORINFO_HELP_CHKCASTANY) || (helper == CORINFO_HELP_CHKCASTINTERFACE)); | ||
| assert((helper == CORINFO_HELP_CHKCASTCLASS) || (helper == CORINFO_HELP_CHKCASTANY) || | ||
| (helper == CORINFO_HELP_CHKCASTINTERFACE)); | ||
|
|
||
| CorInfoHelpFunc specialHelper = helper; | ||
| if ((helper == CORINFO_HELP_CHKCASTCLASS) && | ||
|
|
@@ -13612,7 +13612,7 @@ methodPointerInfo* Compiler::impAllocateMethodPointerInfo(const CORINFO_RESOLVED | |
| bool Compiler::impIsClassExact(CORINFO_CLASS_HANDLE classHnd) | ||
| { | ||
| DWORD flags = info.compCompHnd->getClassAttribs(classHnd); | ||
| DWORD flagsMask = CORINFO_FLG_FINAL | CORINFO_FLG_VARIANCE | CORINFO_FLG_ARRAY; | ||
| DWORD flagsMask = CORINFO_FLG_FINAL | CORINFO_FLG_VARIANCE | CORINFO_FLG_TYPE_EQUIVALENCE | CORINFO_FLG_ARRAY; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both |
||
|
|
||
| if ((flags & flagsMask) == CORINFO_FLG_FINAL) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.