Skip to content

Commit

Permalink
crossgen2: Report CORINFO_FLG_NOGCCHECK back for internal calls (#65300)
Browse files Browse the repository at this point in the history
When there are loops or tailcalls in a function the JIT will check for
a dominating call that is a GC safepoint to figure out if the function
needs to be marked fully interruptible or not. Methods with the
InternalCall flag may turn into fcalls that are not hijackable and thus
not GC safepoints, so in this case JIT should still mark the function
fully interruptible, but was not doing so because crossgen2 was not
reporting this flag back.

Fix #64980
  • Loading branch information
jakobbotsch authored Feb 14, 2022
1 parent 3e5c2b9 commit 6200568
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,15 @@ private uint getMethodAttribsInternal(MethodDesc method)
result |= CorInfoFlag.CORINFO_FLG_INTRINSIC;
}

// Internal calls typically turn into fcalls that do not always
// probe for GC. Be conservative here and always let JIT know that
// this method may not do GC checks so the JIT might need to make
// callers fully interruptible.
if (method.IsInternalCall)
{
result |= CorInfoFlag.CORINFO_FLG_NOGCCHECK;
}

return (uint)result;
}

Expand Down

0 comments on commit 6200568

Please sign in to comment.