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
Import isinst/castclass Nullable as underlying type #87241
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
168f833
Import isinst Nullable as underlying type
huoyaoyuan e0cd0e2
Update JIT interface for getCastingHelper
huoyaoyuan 8522424
Revert
huoyaoyuan c722484
Resolve nullable as underlying type when CORINFO_TOKENKIND_Casting
huoyaoyuan 8e5392a
Simplify token validation
huoyaoyuan 3ddd0ea
Switch exhaustiveness
huoyaoyuan 3e58229
IL test coverage for castclass
huoyaoyuan ab9520f
Remove unused comment
huoyaoyuan 1ab940b
Fix il
huoyaoyuan 85ba6f2
Revert implementation
huoyaoyuan 2b10425
Implement at JIT side
huoyaoyuan 3855226
Fix IL test
huoyaoyuan e71042b
Avoid unnecessary JIT to EE call
huoyaoyuan File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
|
||
.assembly extern mscorlib { auto } | ||
.assembly extern xunit.core {} | ||
.assembly extern System.Console { auto } | ||
.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } | ||
|
||
.assembly 'castclass_valuetype' { } | ||
|
||
.class public auto Program extends [System.Runtime]System.Object | ||
{ | ||
.method public hidebysig static int32 Main() cil managed | ||
{ | ||
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( | ||
01 00 00 00 | ||
) | ||
.entrypoint | ||
.maxstack 8 | ||
|
||
.try | ||
{ | ||
// castclass valuetype | ||
ldc.i4 1234 | ||
box int32 | ||
castclass int32 | ||
unbox int32 | ||
call instance string [System.Runtime]System.Int32::ToString() | ||
call void [System.Console]System.Console::WriteLine(class [System.Runtime]System.String) | ||
|
||
// castclass nullable | ||
ldc.i4 1234 | ||
box int32 | ||
castclass valuetype [System.Runtime]System.Nullable`1<int32> | ||
unbox int32 | ||
call instance string [System.Runtime]System.Int32::ToString() | ||
call void [System.Console]System.Console::WriteLine(class [System.Runtime]System.String) | ||
|
||
leave.s SUCCESS | ||
} | ||
catch [System.Runtime]System.Object | ||
{ | ||
pop | ||
leave.s FAIL | ||
} | ||
|
||
SUCCESS: | ||
ldstr "SUCCESS" | ||
call void [System.Console]System.Console::WriteLine(class [System.Runtime]System.String) | ||
ldc.i4 100 | ||
ret | ||
|
||
FAIL: | ||
ldstr "FAILED" | ||
call void [System.Console]System.Console::WriteLine(class [System.Runtime]System.String) | ||
ldc.i4 0 | ||
ret | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.IL"> | ||
<PropertyGroup> | ||
<CLRTestPriority>1</CLRTestPriority> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>PdbOnly</DebugType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="castclass_valuetype.il" /> | ||
</ItemGroup> | ||
</Project> |
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.
I assume the [Fact] attribute is not needed here (or then .entrypoint is not needed if it's part of the merged runtime tests)?
I'm not asking to remove it, just curious
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.
[Fact] is needed as JIT/opt is a merged test group. The .entrypoint will have no impact on merged test group execution (this test is a library that is referenced by the merged test group, so this .entrypoint isn't the overall entry).
We've been keeping the .entrypoint annotations in ilproj tests. I'm not entirely sure of the details, but my guess is that the basic wrappers (for BuildAsStandalone or RequiresProcessIsolation) have C#-specific aspects to them.
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.
@markples I see, thanks, I thought that .entrypoint will confuse a merged test group