diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-01-13 00:40:45 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-01-13 00:40:45 -0800 |
commit | 2b197262e52b06719db5179cc42b55851874c88c (patch) | |
tree | 599b45f80968cd88b2e3e83835e2fb0555324784 /src/vm/methodtable.cpp | |
parent | 3126bd31077a6d97f665a573957d5bb6419f9a0f (diff) | |
download | coreclr-2b197262e52b06719db5179cc42b55851874c88c.tar.gz coreclr-2b197262e52b06719db5179cc42b55851874c88c.tar.bz2 coreclr-2b197262e52b06719db5179cc42b55851874c88c.zip |
Revert "Remove relocations for MethodTable::m_pParentMethodTable for Linux ARM"
This reverts commit cf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2.
Diffstat (limited to 'src/vm/methodtable.cpp')
-rw-r--r-- | src/vm/methodtable.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp index 0b63e8a380..24c69cfb01 100644 --- a/src/vm/methodtable.cpp +++ b/src/vm/methodtable.cpp @@ -1788,7 +1788,7 @@ TypeHandle::CastResult MethodTable::CanCastToClassNoGC(MethodTable *pTargetMT) if (pMT == pTargetMT) return TypeHandle::CanCast; - pMT = MethodTable::GetParentMethodTable(pMT); + pMT = MethodTable::GetParentMethodTableOrIndirection(pMT); } while (pMT); } @@ -4779,17 +4779,7 @@ void MethodTable::Fixup(DataImage *image) #endif // _DEBUG MethodTable * pParentMT = GetParentMethodTable(); - _ASSERTE(!pNewMT->m_pParentMethodTable.IsIndirectPtrMaybeNull()); - - ZapRelocationType relocType; - if (decltype(MethodTable::m_pParentMethodTable)::isRelative) - { - relocType = IMAGE_REL_BASED_RELPTR; - } - else - { - relocType = IMAGE_REL_BASED_PTR; - } + _ASSERTE(!pNewMT->GetFlag(enum_flag_HasIndirectParent)); if (pParentMT != NULL) { @@ -4801,8 +4791,7 @@ void MethodTable::Fixup(DataImage *image) { if (image->CanHardBindToZapModule(pParentMT->GetLoaderModule())) { - _ASSERTE(!m_pParentMethodTable.IsIndirectPtr()); - image->FixupField(this, offsetof(MethodTable, m_pParentMethodTable), pParentMT, 0, relocType); + image->FixupPointerField(this, offsetof(MethodTable, m_pParentMethodTable)); } else { @@ -4838,7 +4827,8 @@ void MethodTable::Fixup(DataImage *image) if (pImport != NULL) { - image->FixupFieldToNode(this, offsetof(MethodTable, m_pParentMethodTable), pImport, FIXUP_POINTER_INDIRECTION, relocType); + image->FixupFieldToNode(this, offsetof(MethodTable, m_pParentMethodTable), pImport, -(SSIZE_T)offsetof(MethodTable, m_pParentMethodTable)); + pNewMT->SetFlag(enum_flag_HasIndirectParent); } } @@ -6101,7 +6091,7 @@ void MethodTable::Restore() // // Restore parent method table // - Module::RestoreMethodTablePointer(&m_pParentMethodTable, GetLoaderModule(), CLASS_LOAD_APPROXPARENTS); + Module::RestoreMethodTablePointerRaw(GetParentMethodTablePtr(), GetLoaderModule(), CLASS_LOAD_APPROXPARENTS); // // Restore interface classes @@ -8156,8 +8146,13 @@ BOOL MethodTable::IsParentMethodTablePointerValid() if (!GetWriteableData_NoLogging()->IsParentMethodTablePointerValid()) return FALSE; - TADDR base = dac_cast<TADDR>(this) + offsetof(MethodTable, m_pParentMethodTable); - return !m_pParentMethodTable.IsTagged(base); + if (!GetFlag(enum_flag_HasIndirectParent)) + { + return TRUE; + } + TADDR pMT; + pMT = *PTR_TADDR(m_pParentMethodTable + offsetof(MethodTable, m_pParentMethodTable)); + return !CORCOMPILE_IS_POINTER_TAGGED(pMT); } #endif |