Remove HMFs from JIT helpers#111088
Conversation
There was a problem hiding this comment.
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. |
Remove unused
JIT_StressGC.Convert
JIT_GetRuntimeFieldStubandJIT_GetRuntimeMethodStubto C#.Contributes to #95695