Remove PlainPointer, RelativePointer and RelativeFixupPointer (#57707)
authorDavid Wrighton <davidwr@microsoft.com>
Tue, 24 Aug 2021 21:30:37 +0000 (14:30 -0700)
committerGitHub <noreply@github.com>
Tue, 24 Aug 2021 21:30:37 +0000 (14:30 -0700)
- Removed all uses of PlainPointer
- Remove all use of RelativeFixupPointer
- Remove all use of FixupPointer
- Remove RelativePointer

- Debugging all of this is now easier! Yay!

Fixes #57706

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
57 files changed:
src/coreclr/debug/daccess/request.cpp
src/coreclr/inc/corcompile.h
src/coreclr/inc/fixuppointer.h [deleted file]
src/coreclr/vm/amd64/cgenamd64.cpp
src/coreclr/vm/amd64/virtualcallstubcpu.hpp
src/coreclr/vm/arm/stubs.cpp
src/coreclr/vm/arm/virtualcallstubcpu.hpp
src/coreclr/vm/arm64/stubs.cpp
src/coreclr/vm/arm64/virtualcallstubcpu.hpp
src/coreclr/vm/array.cpp
src/coreclr/vm/ceeload.cpp
src/coreclr/vm/ceeload.h
src/coreclr/vm/ceeload.inl
src/coreclr/vm/class.cpp
src/coreclr/vm/class.h
src/coreclr/vm/class.inl
src/coreclr/vm/classhash.cpp
src/coreclr/vm/clrtocomcall.cpp
src/coreclr/vm/codepitchingmanager.cpp
src/coreclr/vm/common.h
src/coreclr/vm/debughelp.cpp
src/coreclr/vm/dllimport.cpp
src/coreclr/vm/dynamicmethod.cpp
src/coreclr/vm/field.h
src/coreclr/vm/genericdict.cpp
src/coreclr/vm/genericdict.h
src/coreclr/vm/generics.cpp
src/coreclr/vm/genmeth.cpp
src/coreclr/vm/i386/cgenx86.cpp
src/coreclr/vm/i386/virtualcallstubcpu.hpp
src/coreclr/vm/ibclogger.cpp
src/coreclr/vm/ilstubcache.cpp
src/coreclr/vm/instmethhash.cpp
src/coreclr/vm/jithelpers.cpp
src/coreclr/vm/jitinterface.cpp
src/coreclr/vm/method.cpp
src/coreclr/vm/method.hpp
src/coreclr/vm/methoddescbackpatchinfo.cpp
src/coreclr/vm/methodimpl.cpp
src/coreclr/vm/methodimpl.h
src/coreclr/vm/methodtable.cpp
src/coreclr/vm/methodtable.h
src/coreclr/vm/methodtable.inl
src/coreclr/vm/methodtablebuilder.cpp
src/coreclr/vm/methodtablebuilder.h
src/coreclr/vm/ngenhash.h
src/coreclr/vm/ngenhash.inl
src/coreclr/vm/prestub.cpp
src/coreclr/vm/proftoeeinterfaceimpl.cpp
src/coreclr/vm/runtimehandles.cpp
src/coreclr/vm/typedesc.cpp
src/coreclr/vm/typedesc.h
src/coreclr/vm/typehandle.h
src/coreclr/vm/typehash.cpp
src/coreclr/vm/typehash.h
src/coreclr/vm/typekey.h
src/coreclr/vm/virtualcallstub.cpp

index 7ddef6a..343210b 100644 (file)
@@ -918,7 +918,7 @@ HRESULT ClrDataAccess::GetMethodDescData(
             methodDescData->bHasNativeCode = FALSE;
             methodDescData->NativeCodeAddr = (CLRDATA_ADDRESS)-1;
         }
-        methodDescData->AddressOfNativeCodeSlot = pMD->HasNativeCodeSlot() ? TO_CDADDR(pMD->GetAddrOfNativeCodeSlot()) : NULL;
+        methodDescData->AddressOfNativeCodeSlot = pMD->HasNativeCodeSlot() ? TO_CDADDR(dac_cast<TADDR>(pMD->GetAddrOfNativeCodeSlot())) : NULL;
         methodDescData->MDToken = pMD->GetMemberDef();
         methodDescData->MethodDescPtr = methodDesc;
         methodDescData->MethodTablePtr = HOST_CDADDR(pMD->GetMethodTable());
index a3e4a53..3c7a7ca 100644 (file)
@@ -26,7 +26,6 @@
 #include <daccess.h>
 #include <corbbtprof.h>
 #include <clrtypes.h>
-#include <fixuppointer.h>
 
 typedef DPTR(struct CORCOMPILE_EXCEPTION_LOOKUP_TABLE)
     PTR_CORCOMPILE_EXCEPTION_LOOKUP_TABLE;
diff --git a/src/coreclr/inc/fixuppointer.h b/src/coreclr/inc/fixuppointer.h
deleted file mode 100644 (file)
index 10af5f8..0000000
+++ /dev/null
@@ -1,531 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-/*****************************************************************************\
-*                                                                             *
-* FixupPointer.h -  Fixup pointer holder types                                *
-*                                                                             *
-\*****************************************************************************/
-
-#ifndef _FIXUPPOINTER_H
-#define _FIXUPPOINTER_H
-
-#include "daccess.h"
-
-//----------------------------------------------------------------------------
-// PlainPointer is simple pointer wrapper to support compilation without indirections
-// This is useful for building size-constrained runtime without NGen support.
-template<typename PTR_TYPE>
-class PlainPointer
-{
-public:
-
-    static constexpr bool isRelative = false;
-    typedef PTR_TYPE type;
-
-    // Returns whether the encoded pointer is NULL.
-    BOOL IsNull() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return m_ptr == NULL;
-    }
-
-    // Returns whether the indirection cell contain fixup that has not been converted to real pointer yet.
-    BOOL IsTagged(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return FALSE;
-    }
-
-    // Returns whether the indirection cell contain fixup that has not been converted to real pointer yet.
-    BOOL IsTagged() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return FALSE;
-    }
-
-    // Returns value of the encoded pointer.
-    PTR_TYPE GetValue() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<PTR_TYPE>(m_ptr);
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns the pointer to the indirection cell.
-    PTR_TYPE * GetValuePtr() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return (PTR_TYPE *)&m_ptr;
-    }
-#endif // !DACCESS_COMPILE
-
-    // Returns value of the encoded pointer. Assumes that the pointer is not NULL.
-    PTR_TYPE GetValue(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<PTR_TYPE>(m_ptr);
-    }
-
-    // Static version of GetValue. It is meant to simplify access to arrays of pointers.
-    FORCEINLINE static PTR_TYPE GetValueAtPtr(TADDR base)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(PlainPointer<PTR_TYPE>)>(base)->GetValue(base);
-    }
-
-    // Returns value of the encoded pointer. The pointer can be NULL.
-    PTR_TYPE GetValueMaybeNull() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<PTR_TYPE>(m_ptr);
-    }
-
-    // Returns value of the encoded pointer. The pointer can be NULL.
-    PTR_TYPE GetValueMaybeNull(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<PTR_TYPE>(m_ptr);
-    }
-
-    // Static version of GetValueMaybeNull. It is meant to simplify access to arrays of pointers.
-    FORCEINLINE static PTR_TYPE GetValueMaybeNullAtPtr(TADDR base)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(PlainPointer<PTR_TYPE>)>(base)->GetValueMaybeNull(base);
-    }
-
-    // Returns value of the encoded pointer.
-    // Allows the value to be tagged.
-    FORCEINLINE TADDR GetValueMaybeTagged() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return m_ptr;
-    }
-
-    // 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
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return m_ptr;
-    }
-
-    // Returns whether pointer is indirect. Assumes that the value is not NULL.
-    bool IsIndirectPtr(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return FALSE;
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns whether pointer is indirect. Assumes that the value is not NULL.
-    // Does not need explicit base and thus can be used in non-DAC builds only.
-    bool IsIndirectPtr() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return FALSE;
-    }
-#endif
-
-    // Returns whether pointer is indirect. The value can be NULL.
-    bool IsIndirectPtrMaybeNull(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return FALSE;
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns whether pointer is indirect. The value can be NULL.
-    // Does not need explicit base and thus can be used in non-DAC builds only.
-    bool IsIndirectPtrMaybeNull() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return FALSE;
-    }
-#endif
-
-#ifndef DACCESS_COMPILE
-    void SetValue(PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        m_ptr = dac_cast<TADDR>(addr);
-    }
-
-    // Set encoded value of the pointer. Assumes that the value is not NULL.
-    void SetValue(TADDR base, PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        m_ptr = dac_cast<TADDR>(addr);
-    }
-
-    // Static version of SetValue. It is meant to simplify access to arrays of pointers.
-    FORCEINLINE static void SetValueAtPtr(TADDR base, PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        dac_cast<DPTR(PlainPointer<PTR_TYPE>)>(base)->SetValue(base, addr);
-    }
-
-    // Set encoded value of the pointer. The value can be NULL.
-    void SetValueMaybeNull(TADDR base, PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        m_ptr = dac_cast<TADDR>(addr);
-    }
-
-    // Set encoded value of the pointer. The value can be NULL.
-    // Does not need explicit base and thus can be used in non-DAC builds only.
-    FORCEINLINE void SetValueMaybeNull(PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        return SetValueMaybeNull((TADDR)this, addr);
-    }
-
-    // Static version of SetValueMaybeNull. It is meant to simplify access to arrays of pointers.
-    FORCEINLINE static void SetValueMaybeNullAtPtr(TADDR base, PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        dac_cast<DPTR(PlainPointer<PTR_TYPE>)>(base)->SetValueMaybeNull(base, addr);
-    }
-
-    FORCEINLINE void SetValueVolatile(PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        VolatileStore((PTR_TYPE *)(&m_ptr), addr);
-    }
-#endif
-
-    static TADDR GetRelativeMaybeNull(TADDR base, TADDR addr)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return addr;
-    }
-
-    static TADDR GetRelative(TADDR base, TADDR addr)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        PRECONDITION(addr != NULL);
-        return addr;
-    }
-
-private:
-    TADDR m_ptr;
-};
-
-#define FixupPointer PlainPointer
-#define RelativePointer PlainPointer
-#define RelativeFixupPointer PlainPointer
-
-//----------------------------------------------------------------------------
-// RelativePointer32 is pointer encoded as relative 32-bit offset. It is used
-// to reduce both the size of the pointer itself as well as size of relocation
-// section for pointers that live exlusively in NGen images.
-template<typename PTR_TYPE>
-class RelativePointer32
-{
-public:
-
-    static constexpr bool isRelative = true;
-    typedef PTR_TYPE type;
-
-    // Returns whether the encoded pointer is NULL.
-    BOOL IsNull() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        // Pointer pointing to itself is treated as NULL
-        return m_delta == 0;
-    }
-
-    // Returns value of the encoded pointer. Assumes that the pointer is not NULL.
-    PTR_TYPE GetValue(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        PRECONDITION(!IsNull());
-        return dac_cast<PTR_TYPE>(base + m_delta);
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns value of the encoded pointer. Assumes that the pointer is not NULL.
-    // Does not need explicit base and thus can be used in non-DAC builds only.
-    FORCEINLINE PTR_TYPE GetValue() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return GetValue((TADDR)this);
-    }
-#endif
-
-    // Static version of GetValue. It is meant to simplify access to arrays of pointers.
-    FORCEINLINE static PTR_TYPE GetValueAtPtr(TADDR base)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(RelativePointer<PTR_TYPE>)>(base)->GetValue(base);
-    }
-
-    // Returns value of the encoded pointer. The pointer can be NULL.
-    PTR_TYPE GetValueMaybeNull(TADDR base) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-
-        // Cache local copy of delta to avoid races when the value is changing under us.
-        TADDR delta = m_delta;
-
-        if (delta == 0)
-            return NULL;
-
-        return dac_cast<PTR_TYPE>(base + delta);
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns value of the encoded pointer. The pointer can be NULL.
-    // Does not need explicit base and thus can be used in non-DAC builds only.
-    FORCEINLINE PTR_TYPE GetValueMaybeNull() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return GetValueMaybeNull((TADDR)this);
-    }
-#endif
-
-    // Static version of GetValueMaybeNull. It is meant to simplify access to arrays of pointers.
-    FORCEINLINE static PTR_TYPE GetValueMaybeNullAtPtr(TADDR base)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(RelativePointer<PTR_TYPE>)>(base)->GetValueMaybeNull(base);
-    }
-
-private:
-    INT32 m_delta;
-};
-
-//----------------------------------------------------------------------------
-// IndirectPointer is pointer with optional indirection, similar to FixupPointer and RelativeFixupPointer.
-//
-// In comparison to FixupPointer, IndirectPointer's indirection is handled from outside by isIndirect flag.
-// In comparison to RelativeFixupPointer, IndirectPointer's offset is a constant,
-// while RelativeFixupPointer's offset is an address.
-//
-// IndirectPointer can contain NULL only if it is not indirect.
-//
-template<typename PTR_TYPE>
-class IndirectPointer
-{
-public:
-
-    static constexpr bool isRelative = false;
-    typedef PTR_TYPE type;
-
-    // Returns whether the encoded pointer is NULL.
-    BOOL IsNull() const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return m_addr == (TADDR)NULL;
-    }
-
-    // Returns whether the indirection cell contain fixup that has not been converted to real pointer yet.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    FORCEINLINE BOOL IsTaggedIndirect(TADDR base, bool isIndirect, intptr_t offset) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        TADDR addr = m_addr;
-        if (isIndirect)
-        {
-            _ASSERTE(!IsNull());
-            return (*PTR_TADDR(addr + offset) & 1) != 0;
-        }
-        return FALSE;
-    }
-
-    // Returns value of the encoded pointer.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    FORCEINLINE PTR_TYPE GetValueIndirect(bool isIndirect, intptr_t offset) const
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        TADDR addr = m_addr;
-        if (isIndirect)
-        {
-            _ASSERTE(!IsNull());
-            addr = *PTR_TADDR(addr + offset);
-        }
-        return dac_cast<PTR_TYPE>(addr);
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns the pointer to the indirection cell.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    PTR_TYPE * GetValuePtrIndirect(bool isIndirect, intptr_t offset) const
-    {
-        LIMITED_METHOD_CONTRACT;
-        TADDR addr = m_addr;
-        if (isIndirect)
-        {
-            _ASSERTE(!IsNull());
-            return (PTR_TYPE *)(addr + offset);
-        }
-        return (PTR_TYPE *)&m_addr;
-    }
-#endif // !DACCESS_COMPILE
-
-    // Static version of GetValue. It is meant to simplify access to arrays of pointers.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    FORCEINLINE static PTR_TYPE GetValueAtPtrIndirect(TADDR base, bool isIndirect, intptr_t offset)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(IndirectPointer<PTR_TYPE>)>(base)->GetValueIndirect(isIndirect, offset);
-    }
-
-    // Static version of GetValueMaybeNull. It is meant to simplify access to arrays of pointers.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    FORCEINLINE static PTR_TYPE GetValueMaybeNullAtPtrIndirect(TADDR base, bool isIndirect, intptr_t offset)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        return GetValueAtPtrIndirect(base, isIndirect, offset);
-    }
-
-#ifndef DACCESS_COMPILE
-    // Returns whether pointer is indirect. Assumes that the value is not NULL.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    bool IsIndirectPtrIndirect(bool isIndirect, intptr_t offset) const
-    {
-        LIMITED_METHOD_CONTRACT;
-        if (isIndirect)
-            _ASSERTE(!IsNull());
-        return isIndirect;
-    }
-
-    // Returns whether pointer is indirect. The value can be NULL.
-    // Uses isIndirect to identify, whether pointer is indirect or not. If it is, uses offset.
-    bool IsIndirectPtrMaybeNullIndirect(bool isIndirect, intptr_t offset) const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return IsIndirectPtrIndirect(isIndirect, offset);
-    }
-#endif // !DACCESS_COMPILE
-
-#ifndef DACCESS_COMPILE
-    // Set encoded value of the pointer. Assumes that the value is not NULL.
-    void SetValue(PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        m_addr = dac_cast<TADDR>(addr);
-    }
-
-    // Set encoded value of the pointer. The value can be NULL.
-    void SetValueMaybeNull(PTR_TYPE addr)
-    {
-        LIMITED_METHOD_CONTRACT;
-        SetValue(addr);
-    }
-#endif // !DACCESS_COMPILE
-
-private:
-    TADDR m_addr;
-};
-
-template<bool isMaybeNull, typename T, typename PT>
-typename PT::type
-ReadPointer(const T *base, const PT T::* pPointerFieldMember)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    uintptr_t offset = (uintptr_t) &(base->*pPointerFieldMember) - (uintptr_t) base;
-
-    if (isMaybeNull)
-    {
-        return PT::GetValueMaybeNullAtPtr(dac_cast<TADDR>(base) + offset);
-    }
-    else
-    {
-        return PT::GetValueAtPtr(dac_cast<TADDR>(base) + offset);
-    }
-}
-
-template<bool isMaybeNull, typename T, typename PT>
-typename PT::type
-ReadPointer(const T *base, const PT T::* pPointerFieldMember, bool isIndirect)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    uintptr_t offset = (uintptr_t) &(base->*pPointerFieldMember) - (uintptr_t) base;
-
-    if (isMaybeNull)
-    {
-        return PT::GetValueMaybeNullAtPtrIndirect(dac_cast<TADDR>(base) + offset, isIndirect, offset);
-    }
-    else
-    {
-        return PT::GetValueAtPtrIndirect(dac_cast<TADDR>(base) + offset, isIndirect, offset);
-    }
-}
-
-template<typename T, typename PT>
-typename PT::type
-ReadPointerMaybeNull(const T *base, const PT T::* pPointerFieldMember)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return ReadPointer<true>(base, pPointerFieldMember);
-}
-
-template<typename T, typename PT>
-typename PT::type
-ReadPointerMaybeNull(const T *base, const PT T::* pPointerFieldMember, bool isIndirect)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return ReadPointer<true>(base, pPointerFieldMember, isIndirect);
-}
-
-template<typename T, typename PT>
-typename PT::type
-ReadPointer(const T *base, const PT T::* pPointerFieldMember)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return ReadPointer<false>(base, pPointerFieldMember);
-}
-
-template<typename T, typename PT>
-typename PT::type
-ReadPointer(const T *base, const PT T::* pPointerFieldMember, bool isIndirect)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return ReadPointer<false>(base, pPointerFieldMember, isIndirect);
-}
-
-template<bool isMaybeNull, typename T, typename C, typename PT>
-typename PT::type
-ReadPointer(const T *base, const C T::* pFirstPointerFieldMember, const PT C::* pSecondPointerFieldMember)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    const PT *ptr = &(base->*pFirstPointerFieldMember.*pSecondPointerFieldMember);
-    uintptr_t offset = (uintptr_t) ptr - (uintptr_t) base;
-
-    if (isMaybeNull)
-    {
-        return PT::GetValueMaybeNullAtPtr(dac_cast<TADDR>(base) + offset);
-    }
-    else
-    {
-        return PT::GetValueAtPtr(dac_cast<TADDR>(base) + offset);
-    }
-}
-
-template<typename T, typename C, typename PT>
-typename PT::type
-ReadPointerMaybeNull(const T *base, const C T::* pFirstPointerFieldMember, const PT C::* pSecondPointerFieldMember)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return ReadPointer<true>(base, pFirstPointerFieldMember, pSecondPointerFieldMember);
-}
-
-template<typename T, typename C, typename PT>
-typename PT::type
-ReadPointer(const T *base, const C T::* pFirstPointerFieldMember, const PT C::* pSecondPointerFieldMember)
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return ReadPointer<false>(base, pFirstPointerFieldMember, pSecondPointerFieldMember);
-}
-
-#endif //_FIXUPPOINTER_H
index 5347e41..86c74f6 100644 (file)
@@ -599,7 +599,7 @@ INT32 rel32UsingJumpStub(INT32 UNALIGNED * pRel32, PCODE target, MethodDesc *pMe
         PRECONDITION(pLoaderAllocator != NULL || pMethod->GetLoaderAllocator() != NULL);
         // If a domain is provided, the MethodDesc mustn't yet be set up to have one, or it must match the MethodDesc's domain,
         // unless we're in a compilation domain (NGen loads assemblies as domain-bound but compiles them as domain neutral).
-        PRECONDITION(!pLoaderAllocator || !pMethod || pMethod->GetMethodDescChunk()->GetMethodTablePtr()->IsNull() ||
+        PRECONDITION(!pLoaderAllocator || !pMethod || pMethod->GetMethodDescChunk()->GetMethodTable() == NULL ||
             pLoaderAllocator == pMethod->GetMethodDescChunk()->GetFirstMethodDesc()->GetLoaderAllocator());
     }
     CONTRACTL_END;
@@ -1012,8 +1012,6 @@ PCODE DynamicHelpers::CreateDictionaryLookupHelper(LoaderAllocator * pAllocator,
 {
     STANDARD_VM_CONTRACT;
 
-    _ASSERTE(!MethodTable::IsPerInstInfoRelative());
-
     PCODE helperAddress = (pLookup->helper == CORINFO_HELP_RUNTIMEHANDLE_METHOD ?
         GetEEFuncEntryPoint(JIT_GenericHandleMethodWithSlotAndModule) :
         GetEEFuncEntryPoint(JIT_GenericHandleClassWithSlotAndModule));
index 70b2de5..d579633 100644 (file)
@@ -827,7 +827,6 @@ void VTableCallHolder::Initialize(unsigned slot)
 {
     unsigned offsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(slot) * TARGET_POINTER_SIZE;
     unsigned offsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(slot) * TARGET_POINTER_SIZE;
-    _ASSERTE(MethodTable::VTableIndir_t::isRelative == false /* TODO: NYI */);
 
     VTableCallStub* pStub = stub();
     BYTE* p = (BYTE*)pStub->entryPoint();
index 52f4052..844ba08 100644 (file)
@@ -1559,11 +1559,6 @@ VOID StubLinkerCPU::EmitShuffleThunk(ShuffleEntry *pShuffleEntryArray)
 
 void StubLinkerCPU::ThumbEmitTailCallManagedMethod(MethodDesc *pMD)
 {
-    bool isRelative = MethodTable::VTableIndir2_t::isRelative
-                      && pMD->IsVtableSlot();
-
-    _ASSERTE(!isRelative);
-
     // Use direct call if possible.
     if (pMD->HasStableEntryPoint())
     {
@@ -1575,33 +1570,12 @@ void StubLinkerCPU::ThumbEmitTailCallManagedMethod(MethodDesc *pMD)
         // mov r12, #slotaddress
         ThumbEmitMovConstant(ThumbReg(12), (TADDR)pMD->GetAddrOfSlot());
 
-        if (isRelative)
-        {
-            // mov r4, r12
-            ThumbEmitMovRegReg(ThumbReg(4), ThumbReg(12));
-        }
-
         // ldr r12, [r12]
         ThumbEmitLoadRegIndirect(ThumbReg(12), ThumbReg(12), 0);
-
-        if (isRelative)
-        {
-            // add r12, r4
-            ThumbEmitAddReg(ThumbReg(12), ThumbReg(4));
-        }
     }
 
-    if (!isRelative)
-    {
-        // bx r12
-        ThumbEmitJumpRegister(ThumbReg(12));
-    }
-    else
-    {
-        // Replace LR with R12 on stack: hybrid-tail call, same as for EmitShuffleThunk
-        // str r12, [sp, 4]
-        ThumbEmitStoreRegIndirect(ThumbReg(12), thumbRegSp, 4);
-    }
+    // bx r12
+    ThumbEmitJumpRegister(ThumbReg(12));
 }
 
 VOID StubLinkerCPU::EmitComputedInstantiatingMethodStub(MethodDesc* pSharedMD, struct ShuffleEntry *pShuffleEntryArray, void* extraArg)
@@ -1659,22 +1633,7 @@ VOID StubLinkerCPU::EmitComputedInstantiatingMethodStub(MethodDesc* pSharedMD, s
         ThumbEmitIncrement(ThumbReg(0), sizeof(MethodTable*));
     }
 
-    bool isRelative = MethodTable::VTableIndir2_t::isRelative
-                      && pSharedMD->IsVtableSlot();
-
-    _ASSERTE(!isRelative);
-
-    if (isRelative)
-    {
-        ThumbEmitProlog(1, 0, FALSE);
-    }
-
     ThumbEmitTailCallManagedMethod(pSharedMD);
-
-    if (isRelative)
-    {
-        ThumbEmitEpilog();
-    }
 }
 
 
@@ -2245,8 +2204,6 @@ PCODE DynamicHelpers::CreateDictionaryLookupHelper(LoaderAllocator * pAllocator,
 {
     STANDARD_VM_CONTRACT;
 
-    _ASSERTE(!MethodTable::IsPerInstInfoRelative());
-
     PCODE helperAddress = (pLookup->helper == CORINFO_HELP_RUNTIMEHANDLE_METHOD ?
         GetEEFuncEntryPoint(JIT_GenericHandleMethodWithSlotAndModule) :
         GetEEFuncEntryPoint(JIT_GenericHandleClassWithSlotAndModule));
index 38065f2..041c826 100644 (file)
@@ -424,7 +424,6 @@ void VTableCallHolder::Initialize(unsigned slot)
 {
     unsigned offsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(slot) * TARGET_POINTER_SIZE;
     unsigned offsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(slot) * TARGET_POINTER_SIZE;
-    _ASSERTE(MethodTable::VTableIndir_t::isRelative == false /* TODO: NYI */);
 
     VTableCallStub* pStub = stub();
     BYTE* p = (BYTE*)(pStub->entryPoint() & ~THUMB_CODE);
index 3448dba..44b42cd 100644 (file)
@@ -2058,8 +2058,6 @@ PCODE DynamicHelpers::CreateDictionaryLookupHelper(LoaderAllocator * pAllocator,
 {
     STANDARD_VM_CONTRACT;
 
-    _ASSERTE(!MethodTable::IsPerInstInfoRelative());
-
     PCODE helperAddress = (pLookup->helper == CORINFO_HELP_RUNTIMEHANDLE_METHOD ?
         GetEEFuncEntryPoint(JIT_GenericHandleMethodWithSlotAndModule) :
         GetEEFuncEntryPoint(JIT_GenericHandleClassWithSlotAndModule));
index bdb7861..4944b19 100644 (file)
@@ -508,7 +508,6 @@ void VTableCallHolder::Initialize(unsigned slot)
 {
     unsigned offsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(slot) * TARGET_POINTER_SIZE;
     unsigned offsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(slot) * TARGET_POINTER_SIZE;
-    _ASSERTE(MethodTable::VTableIndir_t::isRelative == false /* TODO: NYI */);
 
     int indirectionsCodeSize = (offsetOfIndirection >= 0x8000 ? 8 : 4) + (offsetAfterIndirection >= 0x8000 ? 8 : 4);
     int indirectionsDataSize = (offsetOfIndirection >= 0x8000 ? 4 : 0) + (offsetAfterIndirection >= 0x8000 ? 4 : 0);
index 6728816..bbe3528 100644 (file)
@@ -230,7 +230,7 @@ void ArrayClass::InitArrayMethodDesc(
     _ASSERTE(pNewMD->GetMethodName() && GetDebugClassName());
     pNewMD->m_pszDebugMethodName = pNewMD->GetMethodName();
     pNewMD->m_pszDebugClassName  = GetDebugClassName();
-    pNewMD->m_pDebugMethodTable.SetValue(pNewMD->GetMethodTable());
+    pNewMD->m_pDebugMethodTable = pNewMD->GetMethodTable();
 #endif // _DEBUG
 }
 
@@ -500,7 +500,7 @@ MethodTable* Module::CreateArrayMethodTable(TypeHandle elemTypeHnd, CorElementTy
             if (canShareVtableChunks)
             {
                 // Share the parent chunk
-                it.SetIndirectionSlot(pParentClass->GetVtableIndirections()[it.GetIndex()].GetValueMaybeNull());
+                it.SetIndirectionSlot(pParentClass->GetVtableIndirections()[it.GetIndex()]);
             }
             else
             {
index 7c8c2d5..7f84ced 100644 (file)
@@ -2051,7 +2051,7 @@ BOOL Module::IsPreV4Assembly()
 }
 
 
-ArrayDPTR(RelativeFixupPointer<PTR_MethodTable>) ModuleCtorInfo::GetGCStaticMTs(DWORD index)
+ArrayDPTR(PTR_MethodTable) ModuleCtorInfo::GetGCStaticMTs(DWORD index)
 {
     LIMITED_METHOD_CONTRACT;
 
@@ -7853,7 +7853,7 @@ ModuleCtorInfo::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
 
     // This class is contained so do not enumerate 'this'.
     DacEnumMemoryRegion(dac_cast<TADDR>(ppMT), numElements *
-                        sizeof(RelativePointer<MethodTable *>));
+                        sizeof(MethodTable *));
     DacEnumMemoryRegion(dac_cast<TADDR>(cctorInfoHot), numElementsHot *
                         sizeof(ClassCtorInfoEntry));
     DacEnumMemoryRegion(dac_cast<TADDR>(cctorInfoCold),
index dd4df50..1b7af35 100644 (file)
@@ -398,7 +398,7 @@ struct ModuleCtorInfo
     DWORD                   numElements;
     DWORD                   numLastAllocated;
     DWORD                   numElementsHot;
-    DPTR(RelativePointer<PTR_MethodTable>) ppMT; // size is numElements
+    DPTR(PTR_MethodTable)   ppMT; // size is numElements
     PTR_ClassCtorInfoEntry  cctorInfoHot;   // size is numElementsHot
     PTR_ClassCtorInfoEntry  cctorInfoCold;  // size is numElements-numElementsHot
 
@@ -407,8 +407,8 @@ struct ModuleCtorInfo
     DWORD                   numHotHashes;
     DWORD                   numColdHashes;
 
-    ArrayDPTR(RelativeFixupPointer<PTR_MethodTable>) ppHotGCStaticsMTs;            // hot table
-    ArrayDPTR(RelativeFixupPointer<PTR_MethodTable>) ppColdGCStaticsMTs;           // cold table
+    ArrayDPTR(PTR_MethodTable) ppHotGCStaticsMTs;            // hot table
+    ArrayDPTR(PTR_MethodTable) ppColdGCStaticsMTs;           // cold table
 
     DWORD                   numHotGCStaticsMTs;
     DWORD                   numColdGCStaticsMTs;
@@ -444,12 +444,12 @@ struct ModuleCtorInfo
         return hashVal;
     };
 
-    ArrayDPTR(RelativeFixupPointer<PTR_MethodTable>) GetGCStaticMTs(DWORD index);
+    ArrayDPTR(PTR_MethodTable) GetGCStaticMTs(DWORD index);
 
     PTR_MethodTable GetMT(DWORD i)
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return ppMT[i].GetValue(dac_cast<TADDR>(ppMT) + i * sizeof(RelativePointer<PTR_MethodTable>));
+        return ppMT[i];
     }
 
 };
index bc7bc60..ab6b7e5 100644 (file)
@@ -17,7 +17,7 @@ TYPE LookupMap<TYPE>::GetValueAt(PTR_TADDR pValue, TADDR* pFlags, TADDR supporte
 {
     WRAPPER_NO_CONTRACT;
     SUPPORTS_DAC;
-    TYPE value = RelativePointer<TYPE>::GetValueMaybeNullAtPtr(dac_cast<TADDR>(pValue));
+    TYPE value = dac_cast<TYPE>(*pValue);
 
     if (pFlags)
         *pFlags = dac_cast<TADDR>(value) & supportedFlags;
@@ -33,10 +33,9 @@ void LookupMap<TYPE>::SetValueAt(PTR_TADDR pValue, TYPE value, TADDR flags)
 {
     WRAPPER_NO_CONTRACT;
 
-    value = (TYPE)(dac_cast<TADDR>(value) | flags);
+    value = dac_cast<TYPE>((dac_cast<TADDR>(value) | flags));
 
-    RelativePointer<TYPE> *pRelPtr = (RelativePointer<TYPE> *)pValue;
-    pRelPtr->SetValue(value);
+    *(dac_cast<DPTR(TYPE)>(pValue)) = value;
 }
 
 //
@@ -65,70 +64,6 @@ void LookupMap<SIZE_T>::SetValueAt(PTR_TADDR pValue, SIZE_T value, TADDR flags)
 }
 #endif // DACCESS_COMPILE
 
-//
-// Specialization of GetValueAt methods for tables with cross-module references
-//
-template<>
-inline
-PTR_TypeRef LookupMap<PTR_TypeRef>::GetValueAt(PTR_TADDR pValue, TADDR* pFlags, TADDR supportedFlags)
-{
-    WRAPPER_NO_CONTRACT;
-    SUPPORTS_DAC;
-
-    // Strip flags before RelativeFixupPointer dereference
-    TADDR value = *pValue;
-
-    TADDR flags = (value & supportedFlags);
-    value -= flags;
-    value = ((RelativeFixupPointer<TADDR>&)(value)).GetValueMaybeNull(dac_cast<TADDR>(pValue));
-
-    if (pFlags)
-        *pFlags = flags;
-
-    return dac_cast<PTR_TypeRef>(value);
-}
-
-template<>
-inline
-PTR_Module LookupMap<PTR_Module>::GetValueAt(PTR_TADDR pValue, TADDR* pFlags, TADDR supportedFlags)
-{
-    WRAPPER_NO_CONTRACT;
-    SUPPORTS_DAC;
-
-    // Strip flags before RelativeFixupPointer dereference
-    TADDR value = *pValue;
-
-    TADDR flags = (value & supportedFlags);
-    value -= flags;
-    value = ((RelativeFixupPointer<TADDR>&)(value)).GetValueMaybeNull(dac_cast<TADDR>(pValue));
-
-    if (pFlags)
-        *pFlags = flags;
-
-    return dac_cast<PTR_Module>(value);
-}
-
-template<>
-inline
-PTR_MemberRef LookupMap<PTR_MemberRef>::GetValueAt(PTR_TADDR pValue, TADDR* pFlags, TADDR supportedFlags)
-{
-    WRAPPER_NO_CONTRACT;
-    SUPPORTS_DAC;
-
-    // Strip flags before RelativeFixupPointer dereference
-    TADDR value = *pValue;
-
-    TADDR flags = (value & supportedFlags);
-    value -= flags;
-    value = ((RelativeFixupPointer<TADDR>&)(value)).GetValueMaybeNull(dac_cast<TADDR>(pValue));
-
-    if (pFlags)
-        *pFlags = flags;
-
-    return dac_cast<PTR_MemberRef>(value);
-
-}
-
 // Retrieve the value associated with a rid
 template<typename TYPE>
 TYPE LookupMap<TYPE>::GetElement(DWORD rid, TADDR* pFlags)
index 62d0f71..803ee9a 100644 (file)
@@ -877,15 +877,7 @@ ClassLoader::LoadExactParentAndInterfacesTransitively(MethodTable *pMT)
             LOG((LF_CLASSLOADER, LL_INFO1000, "GENERICS: Replaced approximate parent %s with exact parent %s from token %x\n", pParentMT->GetDebugClassName(), pNewParentMT->GetDebugClassName(), crExtends));
 
             // SetParentMethodTable is not used here since we want to update the indirection cell in the NGen case
-            if (pMT->IsParentMethodTableIndirectPointerMaybeNull())
-            {
-                *pMT->GetParentMethodTableValuePtr() = pNewParentMT;
-            }
-            else
-            {
-                pMT->GetParentMethodTablePointerPtr()->SetValueMaybeNull(pNewParentMT);
-            }
-
+            *pMT->GetParentMethodTableValuePtr() = pNewParentMT;
             pParentMT = pNewParentMT;
         }
     }
@@ -903,9 +895,9 @@ ClassLoader::LoadExactParentAndInterfacesTransitively(MethodTable *pMT)
         DWORD nDicts = pParentMT->GetNumDicts();
         for (DWORD iDict = 0; iDict < nDicts; iDict++)
         {
-            if (pMT->GetPerInstInfo()[iDict].GetValueMaybeNull() != pParentMT->GetPerInstInfo()[iDict].GetValueMaybeNull())
+            if (pMT->GetPerInstInfo()[iDict] != pParentMT->GetPerInstInfo()[iDict])
             {
-                pMT->GetPerInstInfo()[iDict].SetValueMaybeNull(pParentMT->GetPerInstInfo()[iDict].GetValueMaybeNull());
+                pMT->GetPerInstInfo()[iDict] = pParentMT->GetPerInstInfo()[iDict];
             }
         }
     }
index 9fe55a9..e54342f 100644 (file)
@@ -550,7 +550,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
-    RelativePointer<PTR_BYTE> m_pVarianceInfo;
+    PTR_BYTE m_pVarianceInfo;
 
     //
     // COM RELATED FIELDS.
@@ -591,7 +591,7 @@ class EEClassOptionalFields
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        return ReadPointerMaybeNull(this, &EEClassOptionalFields::m_pVarianceInfo);
+        return m_pVarianceInfo;
     }
 };
 typedef DPTR(EEClassOptionalFields) PTR_EEClassOptionalFields;
@@ -842,7 +842,7 @@ public:
         LIMITED_METHOD_CONTRACT;
         SUPPORTS_DAC;
 
-        return ReadPointerMaybeNull(this, &EEClass::m_pMethodTable);
+        return m_pMethodTable;
     }
 
     // DO NOT ADD ANY ASSERTS TO THIS METHOD.
@@ -859,14 +859,14 @@ public:
         CANNOT_HAVE_CONTRACT;
         SUPPORTS_DAC;
 
-        return ReadPointerMaybeNull(this, &EEClass::m_pMethodTable);
+        return m_pMethodTable;
     }
 
 #ifndef DACCESS_COMPILE
     inline void SetMethodTable(MethodTable*  pMT)
     {
         LIMITED_METHOD_CONTRACT;
-        m_pMethodTable.SetValueMaybeNull(pMT);
+        m_pMethodTable = pMT;
     }
 #endif // !DACCESS_COMPILE
 
@@ -1075,7 +1075,7 @@ public:
         LIMITED_METHOD_DAC_CONTRACT;
         // Careful about using this method. If it's possible that fields may have been added via EnC, then
         // must use the FieldDescIterator as any fields added via EnC won't be in the raw list
-        return m_pFieldDescList.GetValueMaybeNull(PTR_HOST_MEMBER_TADDR(EEClass, this, m_pFieldDescList));
+        return m_pFieldDescList;
     }
 
     PTR_FieldDesc GetFieldDescByIndex(DWORD fieldIndex);
@@ -1084,7 +1084,7 @@ public:
     inline void SetFieldDescList (FieldDesc* pFieldDescList)
     {
         LIMITED_METHOD_CONTRACT;
-        m_pFieldDescList.SetValue(pFieldDescList);
+        m_pFieldDescList = pFieldDescList;
     }
 #endif // !DACCESS_COMPILE
 
@@ -1424,7 +1424,7 @@ public:
     inline void SetChunks (MethodDescChunk* pChunks)
     {
         LIMITED_METHOD_CONTRACT;
-        m_pChunks.SetValueMaybeNull(pChunks);
+        m_pChunks = pChunks;
     }
 #endif // !DACCESS_COMPILE
     void AddChunk (MethodDescChunk* pNewChunk);
@@ -1435,14 +1435,14 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        return ReadPointerMaybeNull(this, &EEClass::m_pGuidInfo);
+        return m_pGuidInfo;
     }
 
     inline void SetGuidInfo(GuidInfo* pGuidInfo)
     {
         WRAPPER_NO_CONTRACT;
         #ifndef DACCESS_COMPILE
-        m_pGuidInfo.SetValueMaybeNull(pGuidInfo);
+        m_pGuidInfo = pGuidInfo;
         #endif // DACCESS_COMPILE
     }
 
