- Notifications
You must be signed in to change notification settings - Fork5.2k
Improve getExactClasses to support classes as base types#92440
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Fixesdotnet#88547```csharpusing System.Runtime.CompilerServices;public class ClassA{ public virtual int GetValue() => 42;}public class ClassB : ClassA{ // we don't even need to override GetValue here}class MyClass{ static void Main() { Test(new ClassB()); } [MethodImpl(MethodImplOptions.NoInlining)] static int Test(ClassA c) => c.GetValue();}```Old codegen:```; Method MyClass:Test(ClassA):int (FullOpts) sub rsp, 40 mov rax, qword ptr [rcx] call [rax+30H]ClassA:GetValue():int:this nop add rsp, 40 ret; Total bytes of code: 16```New codegen:```00007FF66DD8AFB0 cmp dword ptr [rcx],ecx00007FF66DD8AFB2 mov eax,2Ah00007FF66DD8AFB7 ret```
ghost commentedSep 21, 2023
Tagging subscribers to this area:@agocke,@MichalStrehovsky,@jkotas Issue DetailsFixes#88547 usingSystem.Runtime.CompilerServices;publicclassClassA{publicvirtualintGetValue()=>42;}publicclassClassB:ClassA{// we don't even need to override GetValue here}classMyClass{staticvoidMain(){Test(newClassB());}[MethodImpl(MethodImplOptions.NoInlining)]staticintTest(ClassAc)=>c.GetValue();} Old codegen: New codegen: Cc @dotnet/ilc-contrib@EgorBo
|
MichalStrehovsky commentedSep 21, 2023
/azp run runtime-nativeaot-outerloop |
| Azure Pipelines successfully started running 1 pipeline(s). |
EgorBo commentedSep 22, 2023
Love it! It should also pick up other jit opts like |
jkotas left a comment
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
Uh oh!
There was an error while loading.Please reload this page.
Fixes#88547
Old codegen:
New codegen:
Cc @dotnet/ilc-contrib@EgorBo