-
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
Remove Helper Method Frames (HMF) from Reflection #110627
Remove Helper Method Frames (HMF) from Reflection #110627
Conversation
Rename Signature.GetSignature() to Signature.Init().
…QCall. Rename RuntimeTypeHandle.GetDeclaringMethod() to RuntimeTypeHandle.GetDeclaringMethodForGenericParameter().
paths using FCall/QCall.
paths using FCall/QCall.
Tagging subscribers to this area: @mangod9 |
S.D.Process test failure is unrelated #110643 (intermittently failing on other PRs as well). |
This reverts commit e5c2882.
Make FOR_ILLINK usage consistent in corlib.h.
src/coreclr/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.Shared.xml
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
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.
LGTM otherwise. Thanks!
@jkotas I did some consolidation around |
I think we can go a bit further and merge the QCALL for the regular no-cache version and reflection no-cache version by moving the Nullable special case to the managed side. It should make the casting impl details more centralized. I left a suggestion for what it may look like. |
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Outdated
Show resolved
Hide resolved
...coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs
Outdated
Show resolved
Hide resolved
Good call, simplified a lot. |
...coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs
Outdated
Show resolved
Hide resolved
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.
LGTM!
@EgorBot -windows_intel using System;
using BenchmarkDotNet.Attributes;
public class Bench
{
Type fromType = typeof(object);
Type toType = typeof(string);
[Benchmark]
public bool IsAssignableFrom() => toType.IsAssignableFrom(fromType);
} |
Seems the change is net zero for |
@EgorBot -windows_intel using System;
using BenchmarkDotNet.Attributes;
public class Bench
{
Type fromType = typeof(string);
Type toType = typeof(object);
[Benchmark]
public bool IsAssignableFrom() => toType.IsAssignableFrom(fromType);
} |
Convert
Signature.GetSignature()
to QCall.Rename
Signature.GetSignature()
toSignature.Init()
.Remove HMF from
Signature.GetTypeParameterOffset()
.Remove HMF from
Signature.GetCallingConventionFromFunctionPointerAtOffset()
.Convert
Signature.GetCustomModifiersAtOffset()
to QCall.Convert
RuntimeTypeHandle.GetDeclaringMethodForGenericParameter()
to QCall.Rename
RuntimeTypeHandle.GetDeclaringMethod()
toRuntimeTypeHandle.GetDeclaringMethodForGenericParameter()
.Convert
RuntimeTypeHandle.CanCastTo()
to slow/fast paths using FCall/QCall.Remove HMF from
RuntimeMethodHandle::GetMethodDef()
.Convert
RuntimeMethodHandle.GetStubIfNeeded()
to fast/slow paths using FCall/QCall.Convert
RuntimeTypeHandle.SatisfiesConstraints()
to QCall.Convert
RuntimeMethodHandle.GetMethodBody()
to QCall.