@@ -1600,7 +1600,7 @@ public:
     {
         LIMITED_METHOD_CONTRACT;
         _ASSERTE(HasOptionalFields());
-        GetOptionalFields()->m_pVarianceInfo.SetValueMaybeNull(pVarianceInfo);
+        GetOptionalFields()->m_pVarianceInfo = pVarianceInfo;
     }
 #endif // !DACCESS_COMPILE
 
@@ -1722,7 +1722,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.
-    RelativePointer<PTR_GuidInfo> m_pGuidInfo;  // The cached guid information for interfaces.
+    PTR_GuidInfo m_pGuidInfo;  // The cached guid information for interfaces.
 
 #ifdef _DEBUG
 public:
@@ -1733,13 +1733,13 @@ public:
 private:
     // Layout rest of fields below from largest to smallest to lessen the chance of wasting bytes with
     // compiler injected padding (especially with the difference between pointers and DWORDs on 64-bit).
-    RelativePointer<PTR_EEClassOptionalFields> m_rpOptionalFields;
+    PTR_EEClassOptionalFields m_rpOptionalFields;
 
     // TODO: Remove this field. It is only used by SOS and object validation for stress.
-    RelativePointer<PTR_MethodTable> m_pMethodTable;
+    PTR_MethodTable m_pMethodTable;
 
-    RelativePointer<PTR_FieldDesc> m_pFieldDescList;
-    RelativePointer<PTR_MethodDescChunk> m_pChunks;
+    PTR_FieldDesc m_pFieldDescList;
+    PTR_MethodDescChunk m_pChunks;
 
 #ifdef FEATURE_COMINTEROP
     union
@@ -1784,22 +1784,22 @@ public:
     void AttachOptionalFields(EEClassOptionalFields *pFields)
     {
         LIMITED_METHOD_CONTRACT;
-        _ASSERTE(m_rpOptionalFields.IsNull());
+        _ASSERTE(m_rpOptionalFields == NULL);
 
-        m_rpOptionalFields.SetValue(pFields);
+        m_rpOptionalFields = pFields;
     }
 #endif // !DACCESS_COMPILE
 
     bool HasOptionalFields()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return !m_rpOptionalFields.IsNull();
+        return m_rpOptionalFields != NULL;
     }
 
     PTR_EEClassOptionalFields GetOptionalFields()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return m_rpOptionalFields.GetValueMaybeNull(PTR_HOST_MEMBER_TADDR(EEClass, this, m_rpOptionalFields));
+        return m_rpOptionalFields;
     }
 
 private:
@@ -1930,12 +1930,12 @@ public:
     DAC_ALIGNAS(EEClass) // Align the first member to the alignment of the base class
     PTR_Stub                         m_pStaticCallStub;
     PTR_Stub                         m_pInstRetBuffCallStub;
-    RelativePointer<PTR_MethodDesc>  m_pInvokeMethod;
+    PTR_MethodDesc                   m_pInvokeMethod;
     PTR_Stub                         m_pMultiCastInvokeStub;
     PTR_Stub                         m_pWrapperDelegateInvokeStub;
     UMThunkMarshInfo*                m_pUMThunkMarshInfo;
-    RelativePointer<PTR_MethodDesc>  m_pBeginInvokeMethod;
-    RelativePointer<PTR_MethodDesc>  m_pEndInvokeMethod;
+    PTR_MethodDesc                   m_pBeginInvokeMethod;
+    PTR_MethodDesc                   m_pEndInvokeMethod;
     Volatile<PCODE>                  m_pMarshalStub;
 
 #ifdef FEATURE_COMINTEROP
@@ -1951,17 +1951,17 @@ public:
 
     PTR_MethodDesc GetInvokeMethod()
     {
-        return ReadPointer(this, &DelegateEEClass::m_pInvokeMethod);
+        return m_pInvokeMethod;
     }
 
     PTR_MethodDesc GetBeginInvokeMethod()
     {
-        return ReadPointer(this, &DelegateEEClass::m_pBeginInvokeMethod);
+        return m_pBeginInvokeMethod;
     }
 
     PTR_MethodDesc GetEndInvokeMethod()
     {
-        return ReadPointer(this, &DelegateEEClass::m_pEndInvokeMethod);
+        return m_pEndInvokeMethod;
     }
 
 #ifndef DACCESS_COMPILE
index 2cf76e4..92426a3 100644 (file)
@@ -10,7 +10,7 @@
 inline PTR_MethodDescChunk EEClass::GetChunks()
 {
     LIMITED_METHOD_DAC_CONTRACT;
-    return m_pChunks.GetValueMaybeNull(PTR_HOST_MEMBER_TADDR(EEClass, this, m_pChunks));
+    return m_pChunks;
 }
 
 //*******************************************************************************
@@ -20,7 +20,7 @@ inline void EEClassOptionalFields::Init()
 {
     LIMITED_METHOD_CONTRACT;
     m_pDictLayout = NULL;
-    m_pVarianceInfo.SetValueMaybeNull(NULL);
+    m_pVarianceInfo = NULL;
 #ifdef FEATURE_COMINTEROP
     m_pSparseVTableMap = NULL;
     m_pCoClassForIntf = TypeHandle();
index e745059..b306121 100644 (file)
@@ -37,11 +37,6 @@ PTR_VOID EEClassHashEntry::GetData()
     }
     CONTRACTL_END;
 
-    // TypeHandles are encoded as a relative pointer rather than a regular pointer to avoid the need for image
-    // fixups (any TypeHandles in this hash are defined in the same module).
-    if ((dac_cast<TADDR>(m_Data) & EECLASSHASH_TYPEHANDLE_DISCR) == 0)
-        return RelativePointer<PTR_VOID>::GetValueMaybeNullAtPtr(PTR_HOST_INT_MEMBER_TADDR(EEClassHashEntry, this, m_Data));
-
     return m_Data;
 }
 
@@ -56,15 +51,7 @@ void EEClassHashEntry::SetData(void *data)
     }
     CONTRACTL_END;
 
-    // TypeHandles are encoded as a relative pointer rather than a regular pointer to avoid the need for image
-    // fixups (any TypeHandles in this hash are defined in the same module).
-    if (((TADDR)data & EECLASSHASH_TYPEHANDLE_DISCR) == 0)
-    {
-        RelativePointer<void *> *pRelPtr = (RelativePointer<void *> *) &m_Data;
-        pRelPtr->SetValueMaybeNull(data);
-    }
-    else
-        m_Data = data;
+    m_Data = data;
 }
 
 void EEClassHashEntry::SetEncloser(EEClassHashEntry *pEncloser)
@@ -253,7 +240,7 @@ VOID EEClassHashTable::ConstructKeyFromData(PTR_EEClassHashEntry pEntry, // IN
         // in this case, the lifetime of Key is bounded by the lifetime of cqb, which will free the memory
         // it allocated on destruction.
 
-        _ASSERTE(!m_pModule.IsNull());
+        _ASSERTE(m_pModule != NULL);
         LPSTR        pszName = NULL;
         LPSTR        pszNameSpace = NULL;
         IMDInternalImport *pInternalImport = NULL;
@@ -341,7 +328,7 @@ EEClassHashEntry_t *EEClassHashTable::InsertValue(LPCUTF8 pszNamespace, LPCUTF8
 
     _ASSERTE(pszNamespace != NULL);
     _ASSERTE(pszClassName != NULL);
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
 
     EEClassHashEntry *pEntry = BaseAllocateEntry(pamTracker);
 
@@ -419,7 +406,7 @@ EEClassHashEntry_t *EEClassHashTable::InsertValueIfNotFound(LPCUTF8 pszNamespace
     }
     CONTRACTL_END;
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     _ASSERTE(pszNamespace != NULL);
     _ASSERTE(pszClassName != NULL);
 
@@ -464,7 +451,7 @@ EEClassHashEntry_t *EEClassHashTable::FindItem(LPCUTF8 pszNamespace, LPCUTF8 psz
     }
     CONTRACTL_END;
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     _ASSERTE(pszNamespace != NULL);
     _ASSERTE(pszClassName != NULL);
 
@@ -518,7 +505,7 @@ EEClassHashEntry_t *EEClassHashTable::FindNextNestedClass(const NameHandle* pNam
     }
     CONTRACTL_END;
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     _ASSERTE(pName);
 
     if (pName->GetNameSpace())
@@ -549,7 +536,7 @@ EEClassHashEntry_t *EEClassHashTable::FindNextNestedClass(LPCUTF8 pszNamespace,
     }
     CONTRACTL_END;
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
 
     PTR_EEClassHashEntry pSearch = BaseFindNextEntryByHash(pContext);
 
@@ -582,7 +569,7 @@ EEClassHashEntry_t *EEClassHashTable::FindNextNestedClass(LPCUTF8 pszFullyQualif
     }
     CONTRACTL_END;
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
 
     CQuickBytes szNamespace;
 
@@ -624,7 +611,7 @@ EEClassHashEntry_t * EEClassHashTable::GetValue(LPCUTF8 pszFullyQualifiedName, P
     }
     CONTRACTL_END;
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
 
     CQuickBytes szNamespace;
 
@@ -670,7 +657,7 @@ EEClassHashEntry_t * EEClassHashTable::GetValue(LPCUTF8 pszNamespace, LPCUTF8 ps
     CONTRACTL_END;
 
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     EEClassHashEntry_t *pItem = FindItem(pszNamespace, pszClassName, IsNested, pContext);
     if (pItem)
         *pData = pItem->GetData();
@@ -694,7 +681,7 @@ EEClassHashEntry_t * EEClassHashTable::GetValue(const NameHandle* pName, PTR_VOI
 
 
     _ASSERTE(pName);
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     if(pName->GetNameSpace() == NULL) {
         return GetValue(pName->GetName(), pData, IsNested, pContext);
     }
@@ -737,7 +724,7 @@ BOOL EEClassHashTable::CompareKeys(PTR_EEClassHashEntry pEntry, LPCUTF8 * pKey2)
     CONTRACTL_END;
 
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     _ASSERTE (pEntry);
     _ASSERTE (pKey2);
 
@@ -805,7 +792,7 @@ EEClassHashTable *EEClassHashTable::MakeCaseInsensitiveTable(Module *pModule, Al
 
 
 
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     _ASSERTE(pModule == GetModule());
 
     // Allocate the table and verify that we actually got one.
index 7d23e44..4739d07 100644 (file)
@@ -186,7 +186,7 @@ PCODE ComPlusCall::GetStubForILStub(MethodDesc* pMD, MethodDesc** ppStubMD)
         pComInfo = ComPlusCallInfo::FromMethodDesc(pMD);
         _ASSERTE(pComInfo != NULL);
 
-        _ASSERTE((*ppStubMD) ==  pComInfo->m_pStubMD.GetValue());
+        _ASSERTE((*ppStubMD) ==  pComInfo->m_pStubMD);
 
         if (pComInfo->m_pInterfaceMT == NULL)
         {
@@ -213,10 +213,10 @@ PCODE ComPlusCall::GetStubForILStub(MethodDesc* pMD, MethodDesc** ppStubMD)
         DWORD dwStubFlags;
         pComInfo = ComPlusCall::PopulateComPlusCallMethodDesc(pMD, &dwStubFlags);
 
-        if (!pComInfo->m_pStubMD.IsNull())
+        if (pComInfo->m_pStubMD != NULL)
         {
             // Discard pre-implemented code
-            PCODE pPreImplementedCode = pComInfo->m_pStubMD.GetValue()->GetNativeCode();
+            PCODE pPreImplementedCode = pComInfo->m_pStubMD->GetNativeCode();
             InterlockedCompareExchangeT<PCODE>(pComInfo->GetAddrOfILStubField(), NULL, pPreImplementedCode);
         }
 
@@ -435,13 +435,13 @@ CallsiteDetails CreateCallsiteDetails(_In_ FramedMethodFrame *pFrame)
         DelegateEEClass* delegateCls = (DelegateEEClass*)pMD->GetMethodTable()->GetClass();
         _ASSERTE(pFrame->GetThis()->GetMethodTable()->IsDelegate());
 
-        if (pMD == delegateCls->m_pBeginInvokeMethod.GetValue())
+        if (pMD == delegateCls->m_pBeginInvokeMethod)
         {
             callsiteFlags |= CallsiteDetails::BeginInvoke;
         }
         else
         {
-            _ASSERTE(pMD == delegateCls->m_pEndInvokeMethod.GetValue());
+            _ASSERTE(pMD == delegateCls->m_pEndInvokeMethod);
             callsiteFlags |= CallsiteDetails::EndInvoke;
         }
 
index 8487d47..d10b32c 100644 (file)
@@ -394,8 +394,7 @@ void MethodDesc::PitchNativeCode()
 
     if (HasNativeCodeSlot())
     {
-        RelativePointer<TADDR> *pRelPtr = (RelativePointer<TADDR> *)GetAddrOfNativeCodeSlot();
-        pRelPtr->SetValueMaybeNull(NULL);
+        *GetAddrOfNativeCodeSlot() = NULL;
     }
     else
     {
index 4b8236e..6a06aba 100644 (file)
@@ -296,7 +296,6 @@ inline void ClrRestoreNonvolatileContext(PCONTEXT ContextRecord)
 #include "utilcode.h"
 #include "log.h"
 #include "loaderheap.h"
-#include "fixuppointer.h"
 #include "stgpool.h"
 
 // src/vm
index 67c58eb..17e62fc 100644 (file)
@@ -309,15 +309,13 @@ MethodDesc* AsMethodDesc(size_t addr)
 
             if (isMemoryReadable((TADDR)chunk, sizeof(MethodDescChunk)))
             {
-                RelativeFixupPointer<PTR_MethodTable> * ppMT = chunk->GetMethodTablePtr();
+                PTR_MethodTable * ppMT = chunk->GetMethodTablePtr();
 
-                // The MethodTable is stored as a RelativeFixupPointer which does an
-                // extra indirection if the address is tagged (the low bit is set).
-                // That could AV if we don't check it first.
+                // Access to the MethodTable could AV if we don't check it first.
 
-                if (!ppMT->IsTagged((TADDR)ppMT) || isMemoryReadable((TADDR)ppMT->GetValuePtr(), sizeof(MethodTable*)))
+                if (isMemoryReadable((TADDR)ppMT, sizeof(MethodTable*)))
                 {
-                    if (AsMethodTable((size_t)RelativeFixupPointer<PTR_MethodTable>::GetValueAtPtr((TADDR)ppMT)) != 0)
+                    if (*ppMT != NULL)
                     {
                         pValidMD = pMD;
                     }
index 9bf0a7d..273ca34 100644 (file)
@@ -2142,18 +2142,8 @@ void NDirectStubLinker::DoNDirect(ILCodeStream *pcsEmit, DWORD dwStubFlags, Meth
 #endif // _DEBUG
                 pcsEmit->EmitADD();
 
-                if (decltype(NDirectMethodDesc::ndirect.m_pWriteableData)::isRelative)
-                {
-                    pcsEmit->EmitDUP();
-                }
-
                 pcsEmit->EmitLDIND_I();
 
-                if (decltype(NDirectMethodDesc::ndirect.m_pWriteableData)::isRelative)
-                {
-                    pcsEmit->EmitADD();
-                }
-
                 pcsEmit->EmitLDIND_I();
             }
 #ifdef FEATURE_COMINTEROP
@@ -4393,8 +4383,8 @@ namespace
         }
         else
         {
-            pNMD->ndirect.m_pszLibName.SetValueMaybeNull(libName);
-            pNMD->ndirect.m_pszEntrypointName.SetValueMaybeNull(entryPointName);
+            pNMD->ndirect.m_pszLibName = libName;
+            pNMD->ndirect.m_pszEntrypointName = entryPointName;
         }
 
         // Do not publish incomplete prestub flags or you will introduce a race condition.
@@ -5455,13 +5445,13 @@ MethodDesc* GetStubMethodDescFromInteropMethodDesc(MethodDesc* pMD, DWORD dwStub
     if (pMD->IsNDirect())
     {
         NDirectMethodDesc* pNMD = (NDirectMethodDesc*)pMD;
-        return pNMD->ndirect.m_pStubMD.GetValueMaybeNull();
+        return pNMD->ndirect.m_pStubMD;
     }
 #ifdef FEATURE_COMINTEROP
     else if (pMD->IsComPlusCall() || pMD->IsGenericComPlusCall())
     {
         ComPlusCallInfo *pComInfo = ComPlusCallInfo::FromMethodDesc(pMD);
-        return (pComInfo == NULL ? NULL : pComInfo->m_pStubMD.GetValueMaybeNull());
+        return (pComInfo == NULL ? NULL : pComInfo->m_pStubMD);
     }
 #endif // FEATURE_COMINTEROP
     else if (pMD->IsEEImpl())
index 6b6c5ff..f41d173 100644 (file)
@@ -191,7 +191,7 @@ void DynamicMethodTable::AddMethodsToList()
         pNewMD->SetTemporaryEntryPoint(m_pDomain->GetLoaderAllocator(), &amt);
 
 #ifdef _DEBUG
-        pNewMD->m_pDebugMethodTable.SetValue(m_pMethodTable);
+        pNewMD->m_pDebugMethodTable = m_pMethodTable;
 #endif
 
         if (pPrevMD)
@@ -271,7 +271,7 @@ DynamicMethodDesc* DynamicMethodTable::GetDynamicMethod(BYTE *psig, DWORD sigSiz
     // the store sig part of the method desc
     pNewMD->SetStoredMethodSig((PCCOR_SIGNATURE)psig, sigSize);
     // the dynamic part of the method desc
-    pNewMD->m_pszMethodName.SetValueMaybeNull(name);
+    pNewMD->m_pszMethodName = name;
 
     pNewMD->m_dwExtendedFlags = mdPublic | mdStatic | DynamicMethodDesc::nomdLCGMethod;
 
@@ -880,8 +880,8 @@ void DynamicMethodDesc::Destroy()
     // The m_pSig and m_pszMethodName need to be destroyed after the GetLCGMethodResolver()->Destroy() call
     // otherwise the EEJitManager::CodeHeapIterator could return DynamicMethodDesc with these members NULLed, but
     // the nibble map for the corresponding code memory indicating that this DynamicMethodDesc is still alive.
-    PCODE pSig = m_pSig.GetValue();
-    PTR_CUTF8 pszMethodName = m_pszMethodName.GetValue();
+    PCODE pSig = m_pSig;
+    PTR_CUTF8 pszMethodName = m_pszMethodName;
 
     GetLCGMethodResolver()->Destroy();
     // The current DynamicMethodDesc storage is destroyed at this point
index 8776b3b..bd31bf5 100644 (file)
@@ -39,7 +39,7 @@ class FieldDesc
 #endif
 
   protected:
-    RelativePointer<PTR_MethodTable> m_pMTOfEnclosingClass;  // This is used to hold the log2 of the field size temporarily during class loading.  Yuck.
+    PTR_MethodTable m_pMTOfEnclosingClass;  // This is used to hold the log2 of the field size temporarily during class loading.  Yuck.
 
     // See also: FieldDesc::InitializeFrom method
 
@@ -89,7 +89,7 @@ public:
 #ifndef DACCESS_COMPILE
     void InitializeFrom(const FieldDesc& sourceField, MethodTable *pMT)
     {
-        m_pMTOfEnclosingClass.SetValue(pMT);
+        m_pMTOfEnclosingClass = pMT;
 
         m_mb = sourceField.m_mb;
         m_isStatic = sourceField.m_isStatic;
@@ -122,7 +122,7 @@ public:
     void SetMethodTable(MethodTable* mt)
     {
         LIMITED_METHOD_CONTRACT;
-        m_pMTOfEnclosingClass.SetValue(mt);
+        m_pMTOfEnclosingClass = mt;
     }
 #endif
 
@@ -390,7 +390,7 @@ public:
     PTR_MethodTable GetApproxEnclosingMethodTable_NoLogging()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return m_pMTOfEnclosingClass.GetValue(PTR_HOST_MEMBER_TADDR(FieldDesc, this, m_pMTOfEnclosingClass));
+        return m_pMTOfEnclosingClass;
     }
 
     PTR_MethodTable GetApproxEnclosingMethodTable()
index 497ec98..e08e682 100644 (file)
@@ -530,7 +530,7 @@ Dictionary* Dictionary::GetMethodDictionaryWithSizeCheck(MethodDesc* pMD, ULONG
             *pNewDictionary->GetBackPointerSlot(numGenericArgs) = pDictionary;
 
             // Publish the new dictionary slots to the type.
-            FastInterlockExchangePointer(pIMD->m_pPerInstInfo.GetValuePtr(), pNewDictionary);
+            FastInterlockExchangePointer(&pIMD->m_pPerInstInfo, pNewDictionary);
 
             pDictionary = pNewDictionary;
         }
@@ -589,7 +589,7 @@ Dictionary* Dictionary::GetTypeDictionaryWithSizeCheck(MethodTable* pMT, ULONG s
 
             // Publish the new dictionary slots to the type.
             ULONG dictionaryIndex = pMT->GetNumDicts() - 1;
-            Dictionary** pPerInstInfo = pMT->GetPerInstInfo()->GetValuePtr();
+            Dictionary** pPerInstInfo = pMT->GetPerInstInfo();
             FastInterlockExchangePointer(pPerInstInfo + dictionaryIndex, pNewDictionary);
 
             pDictionary = pNewDictionary;
@@ -725,7 +725,7 @@ Dictionary::PopulateEntry(
 
         // MethodTable is expected to be normalized
         Dictionary* pDictionary = pMT->GetDictionary();
-        _ASSERTE(pDictionary == pMT->GetPerInstInfo()[dictionaryIndex].GetValueMaybeNull());
+        _ASSERTE(pDictionary == pMT->GetPerInstInfo()[dictionaryIndex]);
 #endif
     }
 
index fe68dba..08fe350 100644 (file)
@@ -188,9 +188,8 @@ class Dictionary
     friend class NativeImageDumper;
 #endif
 private:
-    // First N entries are generic instantiations arguments. They are stored as FixupPointers
-    // in NGen images. It means that the lowest bit is used to mark optional indirection (see code:FixupPointer).
-    // The rest of the open array are normal pointers (no optional indirection).
+    // First N entries are generic instantiations arguments. 
+    // The rest of the open array are normal pointers (no optional indirection) and may be NULL.
     DictionaryEntry m_pEntries[1];
 
     TADDR EntryAddr(ULONG32 idx)
@@ -202,11 +201,11 @@ private:
     }
 
 public:
-    inline DPTR(FixupPointer<TypeHandle>) GetInstantiation()
+    inline DPTR(TypeHandle) GetInstantiation()
     {
         LIMITED_METHOD_CONTRACT;
         SUPPORTS_DAC;
-        return dac_cast<DPTR(FixupPointer<TypeHandle>)>(EntryAddr(0));
+        return dac_cast<DPTR(TypeHandle)>(EntryAddr(0));
     }
 
 #ifndef DACCESS_COMPILE
index a3322b3..7e449d8 100644 (file)
@@ -325,7 +325,7 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
     pMT->ClearFlag(MethodTable::enum_flag_GenericsMask);
     pMT->SetFlag(MethodTable::enum_flag_GenericsMask_GenericInst);
 
-    pMT->m_pParentMethodTable.SetValueMaybeNull(NULL);
+    pMT->m_pParentMethodTable = NULL;
 
     // Non non-virtual slots
     pMT->ClearFlag(MethodTable::enum_flag_HasSingleNonVirtualSlot);
@@ -401,7 +401,7 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
         if (canShareVtableChunks)
         {
             // Share the canonical chunk
-            it.SetIndirectionSlot(pOldMT->GetVtableIndirections()[it.GetIndex()].GetValueMaybeNull());
+            it.SetIndirectionSlot(pOldMT->GetVtableIndirections()[it.GetIndex()]);
         }
         else
         {
@@ -446,7 +446,7 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
     // dictionary pointers.
     Dictionary * pDict = (Dictionary*) (pMemory + cbMT + cbOptional + cbIMap + cbPerInst);
     MethodTable::PerInstInfoElem_t *pPInstInfo = (MethodTable::PerInstInfoElem_t *) (pMT->GetPerInstInfo() + (pOldMT->GetNumDicts()-1));
-    pPInstInfo->SetValueMaybeNull(pDict);
+    *pPInstInfo = pDict;
 
     // Fill in the instantiation section of the generic dictionary.  The remainder of the
     // generic dictionary will be zeroed, which is the correct initial state.
@@ -460,7 +460,7 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
     if (pLayout != NULL)
     {
         _ASSERTE(pLayout->GetMaxSlots() > 0);
-        PTR_Dictionary pDictionarySlots = pMT->GetPerInstInfo()[pOldMT->GetNumDicts() - 1].GetValue();
+        PTR_Dictionary pDictionarySlots = pMT->GetPerInstInfo()[pOldMT->GetNumDicts() - 1];
         DWORD* pSizeSlot = (DWORD*)(pDictionarySlots + ntypars);
         *pSizeSlot = cbInstAndDictSlotSize;
     }
index f88f098..0108419 100644 (file)
@@ -132,7 +132,7 @@ static MethodDesc* CreateMethodDesc(LoaderAllocator *pAllocator,
     pMD->m_pszDebugMethodSignature = "<generic method signature>";
     pMD->m_pszDebugClassName  = "<generic method class name>";
     pMD->m_pszDebugMethodName = "<generic method name>";
-    pMD->m_pDebugMethodTable.SetValue(pMT);
+    pMD->m_pDebugMethodTable = pMT;
 #endif // _DEBUG
 
     return pMD;
@@ -1419,7 +1419,7 @@ void InstantiatedMethodDesc::SetupGenericMethodDefinition(IMDInternalImport *pIM
     S_SIZE_T dwAllocSize = S_SIZE_T(numTyPars) * S_SIZE_T(sizeof(TypeHandle));
 
     // the memory allocated for m_pMethInst will be freed if the declaring type fails to load
-    m_pPerInstInfo.SetValue((Dictionary *) pamTracker->Track(pAllocator->GetLowFrequencyHeap()->AllocMem(dwAllocSize)));
+    m_pPerInstInfo = (Dictionary *) pamTracker->Track(pAllocator->GetLowFrequencyHeap()->AllocMem(dwAllocSize));
 
     TypeHandle * pInstDest = (TypeHandle *) IMD_GetMethodDictionaryNonNull();
 
@@ -1459,9 +1459,9 @@ void InstantiatedMethodDesc::SetupWrapperStubWithInstantiations(MethodDesc* wrap
 
     //_ASSERTE(sharedMD->IMD_IsSharedByGenericMethodInstantiations());
 
-    m_pWrappedMethodDesc.SetValue(wrappedMD);
+    m_pWrappedMethodDesc = wrappedMD;
     m_wFlags2 = WrapperStubWithInstantiations | (m_wFlags2 & ~KindMask);
-    m_pPerInstInfo.SetValueMaybeNull((Dictionary*)pInst);
+    m_pPerInstInfo = (Dictionary*)pInst;
 
     _ASSERTE(FitsIn<WORD>(numGenericArgs));
     m_wNumGenericArgs = static_cast<WORD>(numGenericArgs);
@@ -1479,12 +1479,12 @@ void InstantiatedMethodDesc::SetupSharedMethodInstantiation(DWORD numGenericArgs
     _ASSERTE(numGenericArgs != 0);
     // Initially the dictionary layout is empty
     m_wFlags2 = SharedMethodInstantiation | (m_wFlags2 & ~KindMask);
-    m_pPerInstInfo.SetValueMaybeNull((Dictionary *)pPerInstInfo);
+    m_pPerInstInfo = (Dictionary *)pPerInstInfo;
 
     _ASSERTE(FitsIn<WORD>(numGenericArgs));
     m_wNumGenericArgs = static_cast<WORD>(numGenericArgs);
 
-    m_pDictLayout.SetValueMaybeNull(pDL);
+    m_pDictLayout = pDL;
 
 
     _ASSERTE(IMD_IsSharedByGenericMethodInstantiations());
@@ -1497,7 +1497,7 @@ void InstantiatedMethodDesc::SetupUnsharedMethodInstantiation(DWORD numGenericAr
 
     // The first field is never used
     m_wFlags2 = UnsharedMethodInstantiation | (m_wFlags2 & ~KindMask);
-    m_pPerInstInfo.SetValueMaybeNull((Dictionary *)pInst);
+    m_pPerInstInfo = (Dictionary *)pInst;
 
     _ASSERTE(FitsIn<WORD>(numGenericArgs));
     m_wNumGenericArgs = static_cast<WORD>(numGenericArgs);
index ff47aa3..f0a81d6 100644 (file)
@@ -1542,8 +1542,6 @@ PCODE DynamicHelpers::CreateDictionaryLookupHelper(LoaderAllocator * pAllocator,
 {
     STANDARD_VM_CONTRACT;
 
-    _ASSERTE(!MethodTable::IsPerInstInfoRelative());
-
     PCODE helperAddress = (pLookup->helper == CORINFO_HELP_RUNTIMEHANDLE_METHOD ?
         GetEEFuncEntryPoint(JIT_GenericHandleMethodWithSlotAndModule) :
         GetEEFuncEntryPoint(JIT_GenericHandleClassWithSlotAndModule));
index c6515ab..ef69ac1 100644 (file)
@@ -989,7 +989,6 @@ void VTableCallHolder::Initialize(unsigned slot)
 {
     unsigned offsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(slot) * TARGET_POINTER_SIZE;
     unsigned offsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(slot) * TARGET_POINTER_SIZE;
-    _ASSERTE(MethodTable::VTableIndir_t::isRelative == false /* TODO: NYI */);
 
     VTableCallStub* pStub = stub();
     BYTE* p = (BYTE*)pStub->entryPoint();
index cbb49a8..1f19382 100644 (file)
@@ -510,15 +510,10 @@ void IBCLogger::LogMethodAccessHelper(const MethodDesc* pMD, ULONG flagNum)
         if (g_pObjectClass == NULL || g_pStringClass == NULL)
             goto DelayCallback;
 
-        RelativeFixupPointer<PTR_MethodTable> * ppMT = pMD->GetMethodTablePtr();
-        if (ppMT->IsNull())
+        PTR_MethodTable pMT = pMD->GetMethodTable();
+        if (pMT == NULL)
             goto DelayCallback;
 
-        TADDR pMaybeTaggedMT = ppMT->GetValueMaybeTagged((TADDR)ppMT);
-        if (CORCOMPILE_IS_POINTER_TAGGED(pMaybeTaggedMT))
-            goto DelayCallback;
-
-        MethodTable *pMT = (MethodTable *)pMaybeTaggedMT;
         if (!pMT->IsRestored_NoLogging())
             goto DelayCallback;
 
index 3577da7..cd207df 100644 (file)
@@ -157,7 +157,7 @@ MethodDesc* ILStubCache::CreateNewMethodDesc(LoaderHeap* pCreationHeap, MethodTa
     pMD->SetMemberDef(0);
     pMD->SetSlot(MethodTable::NO_SLOT);       // we can't ever use the slot for dynamic methods
     // the no metadata part of the method desc
-    pMD->m_pszMethodName.SetValue((PTR_CUTF8)"IL_STUB");
+    pMD->m_pszMethodName = (PTR_CUTF8)"IL_STUB";
     pMD->m_dwExtendedFlags = mdPublic | DynamicMethodDesc::nomdILStub;
 
     pMD->SetTemporaryEntryPoint(pMT->GetLoaderAllocator(), pamTracker);
@@ -296,11 +296,11 @@ MethodDesc* ILStubCache::CreateNewMethodDesc(LoaderHeap* pCreationHeap, MethodTa
     {
         switch(dwStubFlags)
         {
-            case ILSTUB_ARRAYOP_GET: pMD->m_pszMethodName.SetValue((PTR_CUTF8)"IL_STUB_Array_Get");
+            case ILSTUB_ARRAYOP_GET: pMD->m_pszMethodName = (PTR_CUTF8)"IL_STUB_Array_Get";
                                              break;
-            case ILSTUB_ARRAYOP_SET: pMD->m_pszMethodName.SetValue((PTR_CUTF8)"IL_STUB_Array_Set");
+            case ILSTUB_ARRAYOP_SET: pMD->m_pszMethodName = (PTR_CUTF8)"IL_STUB_Array_Set";
                                              break;
-            case ILSTUB_ARRAYOP_ADDRESS: pMD->m_pszMethodName.SetValue((PTR_CUTF8)"IL_STUB_Array_Address");
+            case ILSTUB_ARRAYOP_ADDRESS: pMD->m_pszMethodName = (PTR_CUTF8)"IL_STUB_Array_Address";
                                              break;
             default: _ASSERTE(!"Unknown array il stub");
         }
@@ -308,15 +308,15 @@ MethodDesc* ILStubCache::CreateNewMethodDesc(LoaderHeap* pCreationHeap, MethodTa
     else
 #endif
     {
-        pMD->m_pszMethodName.SetValue(pMD->GetILStubResolver()->GetStubMethodName());
+        pMD->m_pszMethodName = pMD->GetILStubResolver()->GetStubMethodName();
     }
 
 
 #ifdef _DEBUG
-    pMD->m_pszDebugMethodName = RelativePointer<PTR_CUTF8>::GetValueAtPtr(PTR_HOST_MEMBER_TADDR(DynamicMethodDesc, pMD, m_pszMethodName));
+    pMD->m_pszDebugMethodName = pMD->m_pszMethodName;
     pMD->m_pszDebugClassName  = ILStubResolver::GetStubClassName(pMD);  // must be called after type is set
     pMD->m_pszDebugMethodSignature = FormatSig(pMD, pCreationHeap, pamTracker);
-    pMD->m_pDebugMethodTable.SetValue(pMT);
+    pMD->m_pDebugMethodTable = pMT;
 #endif // _DEBUG
 
     RETURN pMD;
index fc04afa..9fa4a6a 100644 (file)
@@ -81,7 +81,7 @@ PTR_LoaderAllocator InstMethodHashTable::GetLoaderAllocator()
     }
     else
     {
-        _ASSERTE(!m_pModule.IsNull());
+        _ASSERTE(m_pModule != NULL);
         return GetModule()->GetLoaderAllocator();
     }
 }
index 58a82ae..5d73124 100644 (file)
@@ -3219,11 +3219,11 @@ CORINFO_GENERIC_HANDLE JIT_GenericHandleWorker(MethodDesc * pMD, MethodTable * p
         // If the dictionary on the base type got expanded, update the current type's base type dictionary
         // pointer to use the new one on the base type.
 
-        Dictionary* pMTDictionary = pMT->GetPerInstInfo()[dictionaryIndex].GetValue();
-        Dictionary* pDeclaringMTDictionary = pDeclaringMT->GetPerInstInfo()[dictionaryIndex].GetValue();
+        Dictionary* pMTDictionary = pMT->GetPerInstInfo()[dictionaryIndex];
+        Dictionary* pDeclaringMTDictionary = pDeclaringMT->GetPerInstInfo()[dictionaryIndex];
         if (pMTDictionary != pDeclaringMTDictionary)
         {
-            TypeHandle** pPerInstInfo = (TypeHandle**)pMT->GetPerInstInfo()->GetValuePtr();
+            TypeHandle** pPerInstInfo = (TypeHandle**)pMT->GetPerInstInfo();
             FastInterlockExchangePointer(pPerInstInfo + dictionaryIndex, (TypeHandle*)pDeclaringMTDictionary);
         }
     }
index b90e13b..6e9aa4d 100644 (file)
@@ -2993,11 +2993,6 @@ void CEEInfo::ComputeRuntimeLookupForSharedGenericToken(DictionaryEntryKind entr
                 pResult->testForFixup = 0;
                 pResult->offsets[0] = offsetof(InstantiatedMethodDesc, m_pPerInstInfo);
 
-                if (decltype(InstantiatedMethodDesc::m_pPerInstInfo)::isRelative)
-                {
-                    pResult->indirectFirstOffset = 1;
-                }
-
                 uint32_t data;
                 IfFailThrow(sigptr.GetData(&data));
                 pResult->offsets[1] = sizeof(TypeHandle) * data;
@@ -3079,12 +3074,6 @@ void CEEInfo::ComputeRuntimeLookupForSharedGenericToken(DictionaryEntryKind entr
                 IfFailThrow(sigptr.GetData(&data));
                 pResult->offsets[2] = sizeof(TypeHandle) * data;
 
-                if (MethodTable::IsPerInstInfoRelative())
-                {
-                    pResult->indirectFirstOffset = 1;
-                    pResult->indirectSecondOffset = 1;
-                }
-
                 return;
             }
             else if (type == ELEMENT_TYPE_GENERICINST &&
@@ -3314,11 +3303,6 @@ NoSpecialCase:
 
             // Indirect through dictionary table pointer in InstantiatedMethodDesc
             pResult->offsets[0] = offsetof(InstantiatedMethodDesc, m_pPerInstInfo);
-
-            if (decltype(InstantiatedMethodDesc::m_pPerInstInfo)::isRelative)
-            {
-                pResult->indirectFirstOffset = 1;
-            }
         }
     }
 
@@ -3341,12 +3325,6 @@ NoSpecialCase:
 
             // Next indirect through the dictionary appropriate to this instantiated type
             pResult->offsets[1] = sizeof(TypeHandle*) * (pContextMT->GetNumDicts() - 1);
-
-            if (MethodTable::IsPerInstInfoRelative())
-            {
-                pResult->indirectFirstOffset = 1;
-                pResult->indirectSecondOffset = 1;
-            }
         }
     }
 }
@@ -8473,7 +8451,7 @@ bool CEEInfo::isIntrinsicType(CORINFO_CLASS_HANDLE classHnd)
 void CEEInfo::getMethodVTableOffset (CORINFO_METHOD_HANDLE methodHnd,
                                      unsigned * pOffsetOfIndirection,
                                      unsigned * pOffsetAfterIndirection,
-                                     bool * isRelative)
+                                     bool * isRelative) 
 {
     CONTRACTL {
         NOTHROW;
@@ -8495,8 +8473,7 @@ void CEEInfo::getMethodVTableOffset (CORINFO_METHOD_HANDLE methodHnd,
 
     *pOffsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(method->GetSlot()) * TARGET_POINTER_SIZE /* sizeof(MethodTable::VTableIndir_t) */;
     *pOffsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(method->GetSlot()) * TARGET_POINTER_SIZE /* sizeof(MethodTable::VTableIndir2_t) */;
-    *isRelative = MethodTable::VTableIndir_t::isRelative ? 1 : 0;
-    _ASSERTE(MethodTable::VTableIndir_t::isRelative == MethodTable::VTableIndir2_t::isRelative);
+    *isRelative = false;
 
     EE_TO_JIT_TRANSITION_LEAF();
 }
@@ -8996,15 +8973,7 @@ void CEEInfo::getFunctionEntryPoint(CORINFO_METHOD_HANDLE  ftnHnd,
 
         ret = (void *)ftn->GetAddrOfSlot();
 
-        if (MethodTable::VTableIndir2_t::isRelative
-            && ftn->IsVtableSlot())
-        {
-            accessType = IAT_RELPVALUE;
-        }
-        else
-        {
-            accessType = IAT_PVALUE;
-        }
+        accessType = IAT_PVALUE;
     }
 
 
index a9da526..bc1c8c2 100644 (file)
@@ -523,7 +523,7 @@ PCODE MethodDesc::GetMethodEntryPoint()
     return GetMethodTable_NoLogging()->GetSlot(GetSlot());
 }
 
-TADDR MethodDesc::GetAddrOfSlot()
+PTR_PCODE MethodDesc::GetAddrOfSlot()
 {
     CONTRACTL
     {
@@ -540,7 +540,7 @@ TADDR MethodDesc::GetAddrOfSlot()
     {
         SIZE_T size = GetBaseSize();
 
-        return dac_cast<TADDR>(this) + size;
+        return PTR_PCODE(dac_cast<TADDR>(this) + size);
     }
 
     _ASSERTE(GetMethodTable()->IsCanonicalMethodTable());
@@ -956,9 +956,9 @@ PCODE MethodDesc::GetNativeCode()
     {
         // When profiler is enabled, profiler may ask to rejit a code even though we
         // we have ngen code for this MethodDesc.  (See MethodDesc::DoPrestub).
-        // This means that NativeCodeSlot::GetValueMaybeNullAtPtr(GetAddrOfNativeCodeSlot())
+        // This means that *GetAddrOfNativeCodeSlot()
         // is not stable. It can turn from non-zero to zero.
-        PCODE pCode = PCODE(NativeCodeSlot::GetValueMaybeNullAtPtr(GetAddrOfNativeCodeSlot()) & ~FIXUP_LIST_MASK);
+        PCODE pCode = *GetAddrOfNativeCodeSlot();
 #ifdef TARGET_ARM
         if (pCode != NULL)
             pCode |= THUMB_CODE;
@@ -973,7 +973,7 @@ PCODE MethodDesc::GetNativeCode()
 }
 
 //*******************************************************************************
-TADDR MethodDesc::GetAddrOfNativeCodeSlot()
+PTR_PCODE MethodDesc::GetAddrOfNativeCodeSlot()
 {
     WRAPPER_NO_CONTRACT;
 
@@ -981,7 +981,7 @@ TADDR MethodDesc::GetAddrOfNativeCodeSlot()
 
     SIZE_T size = s_ClassificationSizeTable[m_wFlags & (mdcClassification | mdcHasNonVtableSlot |  mdcMethodImpl)];
 
-    return dac_cast<TADDR>(this) + size;
+    return (PTR_PCODE)(dac_cast<TADDR>(this) + size);
 }
 
 //*******************************************************************************
@@ -1784,7 +1784,7 @@ MethodDescChunk *MethodDescChunk::CreateChunk(LoaderHeap *pHeap, DWORD methodDes
             pMD = (MethodDesc *)((BYTE *)pMD + oneSize);
         }
 
-        pChunk->m_next.SetValueMaybeNull(pFirstChunk);
+        pChunk->m_next = pFirstChunk;
         pFirstChunk = pChunk;
 
         methodDescCount -= count;
@@ -2257,21 +2257,12 @@ void MethodDesc::Reset()
 
         InterlockedUpdateFlags2(enum_flag2_HasStableEntryPoint | enum_flag2_HasPrecode, FALSE);
 
-        TADDR slot = GetAddrOfSlot();
-        if (IsVtableSlot())
-        {
-            ((MethodTable::VTableIndir2_t *) slot)->SetValue(GetTemporaryEntryPoint());
-        }
-        else
-        {
-            *((PCODE *) slot) = GetTemporaryEntryPoint();
-        }
+        *GetAddrOfSlot() = GetTemporaryEntryPoint();
     }
 
     if (HasNativeCodeSlot())
     {
-        RelativePointer<TADDR> *pRelPtr = (RelativePointer<TADDR> *)GetAddrOfNativeCodeSlot();
-        pRelPtr->SetValueMaybeNull(NULL);
+        *GetAddrOfNativeCodeSlot() = NULL;
     }
     _ASSERTE(!HasNativeCode());
 }
@@ -2998,19 +2989,9 @@ void MethodDesc::SetTemporaryEntryPoint(LoaderAllocator *pLoaderAllocator, Alloc
 
     GetMethodDescChunk()->EnsureTemporaryEntryPointsCreated(pLoaderAllocator, pamTracker);
 
-    TADDR slot = GetAddrOfSlot();
-    if (IsVtableSlot())
-    {
-        MethodTable::VTableIndir2_t *slotPtr = ((MethodTable::VTableIndir2_t *) slot);
-        _ASSERTE(slotPtr->IsNull());
-        slotPtr->SetValue(GetTemporaryEntryPoint());
-    }
-    else
-    {
-        PCODE *slotPtr = (PCODE *) slot;
-        _ASSERTE(*slotPtr == NULL);
-        *slotPtr = GetTemporaryEntryPoint();
-    }
+    PTR_PCODE pSlot = GetAddrOfSlot();
+    _ASSERTE(*pSlot == NULL);
+    *pSlot = GetTemporaryEntryPoint();
 
     if (RequiresStableEntryPoint())
     {
@@ -3074,7 +3055,7 @@ Precode* MethodDesc::GetOrCreatePrecode()
         return GetPrecode();
     }
 
-    TADDR pSlot = GetAddrOfSlot();
+    PTR_PCODE pSlot = GetAddrOfSlot();
     PCODE tempEntry = GetTemporaryEntryPoint();
 
     PrecodeType requiredType = GetPrecodeType();
@@ -3094,40 +3075,16 @@ Precode* MethodDesc::GetOrCreatePrecode()
 
         AllocMemTracker amt;
         Precode* pPrecode = Precode::Allocate(requiredType, this, GetLoaderAllocator(), &amt);
-        PCODE newVal;
-        PCODE oldVal;
-        TADDR *slotAddr;
 
-        if (IsVtableSlot())
-        {
-            newVal = MethodTable::VTableIndir2_t::GetRelative(pSlot, pPrecode->GetEntryPoint());
-            oldVal = MethodTable::VTableIndir2_t::GetRelative(pSlot, tempEntry);
-            slotAddr = (TADDR *) (MethodTable::VTableIndir2_t *) pSlot;
-        }
-        else
-        {
-            newVal = pPrecode->GetEntryPoint();
-            oldVal = tempEntry;
-            slotAddr = (TADDR *) (PCODE *) pSlot;
-        }
 
-        if (FastInterlockCompareExchangePointer(slotAddr, (TADDR) newVal, (TADDR) oldVal) == oldVal)
+        if (FastInterlockCompareExchangePointer(pSlot, pPrecode->GetEntryPoint(), tempEntry) == tempEntry)
             amt.SuppressRelease();
     }
 
     // Set the flags atomically
     InterlockedUpdateFlags2(enum_flag2_HasStableEntryPoint | enum_flag2_HasPrecode, TRUE);
 
-    PCODE addr;
-    if (IsVtableSlot())
-    {
-        addr = ((MethodTable::VTableIndir2_t *)pSlot)->GetValue();
-    }
-    else
-    {
-        addr = *((PCODE *)pSlot);
-    }
-    return Precode::GetPrecodeFromEntryPoint(addr);
+    return Precode::GetPrecodeFromEntryPoint(*pSlot);
 }
 
 bool MethodDesc::DetermineAndSetIsEligibleForTieredCompilation()
@@ -3378,8 +3335,7 @@ void MethodDesc::ResetCodeEntryPointForEnC()
 
     if (HasNativeCodeSlot())
     {
-        RelativePointer<TADDR> *pRelPtr = (RelativePointer<TADDR> *)GetAddrOfNativeCodeSlot();
-        pRelPtr->SetValueMaybeNull(NULL);
+        *GetAddrOfNativeCodeSlot() = NULL;
     }
 }
 
@@ -3407,14 +3363,13 @@ BOOL MethodDesc::SetNativeCodeInterlocked(PCODE addr, PCODE pExpected /*=NULL*/)
         }
 #endif
 
-        TADDR pSlot = GetAddrOfNativeCodeSlot();
-        NativeCodeSlot value, expected;
+        PTR_PCODE pSlot = GetAddrOfNativeCodeSlot();
+        NativeCodeSlot expected;
 
-        value.SetValueMaybeNull(pSlot, addr | (*dac_cast<PTR_TADDR>(pSlot) & FIXUP_LIST_MASK));
-        expected.SetValueMaybeNull(pSlot, pExpected | (*dac_cast<PTR_TADDR>(pSlot) & FIXUP_LIST_MASK));
+        expected = *pSlot;
 
         return FastInterlockCompareExchangePointer(reinterpret_cast<TADDR*>(pSlot),
-            (TADDR&)value, (TADDR&)expected) == (TADDR&)expected;
+            (TADDR&)addr, (TADDR&)expected) == (TADDR&)expected;
     }
 
     _ASSERTE(pExpected == NULL);
@@ -3432,23 +3387,7 @@ void MethodDesc::SetMethodEntryPoint(PCODE addr)
     // synchronized. Currently, the only caller synchronizes with the following lock.
     _ASSERTE(MethodDescBackpatchInfoTracker::IsLockOwnedByCurrentThread());
 
-    TADDR pSlot = GetAddrOfSlot();
-
-    TADDR *slotAddr;
-    PCODE newVal;
-
-    if (IsVtableSlot())
-    {
-        newVal = MethodTable::VTableIndir2_t::GetRelative(pSlot, addr);
-        slotAddr = (TADDR *) (MethodTable::VTableIndir2_t *) pSlot;
-    }
-    else
-    {
-        newVal = addr;
-        slotAddr = (TADDR *) (PCODE *) pSlot;
-    }
-
-    *(TADDR *)slotAddr = newVal;
+    *GetAddrOfSlot() = addr;
 }
 
 
@@ -3464,28 +3403,9 @@ BOOL MethodDesc::SetStableEntryPointInterlocked(PCODE addr)
     _ASSERTE(!IsVersionable());
 
     PCODE pExpected = GetTemporaryEntryPoint();
-    TADDR pSlot = GetAddrOfSlot();
-
-    BOOL fResult;
-
-    TADDR *slotAddr;
-    PCODE newVal;
-    PCODE oldVal;
-
-    if (IsVtableSlot())
-    {
-        newVal = MethodTable::VTableIndir2_t::GetRelative(pSlot, addr);
-        oldVal = MethodTable::VTableIndir2_t::GetRelative(pSlot, pExpected);
-        slotAddr = (TADDR *) (MethodTable::VTableIndir2_t *) pSlot;
-    }
-    else
-    {
-        newVal = addr;
-        oldVal = pExpected;
-        slotAddr = (TADDR *) (PCODE *) pSlot;
-    }
+    PTR_PCODE pSlot = GetAddrOfSlot();
 
-    fResult = FastInterlockCompareExchangePointer(slotAddr, (TADDR) newVal, (TADDR) oldVal) == oldVal;
+    BOOL fResult = FastInterlockCompareExchangePointer(pSlot, addr, pExpected) == pExpected;
 
     InterlockedUpdateFlags2(enum_flag2_HasStableEntryPoint, TRUE);
 
index d6a090b..873436f 100644 (file)
@@ -23,8 +23,6 @@
 #include "eeconfig.h"
 #include "precode.h"
 
-#include "fixuppointer.h"
-
 class Stub;
 class FCallMethodDesc;
 class FieldDesc;
@@ -227,7 +225,7 @@ public:
     LPCUTF8         m_pszDebugMethodName;
     LPCUTF8         m_pszDebugClassName;
     LPCUTF8         m_pszDebugMethodSignature;
-    FixupPointer<PTR_MethodTable>   m_pDebugMethodTable;
+    PTR_MethodTable m_pDebugMethodTable;
 
     PTR_GCCoverageInfo m_GcCover;
 
@@ -1028,7 +1026,7 @@ public:
     inline PTR_MethodTable GetMethodTable() const;
     inline PTR_MethodTable GetMethodTable_NoLogging() const;
 
-    inline DPTR(RelativeFixupPointer<PTR_MethodTable>) GetMethodTablePtr() const;
+    inline DPTR(PTR_MethodTable) GetMethodTablePtr() const;
 
   public:
     inline MethodDescChunk* GetMethodDescChunk() const;
@@ -1104,7 +1102,7 @@ public:
         return IsVirtualSlot() && !HasNonVtableSlot();
     }
 
-    TADDR GetAddrOfSlot();
+    PTR_PCODE GetAddrOfSlot();
 
     PTR_MethodDesc GetDeclMethodDesc(UINT32 slotNumber);
 
@@ -1458,7 +1456,7 @@ public:
 
     BOOL SetNativeCodeInterlocked(PCODE addr, PCODE pExpected = NULL);
 
-    TADDR GetAddrOfNativeCodeSlot();
+    PTR_PCODE GetAddrOfNativeCodeSlot();
 
     BOOL MayHaveNativeCode();
 
@@ -1854,13 +1852,8 @@ public:
 
     // class MethodImpl;                            // Present if HasMethodImplSlot() is true
 
-    typedef RelativePointer<PCODE> NonVtableSlot;   // Present if HasNonVtableSlot() is true
-                                                    // RelativePointer for NGen, PCODE for JIT
-
-#define FIXUP_LIST_MASK 1
-    typedef RelativePointer<TADDR> NativeCodeSlot;  // Present if HasNativeCodeSlot() is true
-                                                    // lower order bit (FIXUP_LIST_MASK) used to determine if FixupListSlot is present
-    typedef RelativePointer<TADDR> FixupListSlot;
+    typedef PCODE NonVtableSlot;   // Present if HasNonVtableSlot() is true
+    typedef PCODE NativeCodeSlot;  // Present if HasNativeCodeSlot() is true
 
 // Stub Dispatch code
 public:
@@ -2269,22 +2262,22 @@ public:
     FORCEINLINE PTR_MethodTable GetMethodTable()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return m_methodTable.GetValue(PTR_HOST_MEMBER_TADDR(MethodDescChunk, this, m_methodTable));
+        return m_methodTable;
     }
 
-    inline DPTR(RelativeFixupPointer<PTR_MethodTable>) GetMethodTablePtr() const
+    inline DPTR(PTR_MethodTable) GetMethodTablePtr() const
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(RelativeFixupPointer<PTR_MethodTable>)>(PTR_HOST_MEMBER_TADDR(MethodDescChunk, this, m_methodTable));
+        return dac_cast<DPTR(PTR_MethodTable)>(PTR_HOST_MEMBER_TADDR(MethodDescChunk, this, m_methodTable));
     }
 
 #ifndef DACCESS_COMPILE
     inline void SetMethodTable(MethodTable * pMT)
     {
         LIMITED_METHOD_CONTRACT;
-        _ASSERTE(m_methodTable.IsNull());
+        _ASSERTE(m_methodTable == NULL);
         _ASSERTE(pMT != NULL);
-        m_methodTable.SetValue(pMT);
+        m_methodTable = pMT;
     }
 
     inline void SetSizeAndCount(ULONG sizeOfMethodDescs, COUNT_T methodDescCount)
@@ -2303,14 +2296,14 @@ public:
     void SetNextChunk(MethodDescChunk *chunk)
     {
         LIMITED_METHOD_CONTRACT;
-        m_next.SetValueMaybeNull(chunk);
+        m_next = chunk;
     }
 #endif // !DACCESS_COMPILE
 
     PTR_MethodDescChunk GetNextChunk()
     {
         LIMITED_METHOD_CONTRACT;
-        return m_next.GetValueMaybeNull(PTR_HOST_MEMBER_TADDR(MethodDescChunk, this, m_next));
+        return m_next;
     }
 
     UINT32 GetCount()
@@ -2370,9 +2363,9 @@ private:
         m_flagsAndTokenRange = (m_flagsAndTokenRange & ~enum_flag_TokenRangeMask) | tokenRange;
     }
 
-    RelativeFixupPointer<PTR_MethodTable> m_methodTable;
+    PTR_MethodTable m_methodTable;
 
-    RelativePointer<PTR_MethodDescChunk> m_next;
+    PTR_MethodDescChunk  m_next;
 
     BYTE                 m_size;        // The size of this chunk minus 1 (in multiples of MethodDesc::ALIGNMENT)
     BYTE                 m_count;       // The number of MethodDescs in this chunk minus 1
@@ -2409,7 +2402,7 @@ class StoredSigMethodDesc : public MethodDesc
     // Put the sig RVA in here - this allows us to avoid
     // touching the method desc table when CoreLib is prejitted.
 
-    RelativePointer<TADDR>           m_pSig;
+    TADDR           m_pSig;
     DWORD           m_cSig;
 #ifdef TARGET_64BIT
     // m_dwExtendedFlags is not used by StoredSigMethodDesc itself.
@@ -2421,13 +2414,13 @@ class StoredSigMethodDesc : public MethodDesc
     TADDR GetSigRVA()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<TADDR>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(StoredSigMethodDesc, this, m_pSig));
+        return m_pSig;
     }
 
     bool HasStoredMethodSig(void)
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return !m_pSig.IsNull();
+        return m_pSig != NULL;
     }
     PCCOR_SIGNATURE GetStoredMethodSig(DWORD* sigLen = NULL)
     {
@@ -2441,13 +2434,13 @@ class StoredSigMethodDesc : public MethodDesc
             DacInstantiateTypeByAddress(GetSigRVA(), m_cSig, true);
 #else // !DACCESS_COMPILE
         g_IBCLogger.LogNDirectCodeAccess(this);
-        return (PCCOR_SIGNATURE) m_pSig.GetValueMaybeNull();
+        return (PCCOR_SIGNATURE) m_pSig;
 #endif // !DACCESS_COMPILE
     }
     void SetStoredMethodSig(PCCOR_SIGNATURE sig, DWORD sigBytes)
     {
 #ifndef DACCESS_COMPILE
-        m_pSig.SetValueMaybeNull((TADDR)sig);
+        m_pSig = (TADDR)sig;
         m_cSig = sigBytes;
 #endif // !DACCESS_COMPILE
     }
@@ -2507,7 +2500,7 @@ class DynamicMethodDesc : public StoredSigMethodDesc
 #endif
 
 protected:
-    RelativePointer<PTR_CUTF8>           m_pszMethodName;
+    PTR_CUTF8           m_pszMethodName;
     PTR_DynamicResolver m_pResolver;
 
 #ifndef TARGET_64BIT
@@ -2552,7 +2545,7 @@ public:
     PTR_CUTF8 GetMethodName()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<PTR_CUTF8>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(DynamicMethodDesc, this, m_pszMethodName));
+        return m_pszMethodName;
     }
 
     WORD GetAttrs()
@@ -2768,19 +2761,19 @@ public:
         LPVOID      m_pNativeNDirectTarget;
 
         // Information about the entrypoint
-        RelativePointer<PTR_CUTF8>     m_pszEntrypointName;
+        PTR_CUTF8   m_pszEntrypointName;
 
         union
         {
-            RelativePointer<PTR_CUTF8>     m_pszLibName;
+            PTR_CUTF8   m_pszLibName;
             DWORD       m_dwECallID;    // ECallID for QCalls
         };
 
         // The writeable part of the methoddesc.
-        PlainPointer<PTR_NDirectWriteableData>    m_pWriteableData;
+        PTR_NDirectWriteableData    m_pWriteableData;
 
 #ifdef HAS_NDIRECT_IMPORT_PRECODE
-        RelativePointer<PTR_NDirectImportThunkGlue> m_pImportThunkGlue;
+        PTR_NDirectImportThunkGlue  m_pImportThunkGlue;
 #else // HAS_NDIRECT_IMPORT_PRECODE
         NDirectImportThunkGlue      m_ImportThunkGlue;
 #endif // HAS_NDIRECT_IMPORT_PRECODE
@@ -2796,7 +2789,7 @@ public:
 #endif // defined(TARGET_X86)
 
         // This field gets set only when this MethodDesc is marked as PreImplemented
-        RelativePointer<PTR_MethodDesc> m_pStubMD;
+        PTR_MethodDesc m_pStubMD;
 
     } ndirect;
 
@@ -2919,7 +2912,7 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        return RelativePointer<PTR_CUTF8>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(NDirectMethodDesc, this, ndirect.m_pszLibName));
+        return ndirect.m_pszLibName;
     }
 
 #ifndef DACCESS_COMPILE
@@ -2927,7 +2920,7 @@ public:
     {
         LIMITED_METHOD_CONTRACT;
 
-        return IsQCall() ? "QCall" : ndirect.m_pszLibName.GetValueMaybeNull();
+        return IsQCall() ? "QCall" : ndirect.m_pszLibName;
     }
 #endif // !DACCESS_COMPILE
 
@@ -2935,7 +2928,7 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        return RelativePointer<PTR_CUTF8>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(NDirectMethodDesc, this, ndirect.m_pszEntrypointName));
+        return ndirect.m_pszEntrypointName;
     }
 
     BOOL IsVarArgs() const
@@ -2997,20 +2990,14 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        return ReadPointer(this, &NDirectMethodDesc::ndirect, &decltype(NDirectMethodDesc::ndirect)::m_pWriteableData);
+        return ndirect.m_pWriteableData;
     }
 
     PTR_NDirectImportThunkGlue GetNDirectImportThunkGlue()
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        TADDR base = PTR_HOST_MEMBER_TADDR(NDirectMethodDesc, this, ndirect.m_pImportThunkGlue);
-
-#ifdef HAS_NDIRECT_IMPORT_PRECODE
-        return RelativePointer<PTR_NDirectImportThunkGlue>::GetValueAtPtr(base);
-#else
-        return dac_cast<PTR_NDirectImportThunkGlue>(base);
-#endif
+        return ndirect.m_pImportThunkGlue;
     }
 
     LPVOID GetNDirectTarget()
@@ -3221,7 +3208,7 @@ struct ComPlusCallInfo
 #endif // TARGET_X86
 
     // This field gets set only when this MethodDesc is marked as PreImplemented
-    RelativePointer<PTR_MethodDesc> m_pStubMD;
+    PTR_MethodDesc m_pStubMD;
 };
 
 
@@ -3353,7 +3340,7 @@ public:
         if (IMD_IsGenericMethodDefinition())
             return TRUE;
         else
-            return !m_pPerInstInfo.IsNull();
+            return m_pPerInstInfo != NULL;
     }
 
     // All varieties of InstantiatedMethodDesc's support this method.
@@ -3371,14 +3358,15 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
-        return ReadPointerMaybeNull(this, &InstantiatedMethodDesc::m_pPerInstInfo);
+        return m_pPerInstInfo;
     }
 
     PTR_Dictionary IMD_GetMethodDictionaryNonNull()
     {
         LIMITED_METHOD_DAC_CONTRACT;
+        _ASSERTE(m_pPerInstInfo != NULL);
 
-        return ReadPointer(this, &InstantiatedMethodDesc::m_pPerInstInfo);
+        return m_pPerInstInfo;
     }
 
     BOOL IMD_IsGenericMethodDefinition()
@@ -3434,7 +3422,7 @@ public:
     PTR_DictionaryLayout GetDictLayoutRaw()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<PTR_DictionaryLayout>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(InstantiatedMethodDesc, this, m_pDictLayout));
+        return m_pDictLayout;
     }
 
     PTR_MethodDesc IMD_GetWrappedMethodDesc()
@@ -3442,7 +3430,7 @@ public:
         LIMITED_METHOD_DAC_CONTRACT;
 
         _ASSERTE(IMD_IsWrapperStubWithInstantiations());
-        return RelativeFixupPointer<PTR_MethodDesc>::GetValueAtPtr(PTR_HOST_MEMBER_TADDR(InstantiatedMethodDesc, this, m_pWrappedMethodDesc));
+        return m_pWrappedMethodDesc;
     }
 
 #ifndef DACCESS_COMPILE
@@ -3453,10 +3441,10 @@ public:
         if (IMD_IsWrapperStubWithInstantiations() && IMD_HasMethodInstantiation())
         {
             InstantiatedMethodDesc* pIMD = IMD_GetWrappedMethodDesc()->AsInstantiatedMethodDesc();
-            return pIMD->m_pDictLayout.GetValueMaybeNull();
+            return pIMD->m_pDictLayout;
         }
         else if (IMD_IsSharedByGenericMethodInstantiations())
-            return m_pDictLayout.GetValueMaybeNull();
+            return m_pDictLayout;
         else
             return NULL;
     }
@@ -3467,11 +3455,11 @@ public:
         if (IMD_IsWrapperStubWithInstantiations() && IMD_HasMethodInstantiation())
         {
             InstantiatedMethodDesc* pIMD = IMD_GetWrappedMethodDesc()->AsInstantiatedMethodDesc();
-            pIMD->m_pDictLayout.SetValueMaybeNull(pNewLayout);
+            pIMD->m_pDictLayout = pNewLayout;
         }
         else if (IMD_IsSharedByGenericMethodInstantiations())
         {
-            m_pDictLayout.SetValueMaybeNull(pNewLayout);
+            m_pDictLayout = pNewLayout;
         }
     }
 #endif // !DACCESS_COMPILE
@@ -3521,9 +3509,9 @@ private:
 
     friend class MethodDesc; // this fields are currently accessed by MethodDesc::Save/Restore etc.
     union {
-        RelativePointer<PTR_DictionaryLayout> m_pDictLayout; //SharedMethodInstantiation
+        PTR_DictionaryLayout m_pDictLayout; //SharedMethodInstantiation
 
-        RelativeFixupPointer<PTR_MethodDesc> m_pWrappedMethodDesc; // For WrapperStubWithInstantiations
+        PTR_MethodDesc m_pWrappedMethodDesc; // For WrapperStubWithInstantiations
     };
 
 public: // <TODO>make private: JITinterface.cpp accesses through this </TODO>
@@ -3536,7 +3524,7 @@ public: // <TODO>make private: JITinterface.cpp accesses through this </TODO>
     //
     // For generic method definitions that are not the typical method definition (e.g. C<int>.m<U>)
     // this field is null; to obtain the instantiation use LoadMethodInstantiation
-    PlainPointer<PTR_Dictionary> m_pPerInstInfo;  //SHARED
+    PTR_Dictionary m_pPerInstInfo;  //SHARED
 
 private:
     WORD          m_wFlags2;
@@ -3578,7 +3566,7 @@ inline PTR_MethodTable MethodDesc::GetMethodTable() const
     return GetMethodTable_NoLogging();
 }
 
-inline DPTR(RelativeFixupPointer<PTR_MethodTable>) MethodDesc::GetMethodTablePtr() const
+inline DPTR(PTR_MethodTable) MethodDesc::GetMethodTablePtr() const
 {
     LIMITED_METHOD_DAC_CONTRACT;
 
@@ -3678,7 +3666,7 @@ inline BOOL MethodDesc::SanityCheck()
     {
         // If it looks good, do a more intensive sanity test. We don't care about the result,
         // we just want it to not AV.
-        return GetMethodTable() == m_pDebugMethodTable.GetValue() && this->GetModule() != NULL;
+        return GetMethodTable() == m_pDebugMethodTable && this->GetModule() != NULL;
     }
 
     return TRUE;
index 0a6931f..9a63100 100644 (file)
@@ -32,7 +32,7 @@ void EntryPointSlots::Backpatch_Locked(TADDR slot, SlotType slotType, PCODE entr
             break;
 
         case SlotType_Vtable:
-            ((MethodTable::VTableIndir2_t *)slot)->SetValue(entryPoint);
+            *((MethodTable::VTableIndir2_t *)slot) = entryPoint;
             break;
 
         case SlotType_Executable:
index 60ad60d..13a4b73 100644 (file)
@@ -85,10 +85,10 @@ PTR_MethodDesc MethodImpl::GetMethodDesc(DWORD slotIndex, PTR_MethodDesc default
     }
     CONTRACTL_END
 
-    DPTR(RelativePointer<PTR_MethodDesc>) pRelPtrForSlot = GetImpMDsNonNull();
+    DPTR(PTR_MethodDesc) pRelPtrForSlot = GetImpMDsNonNull();
     // The method descs are not offset by one
-    TADDR base = dac_cast<TADDR>(pRelPtrForSlot) + slotIndex * sizeof(RelativePointer<MethodDesc *>);
-    PTR_MethodDesc result = RelativePointer<PTR_MethodDesc>::GetValueMaybeNullAtPtr(base);
+    TADDR base = dac_cast<TADDR>(pRelPtrForSlot) + slotIndex * sizeof(MethodDesc *);
+    PTR_MethodDesc result = *dac_cast<DPTR(PTR_MethodDesc)>(base);
 
     // Prejitted images may leave NULL in this table if
     // the methoddesc is declared in another module.
@@ -114,13 +114,13 @@ MethodDesc *MethodImpl::RestoreSlot(DWORD index, MethodTable *pMT)
         NOTHROW;
         GC_NOTRIGGER;
         FORBID_FAULT;
-        PRECONDITION(!pdwSlots.IsNull());
+        PRECONDITION(pdwSlots != NULL);
     }
     CONTRACTL_END
 
     MethodDesc *result;
 
-    PREFIX_ASSUME(!pdwSlots.IsNull());
+    PREFIX_ASSUME(pdwSlots != NULL);
     DWORD slot = GetSlots()[index];
 
     // Since the overridden method is in a different module, we
@@ -141,7 +141,7 @@ MethodDesc *MethodImpl::RestoreSlot(DWORD index, MethodTable *pMT)
 
     _ASSERTE(result != NULL);
 
-    pImplementedMD.GetValue()[index].SetValue(result);
+    pImplementedMD[index] = result;
 
     return result;
 }
@@ -153,7 +153,7 @@ void MethodImpl::SetSize(LoaderHeap *pHeap, AllocMemTracker *pamTracker, DWORD s
         THROWS;
         GC_NOTRIGGER;
         PRECONDITION(CheckPointer(this));
-        PRECONDITION(pdwSlots.GetValueMaybeNull()==NULL && pImplementedMD.GetValueMaybeNull()==NULL);
+        PRECONDITION(pdwSlots==NULL && pImplementedMD==NULL);
         INJECT_FAULT(ThrowOutOfMemory());
     } CONTRACTL_END;
 
@@ -164,7 +164,7 @@ void MethodImpl::SetSize(LoaderHeap *pHeap, AllocMemTracker *pamTracker, DWORD s
                                     S_SIZE_T(size) * S_SIZE_T(sizeof(mdToken)); // Token each for the method tokens
 
         // MethodDesc* for each of the implemented methods
-        S_SIZE_T cbMethodDescs = S_SIZE_T(size) * S_SIZE_T(sizeof(RelativePointer<MethodDesc *>));
+        S_SIZE_T cbMethodDescs = S_SIZE_T(size) * S_SIZE_T(sizeof(MethodDesc *));
 
         // Need to align-up the slot entries so that the MethodDesc* array starts on a pointer boundary.
         cbCountAndSlots.AlignUp(sizeof(MethodDesc*));
@@ -176,38 +176,38 @@ void MethodImpl::SetSize(LoaderHeap *pHeap, AllocMemTracker *pamTracker, DWORD s
         LPBYTE pAllocData = (BYTE*)pamTracker->Track(pHeap->AllocMem(cbTotal));
 
         // Set the count and slot array
-        pdwSlots.SetValue((DWORD*)pAllocData);
+        pdwSlots = (DWORD*)pAllocData;
 
         // Set the MethodDesc* array. Make sure to adjust for alignment.
-        pImplementedMD.SetValue((RelativePointer<MethodDesc*> *)ALIGN_UP(pAllocData + cbCountAndSlots.Value(), sizeof(RelativePointer <MethodDesc*>)));
+        pImplementedMD = (MethodDesc**)ALIGN_UP(pAllocData + cbCountAndSlots.Value(), sizeof(MethodDesc*));
 
         // Store the count in the first entry
-        *pdwSlots.GetValue() = size;
+        *pdwSlots = size;
     }
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////
-void MethodImpl::SetData(DWORD* slots, mdToken* tokens, RelativePointer<MethodDesc*>* md)
+void MethodImpl::SetData(DWORD* slots, mdToken* tokens, MethodDesc** md)
 {
     CONTRACTL {
         NOTHROW;
         GC_NOTRIGGER;
         PRECONDITION(CheckPointer(this));
-        PRECONDITION(!pdwSlots.IsNull());
+        PRECONDITION(pdwSlots != NULL);
     } CONTRACTL_END;
 
-    DWORD *pdwSize = pdwSlots.GetValue();
+    DWORD *pdwSize = pdwSlots;
     DWORD dwSize = *pdwSize;
     memcpy(&(pdwSize[1]), slots, dwSize*sizeof(DWORD));
 
     // Copy tokens that correspond to the slots above
     memcpy(&(pdwSize[1 + dwSize]), tokens, dwSize*sizeof(mdToken));
 
-    RelativePointer<MethodDesc *> *pImplMD = pImplementedMD.GetValue();
+    MethodDesc **pImplMD = pImplementedMD;
 
     for (uint32_t i = 0; i < dwSize; ++i)
     {
-        pImplMD[i].SetValue(md[i].GetValue());
+        pImplMD[i] = md[i];
     }
 }
 
@@ -234,11 +234,11 @@ MethodImpl::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
         if (GetImpMDs().IsValid())
         {
             DacEnumMemoryRegion(dac_cast<TADDR>(GetImpMDsNonNull()),
-                                numSlots * sizeof(RelativePointer<MethodDesc *>));
+                                numSlots * sizeof(MethodDesc *));
             for (DWORD i = 0; i < numSlots; i++)
             {
-                DPTR(RelativePointer<PTR_MethodDesc>) pRelPtr = GetImpMDsNonNull();
-                PTR_MethodDesc methodDesc = pRelPtr[i].GetValueMaybeNull();
+                DPTR(PTR_MethodDesc) pRelPtr = GetImpMDsNonNull();
+                PTR_MethodDesc methodDesc = pRelPtr[i];
                 if (methodDesc.IsValid())
                 {
                     methodDesc->EnumMemoryRegions(flags);
index 0dc557b..ad68a60 100644 (file)
@@ -23,8 +23,8 @@ class MethodImpl
     friend class NativeImageDumper;
 #endif
 
-    RelativePointer<PTR_DWORD>            pdwSlots;       // Maintains the slots and tokens in sorted order, the first entry is the size
-    RelativePointer<DPTR( RelativePointer<PTR_MethodDesc> )> pImplementedMD;
+    PTR_DWORD            pdwSlots;       // Maintains the slots and tokens in sorted order, the first entry is the size
+    DPTR( PTR_MethodDesc ) pImplementedMD;
 
 public:
 
@@ -52,16 +52,17 @@ public:
     };
 #endif // !DACCESS_COMPILE
 
-    inline DPTR(RelativePointer<PTR_MethodDesc>) GetImpMDs()
+    inline DPTR(PTR_MethodDesc) GetImpMDs()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<DPTR(RelativePointer<PTR_MethodDesc>)>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(MethodImpl, this, pImplementedMD));
+        return pImplementedMD;
     }
 
-    inline DPTR(RelativePointer<PTR_MethodDesc>) GetImpMDsNonNull()
+    inline DPTR(PTR_MethodDesc) GetImpMDsNonNull()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<DPTR(RelativePointer<PTR_MethodDesc>)>::GetValueAtPtr(PTR_HOST_MEMBER_TADDR(MethodImpl, this, pImplementedMD));
+        _ASSERTE(pImplementedMD != NULL);
+        return pImplementedMD;
     }
 
     ///////////////////////////////////////////////////////////////////////////////////////
@@ -73,7 +74,7 @@ public:
             PRECONDITION(CheckPointer(this));
         } CONTRACTL_END;
 
-        if(pdwSlots.IsNull())
+        if(pdwSlots == NULL)
             return 0;
         else
             return *GetSlotsRawNonNull();
@@ -89,7 +90,7 @@ public:
             SUPPORTS_DAC;
         } CONTRACTL_END;
 
-        if(pdwSlots.IsNull())
+        if(pdwSlots == NULL)
             return NULL;
         else
             return GetSlotsRawNonNull() + 1;
@@ -98,13 +99,14 @@ public:
     inline PTR_DWORD GetSlotsRaw()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<PTR_DWORD>::GetValueMaybeNullAtPtr(PTR_HOST_MEMBER_TADDR(MethodImpl, this, pdwSlots));
+        return pdwSlots;
     }
 
     inline PTR_DWORD GetSlotsRawNonNull()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return RelativePointer<PTR_DWORD>::GetValueAtPtr(PTR_HOST_MEMBER_TADDR(MethodImpl, this, pdwSlots));
+        _ASSERTE(pdwSlots);
+        return pdwSlots;
     }
 
 #ifndef DACCESS_COMPILE
@@ -119,7 +121,7 @@ public:
             SUPPORTS_DAC;
         } CONTRACTL_END;
 
-        if (pdwSlots.IsNull())
+        if (pdwSlots == NULL)
             return NULL;
         else
             return (mdToken*)(GetSlotsRawNonNull() + 1 + *GetSlotsRawNonNull());
@@ -129,7 +131,7 @@ public:
     void SetSize(LoaderHeap *pHeap, AllocMemTracker *pamTracker, DWORD size);
 
     ///////////////////////////////////////////////////////////////////////////////////////
-    void SetData(DWORD* slots, mdToken* tokens, RelativePointer<MethodDesc*> * md);
+    void SetData(DWORD* slots, mdToken* tokens, MethodDesc** md);
 
 #endif // !DACCESS_COMPILE
 
index a8019fc..9db0a2f 100644 (file)
@@ -380,7 +380,7 @@ PTR_Module MethodTable::GetModule()
         return pMTForModule->GetLoaderModule();
 
     TADDR pSlot = pMTForModule->GetMultipurposeSlotPtr(enum_flag_HasModuleOverride, c_ModuleOverrideOffsets);
-    return RelativeFixupPointer<PTR_Module>::GetValueAtPtr(pSlot);
+    return *dac_cast<DPTR(PTR_Module)>(pSlot);
 }
 
 //==========================================================================================
@@ -397,7 +397,7 @@ PTR_Module MethodTable::GetModule_NoLogging()
         return pMTForModule->GetLoaderModule();
 
     TADDR pSlot = pMTForModule->GetMultipurposeSlotPtr(enum_flag_HasModuleOverride, c_ModuleOverrideOffsets);
-    return RelativeFixupPointer<PTR_Module>::GetValueAtPtr(pSlot);
+    return *dac_cast<DPTR(PTR_Module)>(pSlot);
 }
 
 //==========================================================================================
@@ -417,7 +417,7 @@ PTR_DispatchMap MethodTable::GetDispatchMap()
     g_IBCLogger.LogDispatchMapAccess(pMT);
 
     TADDR pSlot = pMT->GetMultipurposeSlotPtr(enum_flag_HasDispatchMapSlot, c_DispatchMapSlotOffsets);
-    return RelativePointer<PTR_DispatchMap>::GetValueAtPtr(pSlot);
+    return *dac_cast<DPTR(PTR_DispatchMap)>(pSlot);
 }
 
 //==========================================================================================
@@ -456,7 +456,7 @@ void MethodTable::SetModule(Module * pModule)
 
     if (HasModuleOverride())
     {
-        GetModuleOverridePtr()->SetValue(pModule);
+        *GetModuleOverridePtr() = pModule;
     }
 
     _ASSERTE(GetModule() == pModule);
@@ -957,7 +957,7 @@ void MethodTable::SetInterfaceMap(WORD wNumInterfaces, InterfaceInfo_t* iMap)
     m_wNumInterfaces = wNumInterfaces;
 
     CONSISTENCY_CHECK(IS_ALIGNED(iMap, sizeof(void*)));
-    m_pInterfaceMap.SetValue(iMap);
+    m_pInterfaceMap = iMap;
 }
 
 //==========================================================================================
@@ -1166,7 +1166,7 @@ void MethodTable::AddDynamicInterface(MethodTable *pItfMT)
     *(((DWORD_PTR *)pNewItfMap) - 1) = NumDynAddedInterfaces + 1;
 
     // Switch the old interface map with the new one.
-    m_pInterfaceMap.SetValueVolatile(pNewItfMap);
+    VolatileStore(&m_pInterfaceMap, pNewItfMap);
 
     // Log the fact that we leaked the interface vtable map.
 #ifdef _DEBUG
@@ -1207,7 +1207,7 @@ void MethodTable::SetupGenericsStaticsInfo(FieldDesc* pStaticFieldDescs)
         pInfo->m_DynamicTypeID = (SIZE_T)-1;
     }
 
