-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization
Milestone
Description
Currently JIT treats sealed methods as virtual.
I use VS 2015 RC.
[MethodImpl(MethodImplOptions.NoInlining)]
private int TestSealedMethodInlining(Derived obj)
{
return obj.GetValue(3);
}
class Base
{
public virtual int GetValue(int value)
{
return 0x33;
}
}
class Derived : Base
{
public sealed override int GetValue(int value)
{
return value;
}
}
TestSealedMethodInlining in machine code:
sub rsp,28h
mov qword ptr [rsp+38h],rdx
mov rcx,rdx
mov edx,3
mov rax,qword ptr [rsp+38h]
mov rax,qword ptr [rax]
mov rax,qword ptr [rax+40h]
call qword ptr [rax+20h]
nop
add rsp,28h
ret
What I would expect:
mov rdx, qword ptr [rdx]
mov rax, 3
ret
jnm2, redknightlois, LYP951018, ulrichb and GabrielMotaAlexandre
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIoptimization