Skip to content

[NativeAOT/x86] Implement GetConservativeUpperBoundForOutgoingArgs #99726

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

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
21 changes: 18 additions & 3 deletions src/coreclr/nativeaot/Runtime/windows/CoffNativeCodeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,24 @@ uintptr_t CoffNativeCodeManager::GetConservativeUpperBoundForOutgoingArgs(Method

upperBound = dac_cast<TADDR>(context.Sp);
#else
PORTABILITY_ASSERT("GetConservativeUpperBoundForOutgoingArgs");
upperBound = NULL;
RhFailFast();
PTR_uint8_t gcInfo;
uint32_t codeOffset = GetCodeOffset(pMethodInfo, (PTR_VOID)pRegisterSet->IP, &gcInfo);

hdrInfo infoBuf;
size_t infoSize = DecodeGCHdrInfo(GCInfoToken(gcInfo), codeOffset, &infoBuf);
PTR_CBYTE table = gcInfo + infoSize;

REGDISPLAY registerSet = *pRegisterSet;

::UnwindStackFrameX86(&registerSet,
(PTR_CBYTE)(m_moduleBase + pNativeMethodInfo->mainRuntimeFunction->BeginAddress),
codeOffset,
&infoBuf,
table,
(PTR_CBYTE)(m_moduleBase + pNativeMethodInfo->runtimeFunction->BeginAddress),
(unwindBlockFlags & UBF_FUNC_KIND_MASK) != UBF_FUNC_KIND_ROOT,
true);
upperBound = dac_cast<TADDR>(registerSet.PCTAddr);
#endif
}
return upperBound;
Expand Down