Skip to content

Commit

Permalink
Add support for GCPOLL_INLINE for crossgen (dotnet#39376)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored Jul 16, 2020
1 parent dd2bcef commit aff5cf7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/coreclr/src/inc/readytorun.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ enum ReadyToRunHelper
// Not a real helper - handle to current module passed to delay load helpers.
READYTORUN_HELPER_Module = 0x01,
READYTORUN_HELPER_GSCookie = 0x02,
READYTORUN_HELPER_IndirectTrapThreads = 0x03,

//
// Delay load helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public enum ReadyToRunHelper
// Not a real helper - handle to current module passed to delay load helpers.
Module = 0x01,
GSCookie = 0x02,
IndirectTrapThreads = 0x03,

//
// Delay load helpers
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2496,12 +2496,6 @@ private uint getThreadTLSIndex(ref void* ppIndirection)
private void* getInlinedCallFrameVptr(ref void* ppIndirection)
{ throw new NotImplementedException("getInlinedCallFrameVptr"); }

private int* getAddrOfCaptureThreadGlobal(ref void* ppIndirection)
{
ppIndirection = null;
return null;
}

private Dictionary<CorInfoHelpFunc, ISymbolNode> _helperCache = new Dictionary<CorInfoHelpFunc, ISymbolNode>();
private void* getHelperFtn(CorInfoHelpFunc ftnNum, ref void* ppIndirection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,12 @@ private void getGSCookie(IntPtr* pCookieVal, IntPtr** ppCookieVal)
*ppCookieVal = (IntPtr *)ObjectToHandle(_compilation.NodeFactory.GetReadyToRunHelperCell(ReadyToRunHelper.GSCookie));
}

private int* getAddrOfCaptureThreadGlobal(ref void* ppIndirection)
{
ppIndirection = (void*)ObjectToHandle(_compilation.NodeFactory.GetReadyToRunHelperCell(ReadyToRunHelper.IndirectTrapThreads));
return null;
}

private void getMethodVTableOffset(CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, ref bool isRelative)
{ throw new NotImplementedException("getMethodVTableOffset"); }
private void expandRawHandleIntrinsic(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,9 @@ private void ParseHelper(StringBuilder builder)
builder.Append("GC_COOKIE");
break;

case ReadyToRunHelper.IndirectTrapThreads:
builder.Append("INDIRECT_TRAP_THREADS");
break;

//
// Delay load helpers
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/src/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13725,6 +13725,10 @@ BOOL LoadDynamicInfoEntry(Module *currentModule,
result = (size_t)GetProcessGSCookie();
break;

case READYTORUN_HELPER_IndirectTrapThreads:
result = (size_t)&g_TrapReturningThreads;
break;

case READYTORUN_HELPER_DelayLoad_MethodCall:
result = (size_t)GetEEFuncEntryPoint(DelayLoad_MethodCall);
break;
Expand Down
8 changes: 6 additions & 2 deletions src/coreclr/src/zap/zapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1430,9 +1430,13 @@ LONG * ZapInfo::getAddrOfCaptureThreadGlobal(void **ppIndirection)
_ASSERTE(ppIndirection != NULL);

*ppIndirection = NULL;
if (!IsReadyToRunCompilation())
if (IsReadyToRunCompilation())
{
*ppIndirection = m_pImage->GetImportTable()->GetHelperImport(READYTORUN_HELPER_IndirectTrapThreads);
}
else
{
*ppIndirection = (LONG*)m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
*ppIndirection = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
offsetof(CORCOMPILE_EE_INFO_TABLE, addrOfCaptureThreadGlobal));
}

Expand Down

0 comments on commit aff5cf7

Please sign in to comment.