forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIT: optimize popped boxes in the importer (dotnet#101303)
Fixes dotnet#82291.
- Loading branch information
1 parent
cdc117e
commit 42d9737
Showing
3 changed files
with
55 additions
and
0 deletions.
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
42 changes: 42 additions & 0 deletions
42
src/tests/JIT/Regression/JitBlue/Runtime_82291/Runtime_82291.cs
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,42 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
using Xunit; | ||
|
||
public class Runtime_82291 | ||
{ | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static bool GetValueOrNull<T>() | ||
{ | ||
if (default(T) != null) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static bool GetValueOrNullSlow<T>() | ||
{ | ||
if (default(T) != null) | ||
return false; | ||
|
||
return false; | ||
} | ||
|
||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static void GetValueOrNullSlow2<T>() | ||
{ | ||
if (default(T) != null) | ||
return; | ||
|
||
return; | ||
} | ||
|
||
[Fact] | ||
public static void Test() | ||
{ | ||
GetValueOrNull<int>(); | ||
GetValueOrNullSlow<int>(); | ||
GetValueOrNullSlow2<int>(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/tests/JIT/Regression/JitBlue/Runtime_82291/Runtime_82291.csproj
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,5 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |