summaryrefslogtreecommitdiff
path: root/src/vm/class.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/class.h')
-rw-r--r--src/vm/class.h67
1 files changed, 46 insertions, 21 deletions
diff --git a/src/vm/class.h b/src/vm/class.h
index 90bebde4a6..cb4750811b 100644
--- a/src/vm/class.h
+++ b/src/vm/class.h
@@ -676,7 +676,7 @@ class EEClassOptionalFields
// Variance info for each type parameter (gpNonVariant, gpCovariant, or gpContravariant)
// If NULL, this type has no type parameters that are co/contravariant
- BYTE* m_pVarianceInfo;
+ RelativePointer<PTR_BYTE> m_pVarianceInfo;
//
// COM RELATED FIELDS.
@@ -714,6 +714,13 @@ class EEClassOptionalFields
// Set default values for optional fields.
inline void Init();
+
+ PTR_BYTE GetVarianceInfo()
+ {
+ LIMITED_METHOD_DAC_CONTRACT;
+
+ return ReadPointerMaybeNull(this, &EEClassOptionalFields::m_pVarianceInfo);
+ }
};
typedef DPTR(EEClassOptionalFields) PTR_EEClassOptionalFields;
@@ -971,12 +978,12 @@ public:
// will return the method table pointer corresponding to the "canonical"
// instantiation, as defined in typehandle.h.
//
- inline MethodTable* GetMethodTable()
+ inline PTR_MethodTable GetMethodTable()
{
LIMITED_METHOD_CONTRACT;
SUPPORTS_DAC;
- return m_pMethodTable;
+ return ReadPointerMaybeNull(this, &EEClass::m_pMethodTable);
}
// DO NOT ADD ANY ASSERTS TO THIS METHOD.
@@ -993,14 +1000,14 @@ public:
CANNOT_HAVE_CONTRACT;
SUPPORTS_DAC;
- return m_pMethodTable;
+ return ReadPointerMaybeNull(this, &EEClass::m_pMethodTable);
}
-#ifndef DACCESS_COMPILE
+#ifndef DACCESS_COMPILE
inline void SetMethodTable(MethodTable* pMT)
{
LIMITED_METHOD_CONTRACT;
- m_pMethodTable = pMT;
+ m_pMethodTable.SetValueMaybeNull(pMT);
}
#endif // !DACCESS_COMPILE
@@ -1655,14 +1662,15 @@ public:
inline PTR_GuidInfo GetGuidInfo()
{
LIMITED_METHOD_DAC_CONTRACT;
- return m_pGuidInfo;
+
+ return ReadPointerMaybeNull(this, &EEClass::m_pGuidInfo);
}
inline void SetGuidInfo(GuidInfo* pGuidInfo)
{
WRAPPER_NO_CONTRACT;
#ifndef DACCESS_COMPILE
- *EnsureWritablePages(&m_pGuidInfo) = pGuidInfo;
+ EnsureWritablePages(&m_pGuidInfo)->SetValueMaybeNull(pGuidInfo);
#endif // DACCESS_COMPILE
}
@@ -1824,6 +1832,7 @@ public:
GetOptionalFields()->m_pDictLayout = pLayout;
}
+#ifndef DACCESS_COMPILE
static CorGenericParamAttr GetVarianceOfTypeParameter(BYTE * pbVarianceInfo, DWORD i)
{
LIMITED_METHOD_CONTRACT;
@@ -1842,15 +1851,16 @@ public:
BYTE* GetVarianceInfo()
{
LIMITED_METHOD_CONTRACT;
- return HasOptionalFields() ? GetOptionalFields()->m_pVarianceInfo : NULL;
+ return HasOptionalFields() ? GetOptionalFields()->GetVarianceInfo() : NULL;
}
void SetVarianceInfo(BYTE *pVarianceInfo)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(HasOptionalFields());
- GetOptionalFields()->m_pVarianceInfo = pVarianceInfo;
+ GetOptionalFields()->m_pVarianceInfo.SetValueMaybeNull(pVarianceInfo);
}
+#endif // !DACCESS_COMPILE
// Check that a signature blob uses type parameters correctly
// in accordance with the variance annotations specified by this class
@@ -2090,7 +2100,7 @@ public:
// C_ASSERTs in Jitinterface.cpp need this to be public to check the offset.
// Put it first so the offset rarely changes, which just reduces the number of times we have to fiddle
// with the offset.
- PTR_GuidInfo m_pGuidInfo; // The cached guid inforation for interfaces.
+ RelativePointer<PTR_GuidInfo> m_pGuidInfo; // The cached guid information for interfaces.
#ifdef _DEBUG
public:
@@ -2104,7 +2114,7 @@ private:
RelativePointer<PTR_EEClassOptionalFields> m_rpOptionalFields;
// TODO: Remove this field. It is only used by SOS and object validation for stress.
- PTR_MethodTable m_pMethodTable;
+ RelativePointer<PTR_MethodTable> m_pMethodTable;
RelativePointer<PTR_FieldDesc> m_pFieldDescList;
RelativePointer<PTR_MethodDescChunk> m_pChunks;
@@ -2300,15 +2310,15 @@ struct ComPlusCallInfo;
class DelegateEEClass : public EEClass
{
public:
- PTR_Stub m_pStaticCallStub;
- PTR_Stub m_pInstRetBuffCallStub;
- PTR_MethodDesc m_pInvokeMethod;
- PTR_Stub m_pMultiCastInvokeStub;
- PTR_Stub m_pSecureDelegateInvokeStub;
- UMThunkMarshInfo* m_pUMThunkMarshInfo;
- PTR_MethodDesc m_pBeginInvokeMethod;
- PTR_MethodDesc m_pEndInvokeMethod;
- Volatile<PCODE> m_pMarshalStub;
+ PTR_Stub m_pStaticCallStub;
+ PTR_Stub m_pInstRetBuffCallStub;
+ RelativePointer<PTR_MethodDesc> m_pInvokeMethod;
+ PTR_Stub m_pMultiCastInvokeStub;
+ PTR_Stub m_pSecureDelegateInvokeStub;
+ UMThunkMarshInfo* m_pUMThunkMarshInfo;
+ RelativePointer<PTR_MethodDesc> m_pBeginInvokeMethod;
+ RelativePointer<PTR_MethodDesc> m_pEndInvokeMethod;
+ Volatile<PCODE> m_pMarshalStub;
#ifdef FEATURE_COMINTEROP
ComPlusCallInfo *m_pComPlusCallInfo;
@@ -2321,6 +2331,21 @@ public:
MethodDesc* m_pForwardStubMD; // marshaling stub for calls to unmanaged code
MethodDesc* m_pReverseStubMD; // marshaling stub for calls from unmanaged code
+ PTR_MethodDesc GetInvokeMethod()
+ {
+ return ReadPointer(this, &DelegateEEClass::m_pInvokeMethod);
+ }
+
+ PTR_MethodDesc GetBeginInvokeMethod()
+ {
+ return ReadPointer(this, &DelegateEEClass::m_pBeginInvokeMethod);
+ }
+
+ PTR_MethodDesc GetEndInvokeMethod()
+ {
+ return ReadPointer(this, &DelegateEEClass::m_pEndInvokeMethod);
+ }
+
#ifndef DACCESS_COMPILE
DelegateEEClass() : EEClass(sizeof(DelegateEEClass))
{