Skip to content

Commit

Permalink
Make sure we tell the same lie to the JIT for default interface methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cshung authored Dec 12, 2019
2 parents fe3f975 + b7424b9 commit 9a54db9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/coreclr/src/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20652,7 +20652,7 @@ void Compiler::addGuardedDevirtualizationCandidate(GenTreeCall* call,
return;
}

// CT_INDRECT calls may use the cookie, bail if so...
// CT_INDIRECT calls may use the cookie, bail if so...
//
// If transforming these provides a benefit, we could save this off in the same way
// we save the stub address below.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public enum CORINFO_THIS_TRANSFORM
// thisTransform and constraint calls
// ----------------------------------
//
// For evertyhing besides "constrained." calls "thisTransform" is set to
// For everything besides "constrained." calls "thisTransform" is set to
// CORINFO_NO_THIS_TRANSFORM.
//
// For "constrained." calls the EE attempts to resolve the call at compile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,9 @@ private void ceeInfoGetCallInfo(
}
else
{
// At this point, we knew it is a virtual call to targetMethod,
// If it is also a default interface method call, it should go through instantiating stub.
useInstantiatingStub = useInstantiatingStub || (targetMethod.OwningType.IsInterface && !originalMethod.IsAbstract);
// Insert explicit null checks for cross-version bubble non-interface calls.
// It is required to handle null checks properly for non-virtual <-> virtual change between versions
pResult->nullInstanceCheck = callVirtCrossingVersionBubble && !targetMethod.OwningType.IsInterface;
Expand Down

0 comments on commit 9a54db9

Please sign in to comment.