summaryrefslogtreecommitdiff
path: root/src/inc
diff options
context:
space:
mode:
authorRuben Ayrapetyan <ruben-ayrapetyan@users.noreply.github.com>2017-06-28 09:16:01 +0300
committerJan Kotas <jkotas@microsoft.com>2017-06-27 23:16:01 -0700
commit44f57065649af5f8bcbb7c71d827221a7bc1bf7a (patch)
treedaa511e0217853b725dec53e3ec676683ecd2224 /src/inc
parent7cc721ec6ec56c998d66f1d57e7341cf7141a8a3 (diff)
downloadcoreclr-44f57065649af5f8bcbb7c71d827221a7bc1bf7a.tar.gz
coreclr-44f57065649af5f8bcbb7c71d827221a7bc1bf7a.tar.bz2
coreclr-44f57065649af5f8bcbb7c71d827221a7bc1bf7a.zip
Partially remove relocations from Class section of NGEN-ed images (#11962)
* Remove relocations for ParamTypeDesc::m_TemplateMT. * Remove relocations for LayoutEEClass::m_LayoutInfo.m_pFieldMarshalers. * Prepare RelativeFixupPointer. * Remove relocations for FieldMarshaler::m_pFD and FieldMarshaler_*::m_*.
Diffstat (limited to 'src/inc')
-rw-r--r--src/inc/fixuppointer.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/inc/fixuppointer.h b/src/inc/fixuppointer.h
index 38ae348e1e..83ff20e04f 100644
--- a/src/inc/fixuppointer.h
+++ b/src/inc/fixuppointer.h
@@ -249,6 +249,15 @@ public:
static constexpr bool isRelative = true;
typedef PTR_TYPE type;
+#ifndef DACCESS_COMPILE
+ RelativeFixupPointer()
+ {
+ SetValueMaybeNull(NULL);
+ }
+#else // DACCESS_COMPILE
+ RelativeFixupPointer() =delete;
+#endif // DACCESS_COMPILE
+
// Implicit copy/move is not allowed
RelativeFixupPointer<PTR_TYPE>(const RelativeFixupPointer<PTR_TYPE> &) =delete;
RelativeFixupPointer<PTR_TYPE>(RelativeFixupPointer<PTR_TYPE> &&) =delete;
@@ -273,6 +282,15 @@ public:
return FALSE;
}
+#ifndef DACCESS_COMPILE
+ FORCEINLINE BOOL IsTagged() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ TADDR base = (TADDR) this;
+ return IsTagged(base);
+ }
+#endif // !DACCESS_COMPILE
+
// Returns value of the encoded pointer. Assumes that the pointer is not NULL.
FORCEINLINE PTR_TYPE GetValue(TADDR base) const
{
@@ -343,7 +361,7 @@ public:
{
LIMITED_METHOD_CONTRACT;
PRECONDITION(addr != NULL);
- m_delta = (TADDR)addr - (TADDR)this;
+ m_delta = dac_cast<TADDR>(addr) - (TADDR)this;
}
// Set encoded value of the pointer. The value can be NULL.
@@ -353,7 +371,7 @@ public:
if (addr == NULL)
m_delta = NULL;
else
- m_delta = (TADDR)addr - (TADDR)base;
+ m_delta = dac_cast<TADDR>(addr) - (TADDR)base;
}
// Set encoded value of the pointer. The value can be NULL.
@@ -373,6 +391,15 @@ public:
return dac_cast<DPTR(PTR_TYPE)>(addr - FIXUP_POINTER_INDIRECTION);
}
+#ifndef DACCESS_COMPILE
+ PTR_TYPE * GetValuePtr() const
+ {
+ LIMITED_METHOD_CONTRACT;
+ TADDR base = (TADDR) this;
+ return GetValuePtr(base);
+ }
+#endif // !DACCESS_COMPILE
+
// Returns value of the encoded pointer. Assumes that the pointer is not NULL.
// Allows the value to be tagged.
FORCEINLINE TADDR GetValueMaybeTagged(TADDR base) const