-    pInfo->m_pFieldDescs.SetValueMaybeNull(pStaticFieldDescs);
+    pInfo->m_pFieldDescs = pStaticFieldDescs;
 }
 
 #endif // !DACCESS_COMPILE
@@ -4373,8 +4373,7 @@ PTR_Dictionary MethodTable::GetDictionary()
     {
         // The instantiation for this class is stored in the type slots table
         // *after* any inherited slots
-        TADDR base = dac_cast<TADDR>(&(GetPerInstInfo()[GetNumDicts()-1]));
-        return PerInstInfoElem_t::GetValueMaybeNullAtPtr(base);
+        return GetPerInstInfo()[GetNumDicts()-1];
     }
     else
     {
@@ -4391,8 +4390,7 @@ Instantiation MethodTable::GetInstantiation()
     if (HasInstantiation())
     {
         PTR_GenericsDictInfo  pDictInfo = GetGenericsDictInfo();
-        TADDR base = dac_cast<TADDR>(&(GetPerInstInfo()[pDictInfo->m_wNumDicts-1]));
-        return Instantiation(PerInstInfoElem_t::GetValueMaybeNullAtPtr(base)->GetInstantiation(), pDictInfo->m_wNumTyPars);
+        return Instantiation(GetPerInstInfo()[pDictInfo->m_wNumDicts-1]->GetInstantiation(), pDictInfo->m_wNumTyPars);
     }
     else
     {
@@ -5905,7 +5903,7 @@ MethodDesc* MethodTable::GetMethodDescForSlotAddress(PCODE addr, BOOL fSpeculati
         GC_NOTRIGGER;
         NOTHROW;
         POSTCONDITION(CheckPointer(RETVAL, NULL_NOT_OK));
-        POSTCONDITION(RETVAL->m_pDebugMethodTable.IsNull() || // We must be in BuildMethdTableThrowing()
+        POSTCONDITION(RETVAL->m_pDebugMethodTable == NULL || // We must be in BuildMethdTableThrowing()
                       RETVAL->SanityCheck());
     }
     CONTRACT_END;
@@ -5986,7 +5984,7 @@ BOOL MethodTable::SanityCheck()
     // strings have component size2, all other non-arrays should have 0
     _ASSERTE((GetComponentSize() <= 2) || IsArray());
 
-    if (m_pEEClass.IsNull())
+    if (m_pEEClass == NULL)
     {
         return FALSE;
     }
@@ -6134,7 +6132,7 @@ BOOL MethodTable::IsParentMethodTablePointerValid()
     if (!GetWriteableData_NoLogging()->IsParentMethodTablePointerValid())
         return FALSE;
 
-    return !IsParentMethodTableTagged(dac_cast<PTR_MethodTable>(this));
+    return TRUE;
 }
 #endif
 
@@ -7349,7 +7347,7 @@ MethodTable::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
         DacEnumMemoryRegion(dac_cast<TADDR>(it.GetIndirectionSlot()), it.GetSize());
     }
 
-    PTR_MethodTableWriteableData pWriteableData = ReadPointer(this, &MethodTable::m_pWriteableData);
+    PTR_MethodTableWriteableData pWriteableData = m_pWriteableData;
     if (pWriteableData.IsValid())
     {
         pWriteableData.EnumMem();
@@ -7529,13 +7527,13 @@ void MethodTable::SetSlot(UINT32 slotNumber, PCODE slotCode)
 
         if (!IsCanonicalMethodTable())
         {
-            if (GetVtableIndirections()[indirectionIndex].GetValueMaybeNull() == GetCanonicalMethodTable()->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull())
+            if (GetVtableIndirections()[indirectionIndex] == GetCanonicalMethodTable()->GetVtableIndirections()[indirectionIndex])
                 fSharedVtableChunk = TRUE;
         }
 
         if (slotNumber < GetNumParentVirtuals())
         {
-            if (GetVtableIndirections()[indirectionIndex].GetValueMaybeNull() == GetParentMethodTable()->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull())
+            if (GetVtableIndirections()[indirectionIndex] == GetParentMethodTable()->GetVtableIndirections()[indirectionIndex])
                 fSharedVtableChunk = TRUE;
         }
 
@@ -7554,15 +7552,7 @@ void MethodTable::SetSlot(UINT32 slotNumber, PCODE slotCode)
     _ASSERTE(IsThumbCode(slotCode));
 #endif
 
-    TADDR slot = GetSlotPtrRaw(slotNumber);
-    if (slotNumber < GetNumVirtuals())
-    {
-        ((MethodTable::VTableIndir2_t *) slot)->SetValueMaybeNull(slotCode);
-    }
-    else
-    {
-        *((PCODE *)slot) = slotCode;
-    }
+    *GetSlotPtrRaw(slotNumber) = slotCode;
 }
 
 //==========================================================================================
@@ -8091,9 +8081,9 @@ BOOL MethodTable::Validate()
     ASSERT_AND_CHECK(SanityCheck());
 
 #ifdef _DEBUG
-    ASSERT_AND_CHECK(!m_pWriteableData.IsNull());
+    ASSERT_AND_CHECK(m_pWriteableData != NULL);
 
-    MethodTableWriteableData *pWriteableData = m_pWriteableData.GetValue();
+    MethodTableWriteableData *pWriteableData = m_pWriteableData;
     DWORD dwLastVerifiedGCCnt = pWriteableData->m_dwLastVerifedGCCnt;
     // Here we used to assert that (dwLastVerifiedGCCnt <= GCHeapUtilities::GetGCHeap()->GetGcCount()) but
     // this is no longer true because with background gc. Since the purpose of having
index 6d71684..b2da048 100644 (file)
@@ -24,7 +24,6 @@
 #include "eehash.h"
 #include "contractimpl.h"
 #include "generics.h"
-#include "fixuppointer.h"
 #include "gcinfotypes.h"
 
 /*
@@ -252,7 +251,7 @@ typedef DPTR(GenericsDictInfo) PTR_GenericsDictInfo;
 struct GenericsStaticsInfo
 {
     // Pointer to field descs for statics
-    RelativePointer<PTR_FieldDesc> m_pFieldDescs;
+    PTR_FieldDesc       m_pFieldDescs;
 
     // Method table ID for statics
     SIZE_T              m_DynamicTypeID;
@@ -1226,9 +1225,6 @@ public:
     // code with the given MT because of generics.
     PTR_MethodTable GetCanonicalMethodTable();
 
-    // Returns fixup if canonical method table needs fixing up, NULL otherwise
-    TADDR GetCanonicalMethodTableFixup();
-
     //-------------------------------------------------------------------
     // Accessing methods by slot number
     //
@@ -1247,13 +1243,7 @@ public:
         WRAPPER_NO_CONTRACT;
         CONSISTENCY_CHECK(slotNumber < GetNumVtableSlots());
 
-        TADDR pSlot = GetSlotPtrRaw(slotNumber);
-        if (slotNumber < GetNumVirtuals())
-        {
-            return VTableIndir2_t::GetValueMaybeNullAtPtr(pSlot);
-        }
-
-        return *dac_cast<PTR_PCODE>(pSlot);
+        return *GetSlotPtrRaw(slotNumber);
     }
 
     // Special-case for when we know that the slot number corresponds
@@ -1264,43 +1254,36 @@ public:
 
         CONSISTENCY_CHECK(slotNum < GetNumVirtuals());
         // Virtual slots live in chunks pointed to by vtable indirections
-
-        DWORD index = GetIndexOfVtableIndirection(slotNum);
-        TADDR base = dac_cast<TADDR>(&(GetVtableIndirections()[index]));
-        DPTR(VTableIndir2_t) baseAfterInd = VTableIndir_t::GetValueMaybeNullAtPtr(base) + GetIndexAfterVtableIndirection(slotNum);
-        return VTableIndir2_t::GetValueMaybeNullAtPtr(dac_cast<TADDR>(baseAfterInd));
+        return *(GetVtableIndirections()[GetIndexOfVtableIndirection(slotNum)] + GetIndexAfterVtableIndirection(slotNum));
     }
 
-    TADDR GetSlotPtrRaw(UINT32 slotNum)
+    PTR_PCODE GetSlotPtrRaw(UINT32 slotNum)
     {
         WRAPPER_NO_CONTRACT;
         CONSISTENCY_CHECK(slotNum < GetNumVtableSlots());
 
         if (slotNum < GetNumVirtuals())
         {
-            // Virtual slots live in chunks pointed to by vtable indirections
-            DWORD index = GetIndexOfVtableIndirection(slotNum);
-            TADDR base = dac_cast<TADDR>(&(GetVtableIndirections()[index]));
-            DPTR(VTableIndir2_t) baseAfterInd = VTableIndir_t::GetValueMaybeNullAtPtr(base) + GetIndexAfterVtableIndirection(slotNum);
-            return dac_cast<TADDR>(baseAfterInd);
+             // Virtual slots live in chunks pointed to by vtable indirections
+            return GetVtableIndirections()[GetIndexOfVtableIndirection(slotNum)] + GetIndexAfterVtableIndirection(slotNum);
         }
         else if (HasSingleNonVirtualSlot())
         {
             // Non-virtual slots < GetNumVtableSlots live in a single chunk pointed to by an optional member,
             // except when there is only one in which case it lives in the optional member itself
             _ASSERTE(slotNum == GetNumVirtuals());
-            return GetNonVirtualSlotsPtr();
+            return dac_cast<PTR_PCODE>(GetNonVirtualSlotsPtr());
         }
         else
         {
             // Non-virtual slots < GetNumVtableSlots live in a single chunk pointed to by an optional member
             _ASSERTE(HasNonVirtualSlotsArray());
             g_IBCLogger.LogMethodTableNonVirtualSlotsAccess(this);
-            return dac_cast<TADDR>(GetNonVirtualSlotsArray() + (slotNum - GetNumVirtuals()));
+            return GetNonVirtualSlotsArray() + (slotNum - GetNumVirtuals());
         }
     }
 
-    TADDR GetSlotPtr(UINT32 slotNum)
+    PTR_PCODE GetSlotPtr(UINT32 slotNum)
     {
         WRAPPER_NO_CONTRACT;
         return GetSlotPtrRaw(slotNum);
@@ -1361,8 +1344,8 @@ public:
     #define VTABLE_SLOTS_PER_CHUNK 8
     #define VTABLE_SLOTS_PER_CHUNK_LOG2 3
 
-    typedef PlainPointer<PCODE> VTableIndir2_t;
-    typedef PlainPointer<DPTR(VTableIndir2_t)> VTableIndir_t;
+    typedef PCODE VTableIndir2_t;
+    typedef DPTR(VTableIndir2_t) VTableIndir_t;
 
     static DWORD GetIndexOfVtableIndirection(DWORD slotNum);
     static DWORD GetStartSlotForVtableIndirection(UINT32 indirectionIndex, DWORD wNumVirtuals);
@@ -1431,7 +1414,7 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
         _ASSERTE(HasNonVirtualSlotsArray());
-        return RelativePointer<PTR_PCODE>::GetValueAtPtr(GetNonVirtualSlotsPtr());
+        return *dac_cast<PTR_PTR_PCODE>(GetNonVirtualSlotsPtr());
     }
 
 #ifndef DACCESS_COMPILE
@@ -1440,8 +1423,7 @@ public:
         LIMITED_METHOD_CONTRACT;
         _ASSERTE(HasNonVirtualSlotsArray());
 
-        RelativePointer<PCODE *> *pRelPtr = (RelativePointer<PCODE *> *)GetNonVirtualSlotsPtr();
-        pRelPtr->SetValue(slots);
+        *(PCODE **)GetNonVirtualSlotsPtr() = slots;
     }
 
     inline void SetHasSingleNonVirtualSlot()
@@ -1830,9 +1812,6 @@ public:
     //-------------------------------------------------------------------
     // THE METHOD TABLE PARENT (SUPERCLASS/BASE CLASS)
     //
-#define PARENT_MT_FIXUP_OFFSET ((SSIZE_T)offsetof(MethodTable, m_pParentMethodTable))
-    typedef IndirectPointer<PTR_MethodTable> ParentMT_t;
-
     BOOL HasApproxParent()
     {
         LIMITED_METHOD_DAC_CONTRACT;
@@ -1851,50 +1830,14 @@ public:
         LIMITED_METHOD_DAC_CONTRACT;
 
         PRECONDITION(IsParentMethodTablePointerValid());
-        return ReadPointerMaybeNull(this, &MethodTable::m_pParentMethodTable, GetFlagHasIndirectParent());
-    }
-
-    inline static PTR_VOID GetParentMethodTableOrIndirection(PTR_VOID pMT)
-    {
-        WRAPPER_NO_CONTRACT;
-        return PTR_VOID(*PTR_TADDR(dac_cast<TADDR>(pMT) + offsetof(MethodTable, m_pParentMethodTable)));
-    }
-
-    inline static BOOL IsParentMethodTableTagged(PTR_MethodTable pMT)
-    {
-        LIMITED_METHOD_CONTRACT;
-        TADDR base = dac_cast<TADDR>(pMT) + offsetof(MethodTable, m_pParentMethodTable);
-        return pMT->m_pParentMethodTable.IsTaggedIndirect(base, pMT->GetFlagHasIndirectParent(), PARENT_MT_FIXUP_OFFSET);
-    }
-
-    bool GetFlagHasIndirectParent()
-    {
-        return false;
+        return m_pParentMethodTable;
     }
 
 #ifndef DACCESS_COMPILE
-    inline ParentMT_t * GetParentMethodTablePointerPtr()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return &m_pParentMethodTable;
-    }
-
-    inline bool IsParentMethodTableIndirectPointerMaybeNull()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return m_pParentMethodTable.IsIndirectPtrMaybeNullIndirect(GetFlagHasIndirectParent(), PARENT_MT_FIXUP_OFFSET);
-    }
-
-    inline bool IsParentMethodTableIndirectPointer()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return m_pParentMethodTable.IsIndirectPtrIndirect(GetFlagHasIndirectParent(), PARENT_MT_FIXUP_OFFSET);
-    }
-
     inline MethodTable ** GetParentMethodTableValuePtr()
     {
         LIMITED_METHOD_CONTRACT;
-        return m_pParentMethodTable.GetValuePtrIndirect(GetFlagHasIndirectParent(), PARENT_MT_FIXUP_OFFSET);
+        return &m_pParentMethodTable;
     }
 #endif // !DACCESS_COMPILE
 
@@ -1915,8 +1858,7 @@ public:
     void SetParentMethodTable (MethodTable *pParentMethodTable)
     {
         LIMITED_METHOD_CONTRACT;
-        PRECONDITION(!IsParentMethodTableIndirectPointerMaybeNull());
-        m_pParentMethodTable.SetValueMaybeNull(pParentMethodTable);
+        m_pParentMethodTable = pParentMethodTable;
 #ifdef _DEBUG
         GetWriteableDataForWrite_NoLogging()->SetParentMethodTablePointerValid();
 #endif
@@ -1962,12 +1904,12 @@ public:
     inline void SetClass(EEClass *pClass)
     {
         LIMITED_METHOD_CONTRACT;
-        m_pEEClass.SetValue(pClass);
+        m_pEEClass = pClass;
     }
 
     inline void SetCanonicalMethodTable(MethodTable * pMT)
     {
-        m_pCanonMT.SetValue((TADDR)pMT | MethodTable::UNION_METHODTABLE);
+        m_pCanonMT = (TADDR)pMT | MethodTable::UNION_METHODTABLE;
     }
 #endif
 
@@ -2268,9 +2210,7 @@ public:
         _ASSERTE(HasDispatchMapSlot());
 
         TADDR pSlot = GetMultipurposeSlotPtr(enum_flag_HasDispatchMapSlot, c_DispatchMapSlotOffsets);
-
-        RelativePointer<DispatchMap *> *pRelPtr = (RelativePointer<DispatchMap *> *)pSlot;
-        pRelPtr->SetValue(pDispatchMap);
+        *(DispatchMap **)pSlot = pDispatchMap;
     }
 #endif // !DACCESS_COMPILE
 
@@ -2447,7 +2387,7 @@ public:
     {
         WRAPPER_NO_CONTRACT;
         _ASSERTE(HasGenericsStaticsInfo());
-        return ReadPointerMaybeNull((GenericsStaticsInfo *)GetGenericsStaticsInfo(), &GenericsStaticsInfo::m_pFieldDescs);
+        return GetGenericsStaticsInfo()->m_pFieldDescs;
     }
 
     BOOL HasCrossModuleGenericStaticsInfo()
@@ -2763,15 +2703,15 @@ public:
     // must have a dictionary entry. On the other hand, for instantiations shared with Dict<string,double> the opposite holds.
     //
 
-    typedef PlainPointer<PTR_Dictionary> PerInstInfoElem_t;
-    typedef PlainPointer<DPTR(PerInstInfoElem_t)> PerInstInfo_t;
+    typedef PTR_Dictionary PerInstInfoElem_t;
+    typedef DPTR(PerInstInfoElem_t) PerInstInfo_t;
 
     // Return a pointer to the per-instantiation information. See field itself for comments.
     DPTR(PerInstInfoElem_t) GetPerInstInfo()
     {
         LIMITED_METHOD_DAC_CONTRACT;
         _ASSERTE(HasPerInstInfo());
-        return ReadPointer(this, &MethodTable::m_pPerInstInfo);
+        return m_pPerInstInfo;
     }
     BOOL HasPerInstInfo()
     {
@@ -2779,11 +2719,6 @@ public:
         return GetFlag(enum_flag_HasPerInstInfo) && !IsArray();
     }
 #ifndef DACCESS_COMPILE
-    static inline bool IsPerInstInfoRelative()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return decltype(m_pPerInstInfo)::isRelative;
-    }
     static inline DWORD GetOffsetOfPerInstInfo()
     {
         LIMITED_METHOD_CONTRACT;
@@ -2792,7 +2727,7 @@ public:
     void SetPerInstInfo(PerInstInfoElem_t *pPerInstInfo)
     {
         LIMITED_METHOD_CONTRACT;
-        m_pPerInstInfo.SetValue(pPerInstInfo);
+        m_pPerInstInfo = pPerInstInfo;
     }
     void SetDictInfo(WORD numDicts, WORD numTyPars)
     {
@@ -2868,7 +2803,7 @@ public:
     {
         LIMITED_METHOD_CONTRACT;
         _ASSERTE(pMTWriteableData);
-        m_pWriteableData.SetValue(pMTWriteableData);
+        m_pWriteableData = pMTWriteableData;
     }
 #endif
 
@@ -2882,7 +2817,7 @@ public:
     inline PTR_Const_MethodTableWriteableData GetWriteableData_NoLogging() const
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return ReadPointer(this, &MethodTable::m_pWriteableData);
+        return MethodTable::m_pWriteableData;
     }
 
     inline PTR_MethodTableWriteableData GetWriteableDataForWrite()
@@ -2895,7 +2830,7 @@ public:
     inline PTR_MethodTableWriteableData GetWriteableDataForWrite_NoLogging()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return ReadPointer(this, &MethodTable::m_pWriteableData);
+        return MethodTable::m_pWriteableData;
     }
 
     //-------------------------------------------------------------------
@@ -3556,7 +3491,7 @@ private:
 
         enum_flag_ICastable                   = 0x00400000, // class implements ICastable interface
 
-        enum_flag_HasIndirectParent           = 0x00800000, // m_pParentMethodTable has double indirection
+        enum_flag_Unused_1                    = 0x00800000,
 
         enum_flag_ContainsPointers            = 0x01000000,
 
@@ -3715,29 +3650,22 @@ private:
     LPCUTF8         debug_m_szClassName;
 #endif //_DEBUG
 
-    // On Linux ARM is a RelativeFixupPointer. Otherwise,
-    // Parent PTR_MethodTable if enum_flag_HasIndirectParent is not set. Pointer to indirection cell
-    // if enum_flag_enum_flag_HasIndirectParent is set. The indirection is offset by offsetof(MethodTable, m_pParentMethodTable).
-    // It allows casting helpers to go through parent chain natually. Casting helper do not need need the explicit check
-    // for enum_flag_HasIndirectParentMethodTable.
-    ParentMT_t m_pParentMethodTable;
+    PTR_MethodTable m_pParentMethodTable;
 
-    RelativePointer<PTR_Module> m_pLoaderModule;    // LoaderModule. It is equal to the ZapModule in ngened images
+    PTR_Module      m_pLoaderModule;    // LoaderModule. It is equal to the ZapModule in ngened images
 
-    PlainPointer<PTR_MethodTableWriteableData> m_pWriteableData;
+    PTR_MethodTableWriteableData m_pWriteableData;
 
     // The value of lowest two bits describe what the union contains
     enum LowBits {
         UNION_EECLASS      = 0,    //  0 - pointer to EEClass. This MethodTable is the canonical method table.
-        UNION_INVALID      = 1,    //  1 - not used
-        UNION_METHODTABLE  = 2,    //  2 - pointer to canonical MethodTable.
-        UNION_INDIRECTION  = 3     //  3 - pointer to indirection cell that points to canonical MethodTable.
-    };                             //      (used only if FEATURE_PREJIT is defined)
-    static const TADDR UNION_MASK = 3;
+        UNION_METHODTABLE  = 1,    //  1 - pointer to canonical MethodTable.
+    };
+    static const TADDR UNION_MASK = 1;
 
     union {
-        PlainPointer<DPTR(EEClass)> m_pEEClass;
-        PlainPointer<TADDR> m_pCanonMT;
+        DPTR(EEClass) m_pEEClass;
+        TADDR m_pCanonMT;
     };
 
     __forceinline static LowBits union_getLowBits(TADDR pCanonMT)
@@ -3766,7 +3694,7 @@ private:
     public:
     union
     {
-        PlainPointer<PTR_InterfaceInfo>   m_pInterfaceMap;
+        PTR_InterfaceInfo   m_pInterfaceMap;
         TADDR               m_pMultipurposeSlot2;
     };
 
@@ -3906,10 +3834,10 @@ private:
         return GetFlag(enum_flag_HasModuleOverride);
     }
 
-    DPTR(RelativeFixupPointer<PTR_Module>) GetModuleOverridePtr()
+    DPTR(PTR_Module) GetModuleOverridePtr()
     {
         LIMITED_METHOD_DAC_CONTRACT;
-        return dac_cast<DPTR(RelativeFixupPointer<PTR_Module>)>(GetMultipurposeSlotPtr(enum_flag_HasModuleOverride, c_ModuleOverrideOffsets));
+        return dac_cast<DPTR(PTR_Module)>(GetMultipurposeSlotPtr(enum_flag_HasModuleOverride, c_ModuleOverrideOffsets));
     }
 
     void SetModule(Module * pModule);
index 426be31..1ff15d0 100644 (file)
@@ -22,38 +22,19 @@ FORCEINLINE PTR_EEClass MethodTable::GetClass_NoLogging()
 {
     LIMITED_METHOD_DAC_CONTRACT;
 
-    TADDR addr = ReadPointer(this, &MethodTable::m_pCanonMT);
+    TADDR addr = m_pCanonMT;
 
-#ifdef _DEBUG
     LowBits lowBits = union_getLowBits(addr);
     if (lowBits == UNION_EECLASS)
     {
         return PTR_EEClass(addr);
     }
-    else if (lowBits == UNION_METHODTABLE)
+    else
     {
         // pointer to canonical MethodTable.
         TADDR canonicalMethodTable = union_getPointer(addr);
-        return PTR_EEClass(ReadPointer((MethodTable *) PTR_MethodTable(canonicalMethodTable), &MethodTable::m_pCanonMT));
-    }
-#ifdef DACCESS_COMPILE
-    // Minidumps don't guarantee that every member of every class will be able to work here.
-#else
-    _ASSERTE(!"Malformed m_pEEClass in MethodTable");
-#endif
-    return NULL;
-
-#else
-
-    if ((addr & 2) == 0)
-    {
-        // pointer to EEClass
-        return PTR_EEClass(addr);
+        return PTR_EEClass(PTR_MethodTable(canonicalMethodTable)->m_pCanonMT);
     }
-
-    // pointer to canonical MethodTable.
-    return PTR_EEClass(ReadPointer((MethodTable *) PTR_MethodTable(addr - 2), &MethodTable::m_pCanonMT));
-#endif
 }
 
 //==========================================================================================
@@ -94,28 +75,24 @@ inline BOOL MethodTable::IsClassPointerValid()
     WRAPPER_NO_CONTRACT;
     SUPPORTS_DAC;
 
-    TADDR addr = ReadPointer(this, &MethodTable::m_pCanonMT);
-
-    LowBits lowBits = union_getLowBits(addr);
+    LowBits lowBits = union_getLowBits(m_pCanonMT);
     if (lowBits == UNION_EECLASS)
     {
-        return !m_pEEClass.IsNull();
+        return (m_pEEClass != NULL);
     }
-    else if (lowBits == UNION_METHODTABLE)
+    else
     {
         // pointer to canonical MethodTable.
-        TADDR canonicalMethodTable = union_getPointer(addr);
-        return !PTR_MethodTable(canonicalMethodTable)->m_pEEClass.IsNull();
+        TADDR canonicalMethodTable = union_getPointer(m_pCanonMT);
+        return (PTR_MethodTable(canonicalMethodTable)->m_pEEClass != NULL);
     }
-    _ASSERTE(!"Malformed m_pEEClass in MethodTable");
-    return FALSE;
 }
 
 //==========================================================================================
 inline PTR_Module MethodTable::GetLoaderModule()
 {
     LIMITED_METHOD_DAC_CONTRACT;
-    return ReadPointer(this, &MethodTable::m_pLoaderModule);
+    return m_pLoaderModule;
 }
 
 inline PTR_LoaderAllocator MethodTable::GetLoaderAllocator()
@@ -131,7 +108,7 @@ inline PTR_LoaderAllocator MethodTable::GetLoaderAllocator()
 inline void MethodTable::SetLoaderModule(Module* pModule)
 {
     WRAPPER_NO_CONTRACT;
-    m_pLoaderModule.SetValue(pModule);
+    m_pLoaderModule = pModule;
 }
 
 inline void MethodTable::SetLoaderAllocator(LoaderAllocator* pAllocator)
@@ -786,15 +763,14 @@ inline DPTR(MethodTable::VTableIndir2_t) MethodTable::VtableIndirectionSlotItera
     LIMITED_METHOD_DAC_CONTRACT;
     PRECONDITION(m_i != (DWORD) -1 && m_i < m_count);
 
-    return m_pSlot->GetValueMaybeNull(dac_cast<TADDR>(m_pSlot));
+    return *m_pSlot;
 }
-
 //==========================================================================================
 #ifndef DACCESS_COMPILE
 inline void MethodTable::VtableIndirectionSlotIterator::SetIndirectionSlot(DPTR(MethodTable::VTableIndir2_t) pChunk)
 {
     LIMITED_METHOD_CONTRACT;
-    m_pSlot->SetValueMaybeNull(pChunk);
+    (*m_pSlot) = pChunk;
 }
 #endif
 
@@ -905,36 +881,18 @@ inline PTR_MethodTable MethodTable::GetCanonicalMethodTable()
 {
     LIMITED_METHOD_DAC_CONTRACT;
 
-    TADDR addr = ReadPointer(this, &MethodTable::m_pCanonMT);
+    TADDR addr = m_pCanonMT;
 
-#ifdef _DEBUG
     LowBits lowBits = union_getLowBits(addr);
     if (lowBits == UNION_EECLASS)
     {
         return dac_cast<PTR_MethodTable>(this);
     }
-    else if (lowBits == UNION_METHODTABLE)
+    else
     {
         // pointer to canonical MethodTable.
         return PTR_MethodTable(union_getPointer(addr));
     }
-    _ASSERTE(!"Malformed m_pCanonMT in MethodTable");
-    return NULL;
-#else
-
-    if ((addr & 2) == 0)
-        return dac_cast<PTR_MethodTable>(this);
-
-    return PTR_MethodTable(addr - 2);
-#endif
-}
-
-//==========================================================================================
-inline TADDR MethodTable::GetCanonicalMethodTableFixup()
-{
-    LIMITED_METHOD_DAC_CONTRACT;
-
-    return NULL;
 }
 
 //==========================================================================================
@@ -1052,7 +1010,7 @@ inline BOOL MethodTable::IsCanonicalMethodTable()
 {
     LIMITED_METHOD_DAC_CONTRACT;
 
-    return (union_getLowBits(ReadPointer(this, &MethodTable::m_pCanonMT)) == UNION_EECLASS);
+    return (union_getLowBits(m_pCanonMT) == UNION_EECLASS);
 }
 
 //==========================================================================================
@@ -1086,7 +1044,7 @@ inline PTR_InterfaceInfo MethodTable::GetInterfaceMap()
 {
     LIMITED_METHOD_DAC_CONTRACT;
 
-    return ReadPointer(this, &MethodTable::m_pInterfaceMap);
+    return m_pInterfaceMap;
 }
 
 //==========================================================================================
index f82a102..f5540ee 100644 (file)
@@ -6017,12 +6017,12 @@ MethodTableBuilder::InitMethodDesc(
             NDirectMethodDesc *pNewNMD = (NDirectMethodDesc*)pNewMD;
 
             // Allocate writeable data
-            pNewNMD->ndirect.m_pWriteableData.SetValue((NDirectWriteableData*)
-                AllocateFromHighFrequencyHeap(S_SIZE_T(sizeof(NDirectWriteableData))));
+            pNewNMD->ndirect.m_pWriteableData = (NDirectWriteableData*)
+                AllocateFromHighFrequencyHeap(S_SIZE_T(sizeof(NDirectWriteableData)));
 
 #ifdef HAS_NDIRECT_IMPORT_PRECODE
-            pNewNMD->ndirect.m_pImportThunkGlue.SetValue(Precode::Allocate(PRECODE_NDIRECT_IMPORT, pNewMD,
-                GetLoaderAllocator(), GetMemTracker())->AsNDirectImportPrecode());
+            pNewNMD->ndirect.m_pImportThunkGlue = Precode::Allocate(PRECODE_NDIRECT_IMPORT, pNewMD,
+                GetLoaderAllocator(), GetMemTracker())->AsNDirectImportPrecode();
 #else // !HAS_NDIRECT_IMPORT_PRECODE
             pNewNMD->GetNDirectImportThunkGlue()->Init(pNewNMD);
 #endif // !HAS_NDIRECT_IMPORT_PRECODE
@@ -6059,18 +6059,18 @@ MethodTableBuilder::InitMethodDesc(
 
         if (strcmp(pMethodName, "Invoke") == 0)
         {
-            BAD_FORMAT_NOTHROW_ASSERT(((DelegateEEClass*)GetHalfBakedClass())->m_pInvokeMethod.IsNull());
-            ((DelegateEEClass*)GetHalfBakedClass())->m_pInvokeMethod.SetValue(pNewMD);
+            BAD_FORMAT_NOTHROW_ASSERT(((DelegateEEClass*)GetHalfBakedClass())->m_pInvokeMethod == NULL);
+            ((DelegateEEClass*)GetHalfBakedClass())->m_pInvokeMethod = pNewMD;
         }
         else if (strcmp(pMethodName, "BeginInvoke") == 0)
         {
-            BAD_FORMAT_NOTHROW_ASSERT(((DelegateEEClass*)GetHalfBakedClass())->m_pBeginInvokeMethod.IsNull());
-            ((DelegateEEClass*)GetHalfBakedClass())->m_pBeginInvokeMethod.SetValue(pNewMD);
+            BAD_FORMAT_NOTHROW_ASSERT(((DelegateEEClass*)GetHalfBakedClass())->m_pBeginInvokeMethod == NULL);
+            ((DelegateEEClass*)GetHalfBakedClass())->m_pBeginInvokeMethod = pNewMD;
         }
         else if (strcmp(pMethodName, "EndInvoke") == 0)
         {
-            BAD_FORMAT_NOTHROW_ASSERT(((DelegateEEClass*)GetHalfBakedClass())->m_pEndInvokeMethod.IsNull());
-            ((DelegateEEClass*)GetHalfBakedClass())->m_pEndInvokeMethod.SetValue(pNewMD);
+            BAD_FORMAT_NOTHROW_ASSERT(((DelegateEEClass*)GetHalfBakedClass())->m_pEndInvokeMethod == NULL);
+            ((DelegateEEClass*)GetHalfBakedClass())->m_pEndInvokeMethod = pNewMD;
         }
         else
         {
@@ -6159,7 +6159,7 @@ MethodTableBuilder::InitMethodDesc(
 #ifdef _DEBUG
     pNewMD->m_pszDebugMethodName = (LPUTF8)pszDebugMethodName;
     pNewMD->m_pszDebugClassName  = (LPUTF8)pszDebugClassName;
-    pNewMD->m_pDebugMethodTable.SetValue(GetHalfBakedMethodTable());
+    pNewMD->m_pDebugMethodTable = GetHalfBakedMethodTable();
 
     if (pszDebugMethodSignature == NULL)
         pNewMD->m_pszDebugMethodSignature = FormatSig(pNewMD,pNewMD->GetLoaderAllocator()->GetLowFrequencyHeap(),GetMemTracker());
@@ -6274,7 +6274,7 @@ MethodTableBuilder::PlaceMethodImpls()
 
     DWORD * slots = new (GetStackingAllocator()) DWORD[dwMaxSlotSize];
     mdToken * tokens = new (GetStackingAllocator()) mdToken[dwMaxSlotSize];
-    RelativePointer<MethodDesc *> * replaced = new (GetStackingAllocator()) RelativePointer<MethodDesc*>[dwMaxSlotSize];
+    MethodDesc ** replaced = new (GetStackingAllocator()) MethodDesc*[dwMaxSlotSize];
 
     DWORD iEntry = 0;
     bmtMDMethod * pCurImplMethod = bmtMethodImpl->GetImplementationMethod(iEntry);
@@ -6402,7 +6402,7 @@ MethodTableBuilder::WriteMethodImplData(
     DWORD         cSlots,
     DWORD *       rgSlots,
     mdToken *     rgTokens,
-    RelativePointer<MethodDesc *> * rgDeclMD)
+    MethodDesc ** rgDeclMD)
 {
     STANDARD_VM_CONTRACT;
 
@@ -6444,9 +6444,9 @@ MethodTableBuilder::WriteMethodImplData(
 
                 if (min != i)
                 {
-                    MethodDesc * mTmp = rgDeclMD[i].GetValue();
-                    rgDeclMD[i].SetValue(rgDeclMD[min].GetValue());
-                    rgDeclMD[min].SetValue(mTmp);
+                    MethodDesc * mTmp = rgDeclMD[i];
+                    rgDeclMD[i] = rgDeclMD[min];
+                    rgDeclMD[min] = mTmp;
 
                     DWORD sTmp = rgSlots[i];
                     rgSlots[i] = rgSlots[min];
@@ -6472,7 +6472,7 @@ MethodTableBuilder::PlaceLocalDeclarationOnClass(
     bmtMDMethod * pDecl,
     bmtMDMethod * pImpl,
     DWORD *       slots,
-    RelativePointer<MethodDesc *> * replaced,
+    MethodDesc ** replaced,
     DWORD *       pSlotIndex,
     DWORD         dwMaxSlotSize)
 {
@@ -6532,7 +6532,7 @@ MethodTableBuilder::PlaceLocalDeclarationOnClass(
     // We implement this slot, record it
     ASSERT(*pSlotIndex < dwMaxSlotSize);
     slots[*pSlotIndex] = pDecl->GetSlotIndex();
-    replaced[*pSlotIndex].SetValue(pDecl->GetMethodDesc());
+    replaced[*pSlotIndex] = pDecl->GetMethodDesc();
 
     // increment the counter
     (*pSlotIndex)++;
@@ -6633,7 +6633,7 @@ VOID MethodTableBuilder::PlaceInterfaceDeclarationOnInterface(
     bmtMethodHandle hDecl,
     bmtMDMethod   *pImpl,
     DWORD *       slots,
-    RelativePointer<MethodDesc *> * replaced,
+    MethodDesc ** replaced,
     DWORD *       pSlotIndex,
     DWORD         dwMaxSlotSize)
 {
@@ -6666,7 +6666,7 @@ VOID MethodTableBuilder::PlaceInterfaceDeclarationOnInterface(
     // We implement this slot, record it
     ASSERT(*pSlotIndex < dwMaxSlotSize);
     slots[*pSlotIndex] = hDecl.GetSlotIndex();
-    replaced[*pSlotIndex].SetValue(pDeclMD);
+    replaced[*pSlotIndex] = pDeclMD;
 
     // increment the counter
     (*pSlotIndex)++;
@@ -6678,7 +6678,7 @@ MethodTableBuilder::PlaceParentDeclarationOnClass(
     bmtRTMethod * pDecl,
     bmtMDMethod * pImpl,
     DWORD *       slots,
-    RelativePointer<MethodDesc *> * replaced,
+    MethodDesc**  replaced,
     DWORD *       pSlotIndex,
     DWORD         dwMaxSlotSize)
 {
@@ -6726,7 +6726,7 @@ MethodTableBuilder::PlaceParentDeclarationOnClass(
     // We implement this slot, record it
     ASSERT(*pSlotIndex < dwMaxSlotSize);
     slots[*pSlotIndex] = pDeclMD->GetSlot();
-    replaced[*pSlotIndex].SetValue(pDeclMD);
+    replaced[*pSlotIndex] = pDeclMD;
 
     // increment the counter
     (*pSlotIndex)++;
@@ -6788,7 +6788,7 @@ VOID MethodTableBuilder::ValidateInterfaceMethodConstraints()
             // If pTargetMT is null, this indicates that the target MethodDesc belongs
             // to the current type. Otherwise, the MethodDesc MUST be owned by a parent
             // of the type we're building.
-            BOOL              fTargetIsOwnedByParent = !pTargetMD->GetMethodTablePtr()->IsNull();
+            BOOL              fTargetIsOwnedByParent = pTargetMD->GetMethodTable() != NULL;
 
             // If the method is owned by a parent, we need to use the parent's module,
             // and we must construct the substitution chain all the way up to the parent.
@@ -8921,7 +8921,7 @@ void MethodTableBuilder::CopyExactParentSlots(MethodTable *pMT, MethodTable *pAp
         //
         // Non-canonical method tables either share everything or nothing so it is sufficient to check
         // just the first indirection to detect sharing.
-        if (pMT->GetVtableIndirections()[0].GetValueMaybeNull() != pCanonMT->GetVtableIndirections()[0].GetValueMaybeNull())
+        if (pMT->GetVtableIndirections()[0] != pCanonMT->GetVtableIndirections()[0])
         {
             MethodTable::MethodDataWrapper hCanonMTData(MethodTable::GetMethodData(pCanonMT, FALSE));
             for (DWORD i = 0; i < nParentVirtuals; i++)
@@ -8950,14 +8950,14 @@ void MethodTableBuilder::CopyExactParentSlots(MethodTable *pMT, MethodTable *pAp
             // We need to re-inherit this slot from the exact parent.
 
             DWORD indirectionIndex = MethodTable::GetIndexOfVtableIndirection(i);
-            if (pMT->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull() == pApproxParentMT->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull())
+            if (pMT->GetVtableIndirections()[indirectionIndex] == pApproxParentMT->GetVtableIndirections()[indirectionIndex])
             {
                 // The slot lives in a chunk shared from the approximate parent MT
                 // If so, we need to change to share the chunk from the exact parent MT
 
                 _ASSERTE(MethodTable::CanShareVtableChunksFrom(pParentMT, pMT->GetLoaderModule()));
 
-                pMT->GetVtableIndirections()[indirectionIndex].SetValueMaybeNull(pParentMT->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull());
+                pMT->GetVtableIndirections()[indirectionIndex] = pParentMT->GetVtableIndirections()[indirectionIndex];
 
                 i = MethodTable::GetEndSlotForVtableIndirection(indirectionIndex, nParentVirtuals) - 1;
                 continue;
@@ -10066,7 +10066,7 @@ MethodTable * MethodTableBuilder::AllocateNewMT(
         {
             // Share the parent chunk
             _ASSERTE(it.GetEndSlot() <= pMTParent->GetNumVirtuals());
-            it.SetIndirectionSlot(pMTParent->GetVtableIndirections()[it.GetIndex()].GetValueMaybeNull());
+            it.SetIndirectionSlot(pMTParent->GetVtableIndirections()[it.GetIndex()]);
         }
         else
         {
@@ -10122,12 +10122,12 @@ MethodTable * MethodTableBuilder::AllocateNewMT(
         if (cbInstAndDict)
         {
             MethodTable::PerInstInfoElem_t *pPInstInfo = (MethodTable::PerInstInfoElem_t *)(pPerInstInfo + (dwNumDicts-1));
-            pPInstInfo->SetValueMaybeNull((Dictionary*) (pPerInstInfo + dwNumDicts));
+            *pPInstInfo = (Dictionary*) (pPerInstInfo + dwNumDicts);
         }
     }
 
 #ifdef _DEBUG
-    pMT->m_pWriteableData.GetValue()->m_dwLastVerifedGCCnt = (DWORD)-1;
+    pMT->m_pWriteableData->m_dwLastVerifedGCCnt = (DWORD)-1;
 #endif // _DEBUG
 
     RETURN(pMT);
@@ -10219,7 +10219,7 @@ MethodTableBuilder::SetupMethodTable2(
                                    GetMemTracker());
 
     pMT->SetClass(pClass);
-    pClass->m_pMethodTable.SetValue(pMT);
+    pClass->m_pMethodTable = pMT;
     m_pHalfBakedMT = pMT;
 
 #ifdef _DEBUG
@@ -10345,13 +10345,13 @@ MethodTableBuilder::SetupMethodTable2(
             MethodDesc *pMD = it->GetMethodDesc();
             if (pMD != NULL)
             {
-                pMD->m_pDebugMethodTable.SetValue(pMT);
+                pMD->m_pDebugMethodTable = pMT;
                 pMD->m_pszDebugMethodSignature = FormatSig(pMD, GetLoaderAllocator()->GetLowFrequencyHeap(), GetMemTracker());
             }
             MethodDesc *pUnboxedMD = it->GetUnboxedMethodDesc();
             if (pUnboxedMD != NULL)
             {
-                pUnboxedMD->m_pDebugMethodTable.SetValue(pMT);
+                pUnboxedMD->m_pDebugMethodTable = pMT;
                 pUnboxedMD->m_pszDebugMethodSignature = FormatSig(pUnboxedMD, GetLoaderAllocator()->GetLowFrequencyHeap(), GetMemTracker());
             }
         }
@@ -10398,7 +10398,7 @@ MethodTableBuilder::SetupMethodTable2(
     // Set all field slots to point to the newly created MethodTable
     for (i = 0; i < (bmtEnumFields->dwNumStaticFields + bmtEnumFields->dwNumInstanceFields); i++)
     {
-        pFieldDescList[i].m_pMTOfEnclosingClass.SetValue(pMT);
+        pFieldDescList[i].m_pMTOfEnclosingClass = pMT;
     }
 
     // Fill in type parameters before looking up exact parent or fetching the types of any field descriptors!
@@ -10421,7 +10421,7 @@ MethodTableBuilder::SetupMethodTable2(
         {
             _ASSERTE(pLayout->GetMaxSlots() > 0);
 
-            PTR_Dictionary pDictionarySlots = pMT->GetPerInstInfo()[bmtGenerics->numDicts - 1].GetValue();
+            PTR_Dictionary pDictionarySlots = pMT->GetPerInstInfo()[bmtGenerics->numDicts - 1];
             DWORD* pSizeSlot = (DWORD*)(pDictionarySlots + bmtGenerics->GetNumGenericArgs());
             *pSizeSlot = cbDictSlotSize;
         }
@@ -10548,7 +10548,7 @@ MethodTableBuilder::SetupMethodTable2(
                 // with code:MethodDesc::SetStableEntryPointInterlocked.
                 //
                 DWORD indirectionIndex = MethodTable::GetIndexOfVtableIndirection(iCurSlot);
-                if (GetParentMethodTable()->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull() != pMT->GetVtableIndirections()[indirectionIndex].GetValueMaybeNull())
+                if (GetParentMethodTable()->GetVtableIndirections()[indirectionIndex] != pMT->GetVtableIndirections()[indirectionIndex])
                     pMT->SetSlot(iCurSlot, pMD->GetInitialEntryPointForCopiedSlot());
             }
             else
index 289fd51..42cae0b 100644 (file)
@@ -2778,7 +2778,7 @@ private:
         DWORD               cSlots,
         DWORD *             rgSlots,
         mdToken *           rgTokens,
-        RelativePointer<MethodDesc *> *       rgDeclMD);
+        MethodDesc **       rgDeclMD);
 
     // --------------------------------------------------------------------------------------------
     // Places a methodImpl pair where the decl is declared by the type being built.
@@ -2787,7 +2787,7 @@ private:
         bmtMDMethod *    pDecl,
         bmtMDMethod *    pImpl,
         DWORD*           slots,
-        RelativePointer<MethodDesc *> *     replaced,
+        MethodDesc**     replaced,
         DWORD*           pSlotIndex,
         DWORD            dwMaxSlotSize);
 
@@ -2798,7 +2798,7 @@ private:
         bmtRTMethod *     pDecl,
         bmtMDMethod *     pImpl,
         DWORD*            slots,
-        RelativePointer<MethodDesc *> *      replaced,
+        MethodDesc**      replaced,
         DWORD*            pSlotIndex,
         DWORD             dwMaxSlotSize);
 
@@ -2816,7 +2816,7 @@ private:
         bmtMethodHandle   hDecl,
         bmtMDMethod *     pImpl,
         DWORD*            slots,
-        RelativePointer<MethodDesc *> *      replaced,
+        MethodDesc**      replaced,
         DWORD*            pSlotIndex,
         DWORD             dwMaxSlotSize);
 
index e96e29e..2327469 100644 (file)
@@ -258,11 +258,11 @@ protected:
 
     PTR_Module GetModule()
     {
-        return ReadPointerMaybeNull(this, &NgenHashTable<NGEN_HASH_ARGS>::m_pModule);
+        return m_pModule;
     }
 
     // Owning module set at hash creation time (possibly NULL if this hash instance is not to be ngen'd).
-    RelativePointer<PTR_Module> m_pModule;
+    PTR_Module m_pModule;
 
 private:
     // Internal implementation details. Nothing of interest to sub-classers for here on.
@@ -307,14 +307,14 @@ private:
     {
         SUPPORTS_DAC;
 
-        return ReadPointer(this, &NgenHashTable<NGEN_HASH_ARGS>::m_pWarmBuckets);
+        return m_pWarmBuckets;
     }
 
     // Loader heap provided at construction time. May be NULL (in which case m_pModule must *not* be NULL).
     LoaderHeap             *m_pHeap;
 
     // Fields related to the runtime (volatile or warm) part of the hash.
-    RelativePointer<DPTR(PTR_VolatileEntry)> m_pWarmBuckets;  // Pointer to a simple bucket list (array of VolatileEntry pointers)
+    DPTR(PTR_VolatileEntry)                  m_pWarmBuckets;  // Pointer to a simple bucket list (array of VolatileEntry pointers)
     DWORD                                    m_cWarmBuckets;  // Count of buckets in the above array (always non-zero)
     DWORD                                    m_cWarmEntries;  // Count of elements in the warm section of the hash
 };
@@ -343,7 +343,7 @@ public:
 #endif // !DACCESS_COMPILE
 
 private:
-    RelativePointer<DPTR(VALUE)> m_rpEntryRef;  // Entry ref encoded as a delta from this field's location.
+    DPTR(VALUE) m_rpEntryRef;  // Entry ref encoded as a delta from this field's location.
 };
 
 #endif // __NGEN_HASH_INCLUDED
index 952f59d..aad734c 100644 (file)
@@ -47,14 +47,14 @@ NgenHashTable<NGEN_HASH_ARGS>::NgenHashTable(Module *pModule, LoaderHeap *pHeap,
     // At least one of module or heap must have been specified or we won't know how to allocate entries and
     // buckets.
     _ASSERTE(pModule || pHeap);
-    m_pModule.SetValueMaybeNull(pModule);
+    m_pModule = pModule;
     m_pHeap = pHeap;
 
     S_SIZE_T cbBuckets = S_SIZE_T(sizeof(VolatileEntry*)) * S_SIZE_T(cInitialBuckets);
 
     m_cWarmEntries = 0;
     m_cWarmBuckets = cInitialBuckets;
-    m_pWarmBuckets.SetValue((PTR_VolatileEntry*)(void*)GetHeap()->AllocMem(cbBuckets));
+    m_pWarmBuckets = (PTR_VolatileEntry*)(void*)GetHeap()->AllocMem(cbBuckets);
 
     // Note: Memory allocated on loader heap is zero filled
     // memset(m_pWarmBuckets, 0, sizeof(VolatileEntry*) * cInitialBuckets);
@@ -108,7 +108,7 @@ LoaderHeap *NgenHashTable<NGEN_HASH_ARGS>::GetHeap()
 
     // If not specified then we fall back to the owning module's heap (a module must have been specified in
     // this case).
-    _ASSERTE(!m_pModule.IsNull());
+    _ASSERTE(m_pModule != NULL);
     return GetModule()->GetAssembly()->GetLowFrequencyHeap();
 }
 
@@ -218,7 +218,7 @@ void NgenHashTable<NGEN_HASH_ARGS>::GrowTable()
 
     // Make sure that all writes are visible before publishing the new array.
     MemoryBarrier();
-    m_pWarmBuckets.SetValue(pNewBuckets);
+    m_pWarmBuckets = pNewBuckets;
 
     // The new number of buckets has to be published last (prior to this readers may miscalculate a bucket
     // index, but the result will always be in range and they'll simply walk the wrong chain and get a miss,
@@ -503,21 +503,7 @@ DPTR(VALUE) NgenHashEntryRef<NGEN_HASH_ARGS>::Get()
     }
     CONTRACTL_END;
 
-    // Short-cut the NULL case, it's a lot cheaper than the code below when compiling for DAC.
-    if (m_rpEntryRef.IsNull())
-        return NULL;
-
-    // Note that the following code uses a special DAC lookup for an interior pointer (i.e. "this" isn't a
-    // host address corresponding to a DAC marshalled instance, it's some host address within such an
-    // instance). These lookups are a little slower than the regular kind since we have to search for the
-    // containing instance.
-
-    // @todo: The following causes gcc to choke on Mac 10.4 at least (complains that offsetof is being passed
-    // four arguments instead of two). Expanding the top-level macro manually fixes this.
-    // TADDR pBase = PTR_HOST_INT_MEMBER_TADDR(NgenHashEntryRef<NGEN_HASH_ARGS>, this, m_rpEntryRef);
-    TADDR pBase = PTR_HOST_INT_TO_TADDR(this) + (TADDR)offsetof(NgenHashEntryRef<NGEN_HASH_ARGS>, m_rpEntryRef);
-
-    return m_rpEntryRef.GetValue(pBase);
+    return m_rpEntryRef;
 }
 
 #ifndef DACCESS_COMPILE
@@ -534,7 +520,7 @@ void NgenHashEntryRef<NGEN_HASH_ARGS>::Set(VALUE *pEntry)
     }
     CONTRACTL_END;
 
-    m_rpEntryRef.SetValueMaybeNull(pEntry);
+    m_rpEntryRef = pEntry;
 }
 
 #endif // !DACCESS_COMPILE
index ed7e55a..4a4d617 100644 (file)
@@ -166,7 +166,7 @@ PCODE MethodDesc::DoBackpatch(MethodTable * pMT, MethodTable *pDispatchingMT, BO
         RecordAndBackpatchEntryPointSlot_Locked(
             mdLoaderAllocator,
             patchedMT->GetLoaderAllocator(),
-            patchedMT->GetSlotPtr(slotIndex),
+            dac_cast<TADDR>(patchedMT->GetSlotPtr(slotIndex)),
             EntryPointSlots::SlotType_Vtable,
             pTarget);
     };
@@ -2630,7 +2630,7 @@ EXTERN_C PCODE STDCALL ExternalMethodFixupWorker(TransitionBlock * pTransitionBl
             }
 
             DispatchToken token;
-            if (pMT->IsInterface() || MethodTable::VTableIndir_t::isRelative)
+            if (pMT->IsInterface())
             {
                 if (pMT->IsInterface())
                     token = pMT->GetLoaderAllocator()->GetDispatchToken(pMT->GetTypeID(), slot);
@@ -2951,11 +2951,6 @@ void ProcessDynamicDictionaryLookup(TransitionBlock *           pTransitionBlock
             pResult->indirections = 2;
             pResult->offsets[0] = offsetof(InstantiatedMethodDesc, m_pPerInstInfo);
 
-            if (decltype(InstantiatedMethodDesc::m_pPerInstInfo)::isRelative)
-            {
-                pResult->indirectFirstOffset = 1;
-            }
-
             uint32_t data;
             IfFailThrow(sigptr.GetData(&data));
             pResult->offsets[1] = sizeof(TypeHandle) * data;
@@ -2972,12 +2967,6 @@ void ProcessDynamicDictionaryLookup(TransitionBlock *           pTransitionBlock
             IfFailThrow(sigptr.GetData(&data));
             pResult->offsets[2] = sizeof(TypeHandle) * data;
 
-            if (MethodTable::IsPerInstInfoRelative())
-            {
-                pResult->indirectFirstOffset = 1;
-                pResult->indirectSecondOffset = 1;
-            }
-
             return;
         }
     }
@@ -3007,11 +2996,6 @@ void ProcessDynamicDictionaryLookup(TransitionBlock *           pTransitionBlock
             // Indirect through dictionary table pointer in InstantiatedMethodDesc
             pResult->offsets[0] = offsetof(InstantiatedMethodDesc, m_pPerInstInfo);
 
-            if (decltype(InstantiatedMethodDesc::m_pPerInstInfo)::isRelative)
-            {
-                pResult->indirectFirstOffset = 1;
-            }
-
             *pDictionaryIndexAndSlot |= dictionarySlot;
         }
     }
@@ -3035,12 +3019,6 @@ void ProcessDynamicDictionaryLookup(TransitionBlock *           pTransitionBlock
             // Next indirect through the dictionary appropriate to this instantiated type
             pResult->offsets[1] = sizeof(TypeHandle*) * (pContextMT->GetNumDicts() - 1);
 
-            if (MethodTable::IsPerInstInfoRelative())
-            {
-                pResult->indirectFirstOffset = 1;
-                pResult->indirectSecondOffset = 1;
-            }
-
             *pDictionaryIndexAndSlot |= dictionarySlot;
         }
     }
index 40b3ce5..399f51e 100644 (file)
@@ -7701,16 +7701,6 @@ HRESULT ProfToEEInterfaceImpl::GetClassLayout(ClassID classID,
         return CORPROF_E_DATAINCOMPLETE;
     }
 
-    // Types can be pre-restored, but they still aren't expected to handle queries before
-    // eager fixups have run. This is a targetted band-aid for a bug intellitrace was
-    // running into - attempting to get the class layout for all types at module load time.
-    // If we don't detect this the runtime will AV during the field iteration below. Feel
-    // free to eliminate this check when a more complete solution is available.
-    if (MethodTable::IsParentMethodTableTagged(typeHandle.AsMethodTable()))
-    {
-        return CORPROF_E_DATAINCOMPLETE;
-    }
-
     // !IsValueType = IsArray || IsReferenceType   Since IsArry has been ruled out above, it must
     // be a reference type if !IsValueType.
     BOOL fReferenceType = !typeHandle.IsValueType();
index a5037ba..ef84341 100644 (file)
@@ -793,7 +793,7 @@ void QCALLTYPE RuntimeTypeHandle::ConstructName(QCall::TypeHandle pTypeHandle, D
     END_QCALL;
 }
 
-PTRARRAYREF CopyRuntimeTypeHandles(TypeHandle * prgTH, FixupPointer<TypeHandle> * prgTH2, INT32 numTypeHandles, BinderClassID arrayElemType)
+PTRARRAYREF CopyRuntimeTypeHandles(TypeHandle * prgTH, INT32 numTypeHandles, BinderClassID arrayElemType)
 {
     CONTRACTL {
         THROWS;
@@ -808,11 +808,7 @@ PTRARRAYREF CopyRuntimeTypeHandles(TypeHandle * prgTH, FixupPointer<TypeHandle>
     if (numTypeHandles == 0)
         return NULL;
 
-    _ASSERTE((prgTH != NULL) || (prgTH2 != NULL));
-    if (prgTH != NULL)
-    {
-        _ASSERTE(prgTH2 == NULL);
-    }
+    _ASSERTE(prgTH != NULL);
 
     GCPROTECT_BEGIN(refArray);
     TypeHandle thRuntimeType = TypeHandle(CoreLibBinder::GetClass(arrayElemType));
@@ -823,10 +819,7 @@ PTRARRAYREF CopyRuntimeTypeHandles(TypeHandle * prgTH, FixupPointer<TypeHandle>
     {
         TypeHandle th;
 
-        if (prgTH != NULL)
-            th = prgTH[i];
-        else
-            th = prgTH2[i].GetValue();
+        th = prgTH[i];
 
         OBJECTREF refType = th.GetManagedClassObject();
         refArray->SetAt(i, refType);
@@ -857,7 +850,7 @@ void QCALLTYPE RuntimeTypeHandle::GetConstraints(QCall::TypeHandle pTypeHandle,
     constraints = pGenericVariable->GetConstraints(&dwCount);
 
     GCX_COOP();
-    retTypeArray.Set(CopyRuntimeTypeHandles(constraints, NULL, dwCount, CLASS__TYPE));
+    retTypeArray.Set(CopyRuntimeTypeHandles(constraints, dwCount, CLASS__TYPE));
 
     END_QCALL;
 
@@ -1525,7 +1518,7 @@ void QCALLTYPE RuntimeTypeHandle::GetInstantiation(QCall::TypeHandle pType, QCal
     TypeHandle typeHandle = pType.AsTypeHandle();
     Instantiation inst = typeHandle.GetInstantiation();
     GCX_COOP();
-    retTypes.Set(CopyRuntimeTypeHandles(NULL, inst.GetRawArgs(), inst.GetNumArgs(), fAsRuntimeTypeArray ? CLASS__CLASS : CLASS__TYPE));
+    retTypes.Set(CopyRuntimeTypeHandles(inst.GetRawArgs(), inst.GetNumArgs(), fAsRuntimeTypeArray ? CLASS__CLASS : CLASS__TYPE));
     END_QCALL;
 
     return;
@@ -2203,7 +2196,7 @@ void QCALLTYPE RuntimeMethodHandle::GetMethodInstantiation(MethodDesc * pMethod,
     Instantiation inst = pMethod->LoadMethodInstantiation();
 
     GCX_COOP();
-    retTypes.Set(CopyRuntimeTypeHandles(NULL, inst.GetRawArgs(), inst.GetNumArgs(), fAsRuntimeTypeArray ? CLASS__CLASS : CLASS__TYPE));
+    retTypes.Set(CopyRuntimeTypeHandles(inst.GetRawArgs(), inst.GetNumArgs(), fAsRuntimeTypeArray ? CLASS__CLASS : CLASS__TYPE));
     END_QCALL;
 
     return;
index c90db98..67818c5 100644 (file)
@@ -34,7 +34,7 @@ BOOL ParamTypeDesc::Verify() {
     STATIC_CONTRACT_DEBUG_ONLY;
     STATIC_CONTRACT_SUPPORTS_DAC;
 
-    _ASSERTE(m_TemplateMT.IsNull() || GetTemplateMethodTableInternal()->SanityCheck());
+    _ASSERTE((m_TemplateMT == NULL) || GetTemplateMethodTableInternal()->SanityCheck());
     _ASSERTE(!GetTypeParam().IsNull());
     _ASSERTE(CorTypeInfo::IsModifier_NoThrow(GetInternalCorElementType()) ||
                               GetInternalCorElementType() == ELEMENT_TYPE_VALUETYPE);
@@ -703,7 +703,7 @@ void TypeDesc::DoFullyLoad(Generics::RecursionGraph *pVisited, ClassLoadLevel le
         ParamTypeDesc* pPTD = (ParamTypeDesc*) this;
 
         // Fully load the template method table
-        if (!pPTD->m_TemplateMT.IsNull())
+        if (pPTD->m_TemplateMT != NULL)
         {
             pPTD->GetTemplateMethodTableInternal()->DoFullyLoad(&newVisited, level, pPending, &fBailed, pInstContext);
         }
index d40d5b4..977953f 100644 (file)
@@ -231,7 +231,7 @@ public:
 
         LIMITED_METHOD_CONTRACT;
 
-        m_TemplateMT.SetValueMaybeNull(pMT);
+        m_TemplateMT = pMT;
 
         // ParamTypeDescs start out life not fully loaded
         m_typeAndFlags |= TypeDesc::enum_flag_IsNotFullyLoaded;
@@ -296,11 +296,11 @@ public:
 protected:
     PTR_MethodTable GetTemplateMethodTableInternal() {
         WRAPPER_NO_CONTRACT;
-        return ReadPointerMaybeNull(this, &ParamTypeDesc::m_TemplateMT);
+        return m_TemplateMT;
     }
 
     // the m_typeAndFlags field in TypeDesc tell what kind of parameterized type we have
-    RelativeFixupPointer<PTR_MethodTable> m_TemplateMT; // The shared method table, some variants do not use this field (it is null)
+    PTR_MethodTable m_TemplateMT; // The shared method table, some variants do not use this field (it is null)
     TypeHandle      m_Arg;              // The type that is being modified
     LOADERHANDLE    m_hExposedClassObject;  // handle back to the internal reflection Type object
 };
@@ -334,7 +334,7 @@ public:
         }
         CONTRACTL_END;
 
-        m_pModule.SetValue(pModule);
+        m_pModule = pModule;
         m_typeOrMethodDef = typeOrMethodDef;
         m_token = token;
         m_index = index;
@@ -352,7 +352,7 @@ public:
         LIMITED_METHOD_CONTRACT;
         SUPPORTS_DAC;
 
-        return ReadPointer(this, &TypeVarTypeDesc::m_pModule);
+        return m_pModule;
     }
 
     unsigned int GetIndex()
@@ -435,7 +435,7 @@ protected:
     BOOL ConstrainedAsObjRefHelper();
 
     // Module containing the generic definition, also the loader module for this type desc
-    RelativePointer<PTR_Module> m_pModule;
+    PTR_Module m_pModule;
 
     // Declaring type or method
     mdToken m_typeOrMethodDef;
index 9914987..aa9a80a 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "check.h"
 #include "classloadlevel.h"
-#include "fixuppointer.h"
 
 class TypeDesc;
 class TypeHandle;
@@ -639,29 +638,6 @@ inline CHECK CheckPointer(TypeHandle th, IsNullOK ok = NULL_NOT_OK)
 #endif  // CHECK_INVARIANTS
 
 /*************************************************************************/
-// dac_casts for TypeHandle makes FixupPointer<TypeHandle> work.
-//
-// TypeHandle is wrapper around pointer to MethodTable or TypeDesc. Even though
-// it may feel counterintuitive, it is possible to treat it like a pointer and
-// use the regular FixupPointer to implement TypeHandle indirection cells.
-// The lowest bit of TypeHandle (when wrapped inside FixupPointer) is
-// used to mark optional indirection.
-//
-template<>
-inline TADDR dac_cast(TypeHandle src)
-{
-    SUPPORTS_DAC;
-    return src.AsTAddr();
-}
-
-template<>
-inline TypeHandle dac_cast(TADDR src)
-{
-    SUPPORTS_DAC;
-    return TypeHandle::FromTAddr(src);
-}
-
-/*************************************************************************/
 // Instantiation is representation of generic instantiation.
 // It is simple read-only array of TypeHandles. In NGen, the type handles
 // may be encoded using indirections. That's one reason why it is convenient
@@ -671,7 +647,7 @@ class Instantiation
 public:
     // Construct empty instantiation
     Instantiation()
-        : m_pArgs(NULL), m_nArgs(0)
+        : m_pArgs((TypeHandle*)NULL), m_nArgs(0)
     {
         LIMITED_METHOD_DAC_CONTRACT;
     }
@@ -684,35 +660,26 @@ public:
         _ASSERTE(m_nArgs == 0 || m_pArgs != NULL);
     }
 
