static fgWalkPreFn CountSharedStaticHelper;
static bool IsSharedStaticHelper(GenTreePtr tree);
static bool IsTreeAlwaysHoistable(GenTreePtr tree);
+ static bool IsGcSafePoint(GenTreePtr tree);
static CORINFO_FIELD_HANDLE eeFindJitDataOffs(unsigned jitDataOffs);
// returns true/false if 'field' is a Jit Data offset
}
}
+inline bool Compiler::IsGcSafePoint(GenTreePtr tree)
+{
+ if (tree->IsCall())
+ {
+ GenTreeCall* call = tree->AsCall();
+ if (!call->IsFastTailCall())
+ {
+ if (call->gtCallType == CT_INDIRECT)
+ {
+ return true;
+ }
+ else if (call->gtCallType == CT_USER_FUNC)
+ {
+ if ((call->gtCallMoreFlags & GTF_CALL_M_NOGCCHECK) == 0)
+ {
+ return true;
+ }
+ }
+ // otherwise we have a CT_HELPER
+ }
+ }
+
+ return false;
+}
+
//
// Note that we want to have two special FIELD_HANDLES that will both
// be considered non-Data Offset handles
#if FEATURE_FASTTAILCALL
#ifndef JIT32_GCENCODER
- if (block->endsWithTailCallOrJmp(this, true) && !(block->bbFlags & BBF_GC_SAFE_POINT) &&
- optReachWithoutCall(fgFirstBB, block))
+ if (block->endsWithTailCallOrJmp(this, true) && optReachWithoutCall(fgFirstBB, block))
{
// We have a tail call that is reachable without making any other
// 'normal' call that would have counted as a GC Poll. If we were
// having a call (for computing full interruptibility).
CLANG_FORMAT_COMMENT_ANCHOR;
-#ifdef _TARGET_AMD64_
- // Amd64 note: If this is a fast tail call then don't count it as a call
- // since we don't insert GC-polls but instead make the method fully GC
- // interruptible.
- if (!call->IsFastTailCall())
-#endif
+ if (IsGcSafePoint(call))
{
- if (call->gtCallType == CT_INDIRECT)
- {
- compCurBB->bbFlags |= BBF_GC_SAFE_POINT;
- }
- else if (call->gtCallType == CT_USER_FUNC)
- {
- if ((call->gtCallMoreFlags & GTF_CALL_M_NOGCCHECK) == 0)
- {
- compCurBB->bbFlags |= BBF_GC_SAFE_POINT;
- }
- }
- // otherwise we have a CT_HELPER
+ compCurBB->bbFlags |= BBF_GC_SAFE_POINT;
}
// Morph Type.op_Equality and Type.op_Inequality
/*****************************************************************************
*
- * Return non-zero if there is a code path from 'topBB' to 'botBB' that will
+ * Return false if there is a code path from 'topBB' to 'botBB' that might
* not execute a method call.
*/