Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I am trying to understand how generic methods are jitted (value types vs reference types), so that I can find them properly in SharpLab. Value types seem quite straightforward, but I am running into some confusion with reference types.
Let's take this method
M
:I created
M<int>
andM<string>
usingMakeGenericMethod
, then calledRuntimeHelpers.PrepareMethod()
on both.I have then saved a minidump using VS save dump feature.
M<int>
(value type)If I start with
M<int>
method, by get these pointers fromMethodInfo
and start looking at it in WinDbg, I get the following:
IsJitted
isyes
,CodeAddr
matches output ofGetFunctionPointer()
, all looks well.I can easily find the jitted method:
M<string>
(reference type)For
M<string>
I can get the following pointersThen, in WinDbg
As we can see, somehow is
IsJitted
isno
, and there is no code address, even though I calledPrepareMethod
.Now if I look at the pointer from
GetFunctionPointer()
:If I follow that jump
And follow the second jump, I get to the "Normal JIT generated code"
So seems like method is jitted?
(
Canon
here makes sense due to generic code sharing)Questions
Looking at this, I can't quite understand a few things:
MethodDesc
say thatM<string>
is not jitted, when it ends up in jitted code? (through__Canon
)M<string>
MethodHandle
without following all the jumps?Beta Was this translation helpful? Give feedback.
All reactions