-    // Construct instantiation from array of FixupPointers
-    Instantiation(FixupPointer<TypeHandle> * pArgs, DWORD nArgs)
-        : m_pArgs(pArgs), m_nArgs(nArgs)
-    {
-        LIMITED_METHOD_DAC_CONTRACT;
-        _ASSERTE(m_nArgs == 0 || m_pArgs != NULL);
-    }
-
     // Construct instantiation from array of TypeHandles
-    Instantiation(TypeHandle * pArgs, DWORD nArgs)
+    Instantiation(TypeHandle *pArgs, DWORD nArgs)
         : m_nArgs(nArgs)
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
         DACCOP_IGNORE(CastOfMarshalledType, "Dual mode DAC problem, but since the size is the same, the cast is safe");
-        m_pArgs = (FixupPointer<TypeHandle> *)pArgs;
+        m_pArgs = pArgs;
         _ASSERTE(m_nArgs == 0 || m_pArgs != NULL);
     }
 
 #ifdef DACCESS_COMPILE
-    // Construct instantiation from target array of FixupPointers in DAC.
     // This method will create local copy of the instantiation arguments.
-    Instantiation(DPTR(FixupPointer<TypeHandle>) pArgs, DWORD nArgs)
+    Instantiation(PTR_TypeHandle pArgs, DWORD nArgs)
     {
         LIMITED_METHOD_DAC_CONTRACT;
 
         // Create a local copy of the instanitation under DAC
         PVOID pLocalArgs = PTR_READ(dac_cast<TADDR>(pArgs), nArgs * sizeof(TypeHandle));
-        m_pArgs = (FixupPointer<TypeHandle> *)pLocalArgs;
+        m_pArgs = (TypeHandle*)pLocalArgs;
 
         m_nArgs = nArgs;
 
@@ -725,7 +692,7 @@ public:
     {
         LIMITED_METHOD_DAC_CONTRACT;
         _ASSERTE(iArg < m_nArgs);
-        return m_pArgs[iArg].GetValue();
+        return m_pArgs[iArg];
     }
 
     DWORD GetNumArgs() const
@@ -741,7 +708,7 @@ public:
     }
 
     // Unsafe access to the instantiation. Do not use unless absolutely necessary!!!
-    FixupPointer<TypeHandle> * GetRawArgs() const
+    TypeHandle * GetRawArgs() const
     {
         LIMITED_METHOD_DAC_CONTRACT;
         return m_pArgs;
@@ -759,7 +726,7 @@ public:
 
 private:
     // Note that for DAC builds, m_pArgs may be host allocated buffer, not a copy of an object marshalled by DAC.
-    FixupPointer<TypeHandle> * m_pArgs;
+    TypeHandle* m_pArgs;
     DWORD m_nArgs;
 };
 
index a8f8a01..09a6e0e 100644 (file)
@@ -62,7 +62,7 @@ LoaderAllocator *EETypeHashTable::GetLoaderAllocator()
     }
     else
     {
-        _ASSERTE(!m_pModule.IsNull());
+        _ASSERTE(m_pModule != NULL);
         return GetModule()->GetLoaderAllocator();
     }
 }
@@ -544,7 +544,7 @@ VOID EETypeHashTable::InsertValue(TypeHandle data)
         PRECONDITION(!data.IsEncodedFixup());
         PRECONDITION(!data.IsGenericTypeDefinition()); // Generic type defs live in typedef table (availableClasses)
         PRECONDITION(data.HasInstantiation() || data.HasTypeParam() || data.IsFnPtrType()); // It's an instantiated type or an array/ptr/byref type
-        PRECONDITION(m_pModule.IsNull() || GetModule()->IsTenured()); // Destruct won't destruct m_pAvailableParamTypes for non-tenured modules - so make sure no one tries to insert one before the Module has been tenured
+        PRECONDITION(m_pModule == NULL || GetModule()->IsTenured()); // Destruct won't destruct m_pAvailableParamTypes for non-tenured modules - so make sure no one tries to insert one before the Module has been tenured
     }
     CONTRACTL_END
 
@@ -592,7 +592,7 @@ void EETypeHashEntry::SetTypeHandle(TypeHandle handle)
 
     // We plan to steal the low-order bit of the handle for ngen purposes.
     _ASSERTE((handle.AsTAddr() & 0x1) == 0);
-    m_data.SetValueMaybeNull(handle.AsPtr());
+    m_data = handle.AsPtr();
 }
 #endif // !DACCESS_COMPILE
 
index 0dffc7e..eb89d0a 100644 (file)
@@ -37,7 +37,7 @@ typedef struct EETypeHashEntry
 #ifndef DACCESS_COMPILE
     EETypeHashEntry& operator=(const EETypeHashEntry& src)
     {
-        m_data.SetValueMaybeNull(src.m_data.GetValueMaybeNull());
+        m_data = src.m_data;
 
         return *this;
     }
@@ -45,7 +45,7 @@ typedef struct EETypeHashEntry
 
     PTR_VOID GetData()
     {
-        return ReadPointerMaybeNull(this, &EETypeHashEntry::m_data);
+        return m_data;
     }
 
 private:
@@ -54,7 +54,7 @@ private:
     friend class NativeImageDumper;
 #endif
 
-    RelativePointer<PTR_VOID> m_data;
+    PTR_VOID m_data;
 } EETypeHashEntry_t;
 
 
index 71d6feb..45b1867 100644 (file)
@@ -37,7 +37,7 @@ class TypeKey
             Module *       m_pModule;
             mdToken        m_typeDef;
             DWORD          m_numGenericArgs; // 0 for non-generic types
-            FixupPointer<TypeHandle> * m_pGenericArgs;   // NULL for non-generic types
+            TypeHandle *   m_pGenericArgs;   // NULL for non-generic types
             // Note that for DAC builds, m_pGenericArgs is a host allocated buffer (eg. by in SigPointer::GetTypeHandleThrowing),
             // not a copy of an object marshalled by DAC.
         } asClass;
@@ -231,7 +231,7 @@ public:
             }
             for (DWORD i = 0; i < pKey1->u.asClass.m_numGenericArgs; i++)
             {
-                if (pKey1->u.asClass.m_pGenericArgs[i].GetValue() != pKey2->u.asClass.m_pGenericArgs[i].GetValue())
+                if (pKey1->u.asClass.m_pGenericArgs[i] != pKey2->u.asClass.m_pGenericArgs[i])
                     return FALSE;
             }
             return TRUE;
index fe30354..05df034 100644 (file)
@@ -1144,7 +1144,6 @@ PCODE VirtualCallStubManager::GetVTableCallStub(DWORD slot)
         GC_TRIGGERS;
         MODE_ANY;
         INJECT_FAULT(COMPlusThrowOM(););
-        PRECONDITION(!MethodTable::VTableIndir_t::isRelative /* Not yet supported */);
         POSTCONDITION(RETVAL != NULL);
     } CONTRACT_END;
 
@@ -1174,7 +1173,6 @@ VTableCallHolder* VirtualCallStubManager::GenerateVTableCallStub(DWORD slot)
         GC_TRIGGERS;
         MODE_ANY;
         INJECT_FAULT(COMPlusThrowOM(););
-        PRECONDITION(!MethodTable::VTableIndir_t::isRelative /* Not yet supported */);
         POSTCONDITION(RETVAL != NULL);
     } CONTRACT_END;