Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5943,7 +5943,7 @@ void Lowering::InsertPInvokeMethodProlog()
noway_assert(comp->info.compUnmanagedCallCountWithGCTransition);
noway_assert(comp->lvaInlinedPInvokeFrameVar != BAD_VAR_NUM);

if (comp->opts.ShouldUsePInvokeHelpers())
if (!comp->info.compPublishStubParam && comp->opts.ShouldUsePInvokeHelpers())
{
return;
}
Expand Down Expand Up @@ -5972,6 +5972,13 @@ void Lowering::InsertPInvokeMethodProlog()
DISPTREERANGE(firstBlockRange, store);
}

// If we use P/Invoke helper calls then the hidden stub initialization
// is all we need to do. Rest will get initialized by the helper.
if (comp->opts.ShouldUsePInvokeHelpers())
{
return;
}

// Call runtime helper to fill in our InlinedCallFrame and push it on the Frame list:
// TCB = CORINFO_HELP_INIT_PINVOKE_FRAME(&symFrameStart);
GenTree* frameAddr = comp->gtNewLclVarAddrNode(comp->lvaInlinedPInvokeFrameVar);
Expand Down
Loading