summaryrefslogtreecommitdiff
path: root/src/vm/typedesc.cpp
diff options
context:
space:
mode:
authorRuben Ayrapetyan <ruben-ayrapetyan@users.noreply.github.com>2017-06-13 16:58:41 +0300
committerJan Kotas <jkotas@microsoft.com>2017-06-13 06:58:40 -0700
commitb258792e59b09060f54e0c9bbd31edc3e67d1ae8 (patch)
treea4a465d84174db3c7cbae95c0c6e050c87a0298d /src/vm/typedesc.cpp
parent8115d8bdaa208f100897c30d9016c77259adb762 (diff)
downloadcoreclr-b258792e59b09060f54e0c9bbd31edc3e67d1ae8.tar.gz
coreclr-b258792e59b09060f54e0c9bbd31edc3e67d1ae8.tar.bz2
coreclr-b258792e59b09060f54e0c9bbd31edc3e67d1ae8.zip
Partially remove relocations for ModuleSection (ZapVirtualSectionType). (#11853)
Diffstat (limited to 'src/vm/typedesc.cpp')
-rw-r--r--src/vm/typedesc.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/vm/typedesc.cpp b/src/vm/typedesc.cpp
index 06170cb2c1..67180684de 100644
--- a/src/vm/typedesc.cpp
+++ b/src/vm/typedesc.cpp
@@ -1373,7 +1373,7 @@ void TypeVarTypeDesc::Fixup(DataImage *image)
STANDARD_VM_CONTRACT;
LOG((LF_ZAP, LL_INFO10000, " TypeVarTypeDesc::Fixup %x (%p)\n", GetToken(), this));
- image->FixupPointerField(this, offsetof(TypeVarTypeDesc, m_pModule));
+ image->FixupRelativePointerField(this, offsetof(TypeVarTypeDesc, m_pModule));
image->ZeroField(this, offsetof(TypeVarTypeDesc, m_hExposedClassObject), sizeof(m_hExposedClassObject));
// We don't persist the constraints: instead, load them back on demand
@@ -1394,10 +1394,10 @@ MethodDesc * TypeVarTypeDesc::LoadOwnerMethod()
}
CONTRACTL_END;
- MethodDesc *pMD = m_pModule->LookupMethodDef(m_typeOrMethodDef);
+ MethodDesc *pMD = GetModule()->LookupMethodDef(m_typeOrMethodDef);
if (pMD == NULL)
{
- pMD = MemberLoader::GetMethodDescFromMethodDef(m_pModule, m_typeOrMethodDef, FALSE);
+ pMD = MemberLoader::GetMethodDescFromMethodDef(GetModule(), m_typeOrMethodDef, FALSE);
}
return pMD;
}
@@ -1414,10 +1414,10 @@ TypeHandle TypeVarTypeDesc::LoadOwnerType()
}
CONTRACTL_END;
- TypeHandle genericType = m_pModule->LookupTypeDef(m_typeOrMethodDef);
+ TypeHandle genericType = GetModule()->LookupTypeDef(m_typeOrMethodDef);
if (genericType.IsNull())
{
- genericType = ClassLoader::LoadTypeDefThrowing(m_pModule, m_typeOrMethodDef,
+ genericType = ClassLoader::LoadTypeDefThrowing(GetModule(), m_typeOrMethodDef,
ClassLoader::ThrowIfNotFound,
ClassLoader::PermitUninstDefOrRef);
}
@@ -1506,7 +1506,7 @@ void TypeVarTypeDesc::LoadConstraints(ClassLoadLevel level /* = CLASS_LOADED */)
numConstraints = pInternalImport->EnumGetCount(&hEnum);
if (numConstraints != 0)
{
- LoaderAllocator* pAllocator=m_pModule->GetLoaderAllocator();
+ LoaderAllocator* pAllocator = GetModule()->GetLoaderAllocator();
// If there is a single class constraint we put in in element 0 of the array
AllocMemHolder<TypeHandle> constraints
(pAllocator->GetLowFrequencyHeap()->AllocMem(S_SIZE_T(numConstraints) * S_SIZE_T(sizeof(TypeHandle))));
@@ -2434,9 +2434,11 @@ TypeVarTypeDesc::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
SUPPORTS_DAC;
DAC_ENUM_DTHIS();
- if (m_pModule.IsValid())
+ PTR_TypeVarTypeDesc ptrThis(this);
+
+ if (GetModule().IsValid())
{
- m_pModule->EnumMemoryRegions(flags, true);
+ GetModule()->EnumMemoryRegions(flags, true);
}
if (m_numConstraints != (DWORD)-1)