-
Notifications
You must be signed in to change notification settings - Fork 2.7k
x86: Deactivate P/Invoke frames after a native call. #8464
Conversation
Although this does not appear to be strictly necessary, this matches JIT32's behavior. With this change, the stack walker will ignore the P/Invoke frame even while it is still present on its thread's frame list. Fixes VSO 297109.
@BruceForstall @dotnet/jit-contrib PTAL |
@@ -2963,7 +2963,7 @@ void Lowering::InsertPInvokeCallEpilog(GenTreeCall* call) | |||
BlockRange().InsertBefore(insertionPoint, LIR::SeqTree(comp, tree)); | |||
|
|||
// Pop the frame if necessary. On 32-bit targets this only happens in the method epilog; on 64-bit targets thi |
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.
This conflict with what you added:
On 32-bit targets this only happens in the method epilog;
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.
There is a difference between popping and deactivating a frame: the latter removes the frame from its thread's frame list, while the former leaves the frame on the list but marks it s.t. the stack walker ignores it.
#else | ||
const CORINFO_EE_INFO::InlinedCallFrameInfo& callFrameInfo = comp->eeGetEEInfo()->inlinedCallFrameInfo; | ||
|
||
GenTreeLclFld* const storeCallSiteTracker = |
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.
A comment similar to this one should be added:
(This is the comment that is used when we setup this value in InsertPInvokeCallProlog)
// ----------------------------------------------------------------------------------
// InlinedCallFrame.m_pCallerReturnAddress = &label (the address of the instruction immediately following the call) // InlinedCallFrame.m_pCallerReturnAddress = &label (the address of the instruction immediately following the call)
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.
Done.
x86: Deactivate P/Invoke frames after a native call. Commit migrated from dotnet/coreclr@b19ac36
Although this does not appear to be strictly necessary, this matches
JIT32's behavior. With this change, the stack walker will ignore the
P/Invoke frame even while it is still present on its thread's frame
list.
Fixes VSO 297109.