-
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
Change callvirt
into calli
for virtual delegates
#83461
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a175351
Changed how NaN values are compared due to their multiple bit represe…
f9ed58c
Merge branch 'dotnet:main' into main
LeVladIonescu a381c06
Fixed typo
d91a78f
Merge branch 'dotnet:main' into main
LeVladIonescu 1291fe3
Merge branch 'dotnet:main' into main
LeVladIonescu 9a58bb3
Merge branch 'dotnet:main' into main
LeVladIonescu 8db950e
Merge branch 'dotnet:main' into main
LeVladIonescu f587d24
Merge branch 'dotnet:main' into main
LeVladIonescu f5dbeaf
Merge branch 'dotnet:main' into main
LeVladIonescu 287419e
Merge branch 'dotnet:main' into main
LeVladIonescu fbc1526
Work to make JIT virtual delegates not depend on the target_method
afd58dd
Merge branch 'dotnet:main' into delegates_issue
LeVladIonescu 45f4845
Merge branch 'dotnet:main' into delegates_issue
LeVladIonescu 91c3920
Switched order of how MonoObject is passed to the icall
81973db
Initialise pointer for build warning
3b0d6cb
Check return value in the test
f67f5fb
Retrieved method in icall and changed test location
dc2c525
Added check for unbox & rgctx trampolines and modified caching
4ba3366
Deleted unused vars
7b65607
Added test for lazy fetch trampoline (rgctx)
e7e8913
Merge branch 'dotnet:main' into delegates_issue
LeVladIonescu d6e1d3d
Added boxing for valuetype ref
0074bea
Added RequiresProcessIsolation property for tests in merged directory
be6daed
Using get_ftnptr callback and moving boxing inside the icall
596837e
Merge branch 'dotnet:main' into delegates_issue
LeVladIonescu 414f451
Merge branch 'dotnet:main' into delegates_issue
LeVladIonescu 1d2c4fb
Rremoved add_delegate_trampoline since it's not used anymore
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Reflection; | ||
|
||
|
||
public interface IGetContents<T> { | ||
(string, int, T) GetContents(); | ||
} | ||
public struct MyStruct<T> : IGetContents<T> { | ||
public string s; | ||
public int a; | ||
public T t; | ||
|
||
public (string, int, T) GetContents() | ||
{ | ||
return (s, a, t); | ||
} | ||
} | ||
|
||
public class Program { | ||
|
||
public delegate (string, int, T) MyDelegate<T>(IGetContents<T> arg); | ||
|
||
public static int Main(string[] args) | ||
{ | ||
int retVal = 100; | ||
|
||
try { | ||
MyStruct<string> myStruct = new MyStruct<string>(); | ||
myStruct.s = "test1"; | ||
myStruct.a = 42; | ||
myStruct.t = "test2"; | ||
|
||
MethodInfo mi = typeof(IGetContents<string>).GetMethod("GetContents"); | ||
MyDelegate<string> func = (MyDelegate<string>)mi.CreateDelegate(typeof(MyDelegate<string>)); | ||
|
||
(string c1, int c2, string c3) = func(myStruct); | ||
if (c1 != "test1") | ||
retVal = 1; | ||
if (c2 != 42) | ||
retVal = 2; | ||
if (c3 != "test2") | ||
retVal = 3; | ||
} catch (Exception e) { | ||
Console.WriteLine(e); | ||
retVal = 1; | ||
} | ||
|
||
return retVal; | ||
} | ||
} |
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RequiresProcessIsolation>true</RequiresProcessIsolation> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>PdbOnly</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="GSDelegate.cs" /> | ||
</ItemGroup> | ||
</Project> |
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,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
public class VirtualDelegate | ||
{ | ||
public static int Main () { | ||
int retVal = 100; | ||
try { | ||
var del = (Func<string, string>)Delegate.CreateDelegate (typeof (Func<string, string>), null, typeof (object).GetMethod ("ToString")); | ||
if (del ("FOO") != "FOO") | ||
retVal = 1; | ||
} catch(Exception e) { | ||
Console.WriteLine(e); | ||
retVal = 1; | ||
} | ||
|
||
return retVal; | ||
|
||
} | ||
} |
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<RequiresProcessIsolation>true</RequiresProcessIsolation> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>PdbOnly</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="VirtualDelegate.cs" /> | ||
</ItemGroup> | ||
</Project> |
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.
The caching code needs to be modified to cache based on either the class or the signature. I.e. this code:
and: