Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/coreclr/vm/codeman.h
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,9 @@ class EECodeInfo
*infoPtr = &m_hdrInfoBody;
return m_hdrInfoTable;
}

PTR_CBYTE DecodeGCHdrInfo(hdrInfo * infoPtr, DWORD relOffset);

private:
PTR_CBYTE DecodeGCHdrInfoHelper(hdrInfo ** infoPtr);
#endif // TARGET_X86
Expand Down
56 changes: 28 additions & 28 deletions src/coreclr/vm/eetwain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ void EECodeManager::FixContext( ContextType ctxType,
_ASSERTE((ctxType == FINALLY_CONTEXT) == (thrownObject == NULL));

/* Extract the necessary information from the info block header */
hdrInfo *hdrInfoBody;
pCodeInfo->DecodeGCHdrInfo(&hdrInfoBody);
hdrInfo hdrInfoBody = { 0 };
pCodeInfo->DecodeGCHdrInfo(&hdrInfoBody, dwRelOffset);

#ifdef _DEBUG
if (trFixContext) {
minipal_log_print_info("FixContext [%s][%s] for %s.%s: ",
hdrInfoBody->ebpFrame?"ebp":" ",
hdrInfoBody->interruptible?"int":" ",
hdrInfoBody.ebpFrame?"ebp":" ",
hdrInfoBody.interruptible?"int":" ",
"UnknownClass","UnknownMethod");
minipal_log_flush_info();
}
#endif

/* make sure that we have an ebp stack frame */

_ASSERTE(hdrInfoBody->ebpFrame);
_ASSERTE(hdrInfoBody->handlers); // <TODO>@TODO : This will always be set. Remove it</TODO>
_ASSERTE(hdrInfoBody.ebpFrame);
_ASSERTE(hdrInfoBody.handlers); // <TODO>@TODO : This will always be set. Remove it</TODO>

TADDR baseSP;
GetHandlerFrameInfo(hdrInfoBody, ctx->Ebp,
GetHandlerFrameInfo(&hdrInfoBody, ctx->Ebp,
ctxType == FILTER_CONTEXT ? ctx->Esp : IGNORE_VAL,
ctxType == FILTER_CONTEXT ? (DWORD) IGNORE_VAL : nestingLevel,
&baseSP,
Expand All @@ -101,7 +101,7 @@ void EECodeManager::FixContext( ContextType ctxType,
// EE will write Esp to **pShadowSP before jumping to handler

PTR_TADDR pBaseSPslots =
GetFirstBaseSPslotPtr(ctx->Ebp, hdrInfoBody);
GetFirstBaseSPslotPtr(ctx->Ebp, &hdrInfoBody);
*ppShadowSP = (size_t *)&pBaseSPslots[-(int) nestingLevel ];
pBaseSPslots[-(int)(nestingLevel+1)] = 0; // Zero out the next slot

Expand Down Expand Up @@ -850,18 +850,18 @@ bool EECodeManager::IsGcSafe( EECodeInfo *pCodeInfo,
SUPPORTS_DAC;
} CONTRACTL_END;

hdrInfo *info;
hdrInfo info = { 0 };

/* Extract the necessary information from the info block header */

pCodeInfo->DecodeGCHdrInfo(&info);
pCodeInfo->DecodeGCHdrInfo(&info, dwRelOffset);

/* workaround: prevent interruption within prolog/epilog */

if (info->prologOffs != hdrInfo::NOT_IN_PROLOG || info->epilogOffs != hdrInfo::NOT_IN_EPILOG)
if (info.prologOffs != hdrInfo::NOT_IN_PROLOG || info.epilogOffs != hdrInfo::NOT_IN_EPILOG)
return false;

return (info->interruptible);
return (info.interruptible);
}

#endif // !USE_GC_INFO_DECODER
Expand Down Expand Up @@ -2122,34 +2122,34 @@ TADDR EECodeManager::GetAmbientSP(PREGDISPLAY pContext,

/* Extract the necessary information from the info block header */

hdrInfo *hdrInfoBody;
PTR_CBYTE table = pCodeInfo->DecodeGCHdrInfo(&hdrInfoBody);
hdrInfo hdrInfoBody = { 0 };
PTR_CBYTE table = pCodeInfo->DecodeGCHdrInfo(&hdrInfoBody, dwRelOffset);

#if defined(_DEBUG) && !defined(DACCESS_COMPILE)
if (trFixContext)
{
minipal_log_print_info("GetAmbientSP [%s][%s] for %s.%s: ",
hdrInfoBody->ebpFrame?"ebp":" ",
hdrInfoBody->interruptible?"int":" ",
hdrInfoBody.ebpFrame?"ebp":" ",
hdrInfoBody.interruptible?"int":" ",
"UnknownClass","UnknownMethod");
minipal_log_flush_info();
}
#endif // _DEBUG && !DACCESS_COMPILE

if ((hdrInfoBody->prologOffs != hdrInfo::NOT_IN_PROLOG) ||
(hdrInfoBody->epilogOffs != hdrInfo::NOT_IN_EPILOG))
if ((hdrInfoBody.prologOffs != hdrInfo::NOT_IN_PROLOG) ||
(hdrInfoBody.epilogOffs != hdrInfo::NOT_IN_EPILOG))
{
return NULL;
}

/* make sure that we have an ebp stack frame */

if (hdrInfoBody->handlers)
if (hdrInfoBody.handlers)
{
_ASSERTE(hdrInfoBody->ebpFrame);
_ASSERTE(hdrInfoBody.ebpFrame);

TADDR baseSP;
GetHandlerFrameInfo(hdrInfoBody,
GetHandlerFrameInfo(&hdrInfoBody,
GetRegdisplayFP(pContext),
(DWORD) IGNORE_VAL,
nestingLevel,
Expand All @@ -2162,24 +2162,24 @@ TADDR EECodeManager::GetAmbientSP(PREGDISPLAY pContext,

_ASSERTE(nestingLevel == 0);

if (hdrInfoBody->ebpFrame)
if (hdrInfoBody.ebpFrame)
{
return GetOutermostBaseFP(GetRegdisplayFP(pContext), hdrInfoBody);
return GetOutermostBaseFP(GetRegdisplayFP(pContext), &hdrInfoBody);
}

TADDR baseSP = GetRegdisplaySP(pContext);
if (hdrInfoBody->interruptible)
if (hdrInfoBody.interruptible)
{
baseSP += scanArgRegTableI(skipToArgReg(*hdrInfoBody, table),
baseSP += scanArgRegTableI(skipToArgReg(hdrInfoBody, table),
dwRelOffset,
dwRelOffset,
hdrInfoBody);
&hdrInfoBody);
}
else
{
baseSP += scanArgRegTable(skipToArgReg(*hdrInfoBody, table),
baseSP += scanArgRegTable(skipToArgReg(hdrInfoBody, table),
dwRelOffset,
hdrInfoBody);
&hdrInfoBody);
}

return baseSP;
Expand Down
9 changes: 9 additions & 0 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14917,6 +14917,15 @@ PTR_CBYTE EECodeInfo::DecodeGCHdrInfoHelper(hdrInfo ** infoPtr)
return m_hdrInfoTable;
}

PTR_CBYTE EECodeInfo::DecodeGCHdrInfo(hdrInfo * infoPtr, DWORD relOffset)
{
_ASSERTE(infoPtr != NULL);
GCInfoToken gcInfoToken = GetGCInfoToken();
DWORD hdrInfoSize = (DWORD)::DecodeGCHdrInfo(gcInfoToken, relOffset, infoPtr);
_ASSERTE(hdrInfoSize != 0);
return (PTR_CBYTE)gcInfoToken.Info + hdrInfoSize;
}

#endif // TARGET_X86

#if defined(TARGET_AMD64)
Expand Down
Loading