summaryrefslogtreecommitdiff
path: root/src/vm/methodtable.cpp
diff options
context:
space:
mode:
authorGleb Balykov <g.balykov@samsung.com>2017-06-23 14:57:25 +0300
committerGleb Balykov <g.balykov@samsung.com>2017-07-10 16:37:05 +0300
commitcf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2 (patch)
tree446fedc57adce0d4610d8e6cfc98c1a17243e3f9 /src/vm/methodtable.cpp
parent7a107e9622ff5803987add587414610014eeca4e (diff)
downloadcoreclr-cf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2.tar.gz
coreclr-cf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2.tar.bz2
coreclr-cf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2.zip
Remove relocations for MethodTable::m_pParentMethodTable for Linux ARM
Diffstat (limited to 'src/vm/methodtable.cpp')
-rw-r--r--src/vm/methodtable.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/vm/methodtable.cpp b/src/vm/methodtable.cpp
index d60f565b08..cf24f19239 100644
--- a/src/vm/methodtable.cpp
+++ b/src/vm/methodtable.cpp
@@ -1790,7 +1790,7 @@ TypeHandle::CastResult MethodTable::CanCastToClassNoGC(MethodTable *pTargetMT)
if (pMT == pTargetMT)
return TypeHandle::CanCast;
- pMT = MethodTable::GetParentMethodTableOrIndirection(pMT);
+ pMT = MethodTable::GetParentMethodTable(pMT);
} while (pMT);
}
@@ -4781,7 +4781,17 @@ void MethodTable::Fixup(DataImage *image)
#endif // _DEBUG
MethodTable * pParentMT = GetParentMethodTable();
- _ASSERTE(!pNewMT->GetFlag(enum_flag_HasIndirectParent));
+ _ASSERTE(!pNewMT->m_pParentMethodTable.IsIndirectPtrMaybeNull());
+
+ ZapRelocationType relocType;
+ if (decltype(MethodTable::m_pParentMethodTable)::isRelative)
+ {
+ relocType = IMAGE_REL_BASED_RELPTR;
+ }
+ else
+ {
+ relocType = IMAGE_REL_BASED_PTR;
+ }
if (pParentMT != NULL)
{
@@ -4793,7 +4803,8 @@ void MethodTable::Fixup(DataImage *image)
{
if (image->CanHardBindToZapModule(pParentMT->GetLoaderModule()))
{
- image->FixupPointerField(this, offsetof(MethodTable, m_pParentMethodTable));
+ _ASSERTE(!m_pParentMethodTable.IsIndirectPtr());
+ image->FixupField(this, offsetof(MethodTable, m_pParentMethodTable), pParentMT, 0, relocType);
}
else
{
@@ -4829,8 +4840,7 @@ void MethodTable::Fixup(DataImage *image)
if (pImport != NULL)
{
- image->FixupFieldToNode(this, offsetof(MethodTable, m_pParentMethodTable), pImport, -(SSIZE_T)offsetof(MethodTable, m_pParentMethodTable));
- pNewMT->SetFlag(enum_flag_HasIndirectParent);
+ image->FixupFieldToNode(this, offsetof(MethodTable, m_pParentMethodTable), pImport, FIXUP_POINTER_INDIRECTION, relocType);
}
}
@@ -6087,7 +6097,7 @@ void MethodTable::Restore()
//
// Restore parent method table
//
- Module::RestoreMethodTablePointerRaw(GetParentMethodTablePtr(), GetLoaderModule(), CLASS_LOAD_APPROXPARENTS);
+ Module::RestoreMethodTablePointer(&m_pParentMethodTable, GetLoaderModule(), CLASS_LOAD_APPROXPARENTS);
//
// Restore interface classes
@@ -7845,13 +7855,8 @@ BOOL MethodTable::IsParentMethodTablePointerValid()
if (!GetWriteableData_NoLogging()->IsParentMethodTablePointerValid())
return FALSE;
- if (!GetFlag(enum_flag_HasIndirectParent))
- {
- return TRUE;
- }
- TADDR pMT;
- pMT = *PTR_TADDR(m_pParentMethodTable + offsetof(MethodTable, m_pParentMethodTable));
- return !CORCOMPILE_IS_POINTER_TAGGED(pMT);
+ TADDR base = dac_cast<TADDR>(this) + offsetof(MethodTable, m_pParentMethodTable);
+ return !m_pParentMethodTable.IsTagged(base);
}
#endif