-
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 HMFs from JIT helpers #111088
Remove HMFs from JIT helpers #111088
Conversation
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.
Copilot reviewed 2 out of 10 changed files in this pull request and generated no comments.
Files not reviewed (8)
- src/coreclr/inc/jithelpers.h: Language not supported
- src/coreclr/vm/corelib.h: Language not supported
- src/coreclr/vm/field.cpp: Language not supported
- src/coreclr/vm/field.h: Language not supported
- src/coreclr/vm/frames.h: Language not supported
- src/coreclr/vm/interpreter.cpp: Language not supported
- src/coreclr/vm/jithelpers.cpp: Language not supported
- src/coreclr/vm/runtimehandles.cpp: Language not supported
Comments suppressed due to low confidence (2)
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs:929
- Ensure that the behavior of the new method FromPtr in RuntimeMethodInfoStub is covered by tests.
internal static object FromPtr(IntPtr pMD)
src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs:1397
- Ensure that the behavior of the new method FromPtr in RuntimeFieldInfoStub is covered by tests.
internal static object FromPtr(IntPtr pFD)
Tagging subscribers to this area: @mangod9 |
@jkotas I couldn't find any obvious way to emit a |
@EgorBot -windows_intel using System;
using System.Reflection;
using System.Reflection.Emit;
using BenchmarkDotNet.Attributes;
public class Bench
{
Func<RuntimeMethodHandle> d = Init();
static Func<RuntimeMethodHandle> Init()
{
DynamicMethod dm = new DynamicMethod("My", typeof(RuntimeMethodHandle), null, typeof(string).Module);
MethodInfo randomMethod = typeof(object).GetMethod("ReferenceEquals");
ILGenerator il = dm.GetILGenerator();
il.Emit(OpCodes.Ldtoken, randomMethod);
il.Emit(OpCodes.Ret);
return dm.CreateDelegate<Func<RuntimeMethodHandle>>();
}
[Benchmark]
public RuntimeMethodHandle LdToken() => d();
} |
C# emits ldtoken for methods/fields as part of expression trees, but it is wrapped by a bunch of code that would obfuscate the perf measurement. I have a posted a microbenchmark using DynamicMethods. I am not worried about the perf impact of this change. I expect this change to be a perf improvement. |
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.
Thanks
Remove unused
JIT_StressGC
.Convert
JIT_GetRuntimeFieldStub
andJIT_GetRuntimeMethodStub
to C#.Contributes to #95695