Uh oh!
There was an error while loading. Please reload this page.
Convert JIT_Box* to C# - #115134
Conversation
Tagging subscribers to this area: @mangod9 |
543d2ae to
ad38529Compaream11
commented
Apr 29, 2025
@EgorBot -amd -arm usingSystem.Reflection;usingBenchmarkDotNet.Attributes;publicclassBench{publicreadonlyintAReadonlyIntField=42;[Benchmark]publicintReflectionFieldBoxing(){FieldInfofieldInfo=typeof(Bench).GetTypeInfo().GetDeclaredField(nameof(AReadonlyIntField));BenchmyInstance=new();objectcurrent=fieldInfo.GetValue(myInstance);fieldInfo.SetValue(myInstance,int.MinValue);return(int)current+(int)fieldInfo.GetValue(myInstance);}} |
aaadc26 to
bf23c6dCompareEgorBo
commented
Apr 29, 2025
@EgorBot -windows_intel -amd -arm usingSystem.Runtime.CompilerServices;usingBenchmarkDotNet.Attributes;publicclassBench{[Benchmark]publicobjectBox8()=>Box(newBuffer8());[Benchmark]publicobjectBox16()=>Box(newBuffer16());[Benchmark]publicobjectBox32()=>Box(newBuffer32());[Benchmark]publicobjectBox256()=>Box(newBuffer256());[MethodImpl(MethodImplOptions.NoInlining|MethodImplOptions.NoOptimization)]staticobjectBox<T>(Tvalue)=>(object)value;}[InlineArray(1)]publicstructBuffer8{long_element0;}[InlineArray(2)]publicstructBuffer16{long_element0;}[InlineArray(4)]publicstructBuffer32{long_element0;}[InlineArray(32)]publicstructBuffer256{long_element0;} |
Uh oh!
There was an error while loading. Please reload this page.
am11
commented
Apr 29, 2025
@EgorBot -windows_intel -amd -arm usingSystem.Runtime.CompilerServices;usingBenchmarkDotNet.Attributes;publicclassBench{[Benchmark]publicobjectBox8()=>Box(newBuffer8());[Benchmark]publicobjectBox16()=>Box(newBuffer16());[Benchmark]publicobjectBox32()=>Box(newBuffer32());[Benchmark]publicobjectBox256()=>Box(newBuffer256());[MethodImpl(MethodImplOptions.NoInlining|MethodImplOptions.NoOptimization)]staticobjectBox<T>(Tvalue)=>(object)value;}[InlineArray(1)]publicstructBuffer8{long_element0;}[InlineArray(2)]publicstructBuffer16{long_element0;}[InlineArray(4)]publicstructBuffer32{long_element0;}[InlineArray(32)]publicstructBuffer256{long_element0;} |
am11
commented
Apr 29, 2025
arm32 doesn't seem to be happy with the TLV commit despite |
arm32 had the special alignment code path (RequiresAlign8) |
10ef59b to
841c89eCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0b8d8f9 to
0f4cd04CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0f4cd04 to
7468c56CompareUh oh!
There was an error while loading. Please reload this page.
NativeAOT's AllocFast mechanism is much efficient, maybe coreclr can reuse it via asm sharing being introduced in #114982? Alternatively, JIT can optimize/inline |
huoyaoyuan
commented
May 1, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
100647b to
9dbafa3CompareUh oh!
There was an error while loading. Please reload this page.
9d00363 to
113056fCompareUh oh!
There was an error while loading. Please reload this page.
am11
commented
May 2, 2025
Thanks @jkotas, @EgorBo and @filipnavara for the help! Do you think we can bring the rest of these to the same plan: runtime/src/coreclr/vm/jitinterfacegen.cpp Lines 84 to 87 in 9e490ef |
filipnavara
commented
May 2, 2025
I'd think that they are good candidate for implementing in assembly and sharing with NativeAOT (as per #115134 (comment)). For some of them it looks like a quite straightforward mapping but perhaps I was just lucky to look at the ones that match up closely... |
am11
commented
May 2, 2025
Sounds good. Then we can follow @davidwrighton's footsteps once #114982 is completed. :) |
filipnavara
commented
May 4, 2025
JFYI I have a prototype on top of #114982 that moves AllocFast.S/asm to the shared code base and replaces most of the helpers. Still needs a bit of love but wanted to let you know to avoid working on the same thing... |
am11
commented
May 5, 2025
Thanks! Can't wait to see |
No description provided.