summaryrefslogtreecommitdiff
path: root/src/vm/instmethhash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/instmethhash.cpp')
-rw-r--r--src/vm/instmethhash.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vm/instmethhash.cpp b/src/vm/instmethhash.cpp
index 560e9554be..05378b4450 100644
--- a/src/vm/instmethhash.cpp
+++ b/src/vm/instmethhash.cpp
@@ -183,12 +183,16 @@ MethodDesc* InstMethodHashTable::FindMethodDesc(TypeHandle declaringType,
if ( ((dwKeyFlags & InstMethodHashEntry::UnboxingStub) == 0) != (unboxingStub == 0) )
continue;
+#ifdef FEATURE_PREJIT
// Note pMD->GetMethodTable() might not be restored at this point.
RelativeFixupPointer<PTR_MethodTable> * ppMT = pMD->GetMethodTablePtr();
TADDR pMT = ppMT->GetValueMaybeTagged((TADDR)ppMT);
if (!ZapSig::CompareTaggedPointerToTypeHandle(GetModule(), pMT, declaringType))
+#else
+ if (TypeHandle(pMD->GetMethodTable()) != declaringType)
+#endif
{
continue; // Next iteration of the for loop
}
@@ -204,11 +208,15 @@ MethodDesc* InstMethodHashTable::FindMethodDesc(TypeHandle declaringType,
for (DWORD i = 0; i < inst.GetNumArgs(); i++)
{
+#ifdef FEATURE_PREJIT
// Fetch the type handle as TADDR. It may be may be encoded fixup - TypeHandle debug-only validation
// asserts on encoded fixups.
TADDR candidateArg = ((FixupPointer<TADDR> *)candidateInst.GetRawArgs())[i].GetValue();
if (!ZapSig::CompareTaggedPointerToTypeHandle(GetModule(), candidateArg, inst[i]))
+#else
+ if (candidateInst[i] != inst[i])
+#endif
{
match = false;
break;