-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Optimize a castclass over nullables #95764
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue Detailsint Test<T>(T t) => ((IMyInterface)t).M(); (for ; Assembly listing for method Program:Test[System.Nullable`1[S]](System.Nullable`1[S]):int
sub rsp, 40
mov qword ptr [rsp+0x30], rcx
lea rdx, [rsp+0x30]
mov rcx, 0xD1FFAB1E ; System.Nullable`1[S]
call CORINFO_HELP_BOX_NULLABLE
- mov rdx, rax
- mov rcx, 0xD1FFAB1E ; IMyInterface
- call CORINFO_HELP_CHKCASTINTERFACE
- mov rcx, rax
- mov r11, 0xD1FFAB1E ; code for IMyInterface:M():int:this
- call [r11]IMyInterface:M():int:this
- nop
+ movsx rax, byte ptr [rax+0x08]
+ mov eax, 42
add rsp, 40
ret
-; Total bytes of code 69
+; Total bytes of code 44
|
@dotnet/jit-contrib PTAL, no spmi diffs due to missing context this PR introduces. Jit-diffs are mostly size regressions because we devirtualize & inline more calls now, Example: |
Co-authored-by: Andy Ayers <[email protected]>
Contributes to #50915
(for
T
beingNullable<S>
)