Remove some dead remoting and context static things (#20277)
authorAustin Wise <AustinWise@gmail.com>
Mon, 8 Oct 2018 01:58:10 +0000 (18:58 -0700)
committerJan Kotas <jkotas@microsoft.com>
Mon, 8 Oct 2018 01:58:10 +0000 (18:58 -0700)
* Remove IsRemotingIntercepted methods that always return false.

* Remove GetOptionalMembersAllocationSize parameters that are always false.

* Remove references to context static.

Remove references in comments and methodnames.

* Remove RemotingVtsInfo.

24 files changed:
src/debug/daccess/dacdbiimpl.cpp
src/debug/daccess/dacdbiimpl.h
src/debug/daccess/nidump.cpp
src/debug/daccess/nidump.h
src/debug/di/rsclass.cpp
src/debug/inc/dacdbiinterface.h
src/vm/appdomain.hpp
src/vm/array.cpp
src/vm/ceeload.cpp
src/vm/compile.cpp
src/vm/eventtrace.cpp
src/vm/fptrstubs.cpp
src/vm/generics.cpp
src/vm/jitinterface.cpp
src/vm/method.cpp
src/vm/method.hpp
src/vm/method.inl
src/vm/methodtable.h
src/vm/methodtable.inl
src/vm/methodtablebuilder.cpp
src/vm/methodtablebuilder.h
src/vm/object.h
src/vm/prestub.cpp
src/vm/proftoeeinterfaceimpl.cpp

index 2ce8c72..b00917c 100644 (file)
@@ -3217,21 +3217,16 @@ TypeHandle DacDbiInterfaceImpl::ExpandedTypeInfoToTypeHandle(DebuggerIPCE_Expand
 } // DacDbiInterfaceImpl::ExpandedTypeInfoToTypeHandle
 
 // ----------------------------------------------------------------------------
-// DacDbi API: GetThreadOrContextStaticAddress
-// Get the target field address of a context or thread local static. 
+// DacDbi API: GetThreadStaticAddress
+// Get the target field address of a thread local static.
 // 
 // Notes: 
-// The address is  constant and could be cached.
-// 
-// If this is a context-static, the function uses the thread's current context.  
-// [This is important because it means that you can't lookup a context static 
-// unless you have a thread in that context. If anybody actually cared about contexts, 
-// we might have to revise this in the future] 
+// The address is constant and could be cached.
 // 
 // This can commonly fail, in which case, it will return NULL.
 // ----------------------------------------------------------------------------
-CORDB_ADDRESS DacDbiInterfaceImpl::GetThreadOrContextStaticAddress(VMPTR_FieldDesc vmField,
-                                                                    VMPTR_Thread    vmRuntimeThread)
+CORDB_ADDRESS DacDbiInterfaceImpl::GetThreadStaticAddress(VMPTR_FieldDesc vmField,
+                                                          VMPTR_Thread    vmRuntimeThread)
 {
     DD_ENTER_MAY_THROW;
 
@@ -3241,8 +3236,7 @@ CORDB_ADDRESS DacDbiInterfaceImpl::GetThreadOrContextStaticAddress(VMPTR_FieldDe
 
     _ASSERTE(pRuntimeThread != NULL);
 
-    // Find out whether the field is thread local or context local and get its
-    // address. 
+    // Find out whether the field is thread local and get its address.
     if (pFieldDesc->IsThreadStatic())
     {
         fieldAddress = pRuntimeThread->GetStaticFieldAddrNoCreate(pFieldDesc, NULL);
@@ -3255,7 +3249,7 @@ CORDB_ADDRESS DacDbiInterfaceImpl::GetThreadOrContextStaticAddress(VMPTR_FieldDe
     }
     return fieldAddress;
 
-} // DacDbiInterfaceImpl::GetThreadOrContextStaticAddress
+} // DacDbiInterfaceImpl::GetThreadStaticAddress
 
     // Get the target field address of a collectible types static. 
 CORDB_ADDRESS DacDbiInterfaceImpl::GetCollectibleTypeStaticAddress(VMPTR_FieldDesc vmField,
index b13c75a..6655800 100644 (file)
@@ -304,8 +304,8 @@ public:
                              TypeParamsList *    pGenericTypeParams);
 
     // Get the target field address of a context or thread local static. 
-    CORDB_ADDRESS GetThreadOrContextStaticAddress(VMPTR_FieldDesc vmField,
-                                                  VMPTR_Thread    vmRuntimeThread);
+    CORDB_ADDRESS GetThreadStaticAddress(VMPTR_FieldDesc vmField,
+                                         VMPTR_Thread    vmRuntimeThread);
 
     // Get the target field address of a collectible types static. 
     CORDB_ADDRESS GetCollectibleTypeStaticAddress(VMPTR_FieldDesc vmField,
index ca9a600..97438af 100644 (file)
@@ -5523,7 +5523,6 @@ NativeImageDumper::EnumMnemonics s_MTFlagsLow[] =
     MTFLAG_ENTRY(GenericsMask_GenericInst),
     MTFLAG_ENTRY(GenericsMask_SharedInst),
     MTFLAG_ENTRY(GenericsMask_TypicalInst),
-    MTFLAG_ENTRY(HasRemotingVtsInfo),
     MTFLAG_ENTRY(HasVariance),
     MTFLAG_ENTRY(HasDefaultCtor),
     MTFLAG_ENTRY(HasPreciseInitCctors),
index ac1c093..db6d8e4 100644 (file)
@@ -29,7 +29,6 @@ typedef DPTR(ArrayClass) PTR_ArrayClass;
 typedef DPTR(DelegateEEClass) PTR_DelegateEEClass;
 typedef DPTR(UMThunkMarshInfo) PTR_UMThunkMarshInfo;
 typedef DPTR(CORCOMPILE_DEPENDENCY) PTR_CORCOMPILE_DEPENDENCY;
-typedef DPTR(struct RemotableMethodInfo) PTR_RemotableMethodInfo;
 typedef DPTR(struct ModuleCtorInfo) PTR_ModuleCtorInfo;
 typedef DPTR(class EEImplMethodDesc) PTR_EEImplMethodDesc;
 typedef DPTR(class EEClassLayoutInfo) PTR_EEClassLayoutInfo;
index 99fac5e..987f001 100644 (file)
@@ -261,13 +261,13 @@ HRESULT CordbClass::GetStaticFieldValue2(CordbModule * pModule,
     }
     else
     {
-        // We've got a thread or context local static
+        // We've got a thread local static
 
         if( fEnCHangingField )
         {
             // fEnCHangingField is set for fields added with EnC which hang off the FieldDesc.
-            // Thread-local and context-local statics cannot be added with EnC, so we shouldn't be here
-            // if this is an EnC field is thread- or context-local.
+            // Thread-local statics cannot be added with EnC, so we shouldn't be here
+            // if this is an EnC field is thread-local.
             _ASSERTE(!pFieldData->m_fFldIsTLS );
         }
         else
@@ -285,8 +285,8 @@ HRESULT CordbClass::GetStaticFieldValue2(CordbModule * pModule,
 
             EX_TRY
             {
-                pRmtStaticValue = pProcess->GetDAC()->GetThreadOrContextStaticAddress(pFieldData->m_vmFieldDesc, 
-                                                                                      pThread->m_vmThreadToken);
+                pRmtStaticValue = pProcess->GetDAC()->GetThreadStaticAddress(pFieldData->m_vmFieldDesc,
+                                                                             pThread->m_vmThreadToken);
             }
             EX_CATCH_HRESULT(hr);
             if(FAILED(hr)) 
index 5e765c9..7295884 100644 (file)
@@ -1923,7 +1923,7 @@ public:
                              OUT UINT32 *            pcGenericClassTypeParams,
                              OUT TypeParamsList *    pGenericTypeParams) = 0;
 
-    // Get the target field address of a context or thread local static. 
+    // Get the target field address of a thread local static.
     // Arguments: 
     //     input: vmField         - pointer to the field descriptor for the static field
     //            vmRuntimeThread - thread to which the static field belongs. This must 
@@ -1937,8 +1937,8 @@ public:
     //  Field storage is constant once allocated, so this value can be cached. 
 
     virtual
-    CORDB_ADDRESS GetThreadOrContextStaticAddress(VMPTR_FieldDesc vmField,
-                                                   VMPTR_Thread    vmRuntimeThread) = 0;
+    CORDB_ADDRESS GetThreadStaticAddress(VMPTR_FieldDesc vmField,
+                                         VMPTR_Thread    vmRuntimeThread) = 0;
 
     // Get the target field address of a collectible types static. 
     // Arguments: 
index 6ba9ff4..643a996 100644 (file)
@@ -1431,7 +1431,7 @@ protected:
     PTR_CLRPrivBinderWinRT m_pWinRtBinder;
 #endif // FEATURE_COMINTEROP
 
-    // Protects allocation of slot IDs for thread and context statics
+    // Protects allocation of slot IDs for thread statics
     static CrstStatic   m_SpecialStaticsCrst;
 
 public:
@@ -1439,8 +1439,6 @@ public:
     // loads in progress.
     void ClearFusionContext();
 
-public:
-
     //****************************************************************************************
     // Synchronization holders.
 
index e41573c..1a4a940 100644 (file)
@@ -342,12 +342,10 @@ MethodTable* Module::CreateArrayMethodTable(TypeHandle elemTypeHnd, CorElementTy
     // Allocate space for optional members
     // We always have a non-virtual slot array, see assert at end
     cbMT += MethodTable::GetOptionalMembersAllocationSize(dwMultipurposeSlotsMask,
-                                                          FALSE,                           // RemotableMethodInfo
                                                           FALSE,                           // GenericsStaticsInfo
                                                           FALSE,                           // GuidInfo
                                                           FALSE,                           // CCWTemplate
                                                           FALSE,                           // RCWPerTypeData
-                                                          FALSE,                           // RemotingVtsInfo
                                                           FALSE);                          // TokenOverflow
 
     // This is the offset of the beginning of the interface map
index 01ecaca..7e943ed 100644 (file)
@@ -2067,7 +2067,7 @@ void Module::BuildStaticsOffsets(AllocMemTracker *pamTracker)
                     continue;
 
                 // We account for "regular statics" and "thread statics" separately. 
-                // Currently we are lumping RVA and context statics into "regular statics",
+                // Currently we are lumping RVA into "regular statics",
                 // but we probably shouldn't.
                 switch (ElementType)
                 {
index e68b1ed..1c461b9 100644 (file)
@@ -1314,27 +1314,6 @@ BOOL CEEPreloader::CanEmbedFunctionEntryPoint(
     STANDARD_VM_CONTRACT;
 
     MethodDesc * pMethod = GetMethod(methodHandle);
-    MethodDesc * pContext = GetMethod(contextHandle);
-
-    // IsRemotingInterceptedViaVirtualDispatch is a rather special case.
-    //
-    // Other remoting intercepts are implemented by one of:
-    //  (1) in DoPrestub (for non-virtual calls)
-    //  (2) by transparent proxy vtables, where all the entries in the vtable
-    //      go to the same code.
-    //
-    // However when calling virtual functions non-virtually the JIT interface
-    // pointer to the code for the function in a stub 
-    // (see GetNonVirtualEntryPointForVirtualMethod).  
-    // Thus we cannot embed non-virtual calls to these functions because we 
-    // don't save these stubs.  Unlike most other remoting stubs these ones 
-    // are NOT inserted by DoPrestub.
-    //
-    if (((accessFlags & CORINFO_ACCESS_THIS) == 0) &&
-        (pMethod->IsRemotingInterceptedViaVirtualDispatch()))
-    {
-        return FALSE;
-    }
 
     // Methods with native callable attribute are special , since 
     // they are used as LDFTN targets.Native Callable methods
index 6179b6c..45de0a3 100644 (file)
@@ -1552,7 +1552,7 @@ void BulkStaticsLogger::LogAllStatics()
                     ApproxFieldDescIterator fieldIter(mt, ApproxFieldDescIterator::STATIC_FIELDS);
                     for (FieldDesc *field = fieldIter.Next(); field != NULL; field = fieldIter.Next())
                     {
-                        // Don't want thread local or context local
+                        // Don't want thread local
                         _ASSERTE(field->IsStatic());
                         if (field->IsSpecialStatic() || field->IsEnCNew())
                             continue;
index 6502a43..b100f1a 100644 (file)
@@ -52,13 +52,6 @@ PrecodeType FuncPtrStubs::GetDefaultType(MethodDesc* pMD)
     type = PRECODE_FIXUP;
 #endif // HAS_FIXUP_PRECODE
 
-#ifdef HAS_REMOTING_PRECODE
-    if (pMD->IsRemotingInterceptedViaVirtualDispatch())
-    {
-        type = PRECODE_REMOTING;
-    }
-#endif // HAS_REMOTING_PRECODE
-
     return type;
 }
 
index 26cd8a5..5e972d7 100644 (file)
@@ -224,7 +224,6 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
 
     // These are all copied across from the old MT, i.e. don't depend on the
     // instantiation.
-    BOOL fHasRemotingVtsInfo = FALSE;
     BOOL fHasGenericsStaticsInfo = pOldMT->HasGenericsStaticsInfo();
 
 #ifdef FEATURE_COMINTEROP
@@ -278,12 +277,10 @@ ClassLoader::CreateTypeHandleForNonCanonicalGenericInstantiation(
 
     // We need space for the optional members.
     DWORD cbOptional = MethodTable::GetOptionalMembersAllocationSize(dwMultipurposeSlotsMask,
-                                                      FALSE, // fHasRemotableMethodInfo
                                                       fHasGenericsStaticsInfo,
                                                       fHasGuidInfo,
                                                       fHasCCWTemplate,
                                                       fHasRCWPerTypeData,
-                                                      fHasRemotingVtsInfo,
                                                       pOldMT->HasTokenOverflow());
 
     // We need space for the PerInstInfo, i.e. the generic dictionary pointers...
index 5067a36..7532f5e 100644 (file)
@@ -5373,23 +5373,14 @@ void CEEInfo::getCallInfo(
 
         if (devirt)
         {
-            // We can't allow generic remotable methods to be considered resolved, it leads to a non-instantiating method desc being
-            // passed to the remoting stub. The easiest way to deal with these is to force them through the virtual code path.
-            // It is actually good to do this deoptimization for all remotable methods since remoting interception via vtable dispatch 
-            // is faster then remoting interception via thunk
-            if (!pTargetMD->IsRemotingInterceptedViaVirtualDispatch() /* || !pTargetMD->HasMethodInstantiation() */)
-            {
-                resolvedCallVirt = true;
-                directCall = true;
-            }
+            resolvedCallVirt = true;
+            directCall = true;
         }
     }
 
     if (directCall)
     {
-        bool allowInstParam = (flags & CORINFO_CALLINFO_ALLOWINSTPARAM)
-            // See code:IsRemotingInterceptedViaPrestub on why we need need to disallow inst param for remoting.
-            && !( pTargetMD->MayBeRemotingIntercepted() && !pTargetMD->IsVtableMethod() );
+        bool allowInstParam = (flags & CORINFO_CALLINFO_ALLOWINSTPARAM);
 
         // Create instantiating stub if necesary
         if (!allowInstParam && pTargetMD->RequiresInstArg())
@@ -7875,12 +7866,6 @@ CorInfoInline CEEInfo::canInline (CORINFO_METHOD_HANDLE hCaller,
         {
             dwRestrictions |= INLINE_NO_CALLEE_LDSTR;
         }
-
-        // The remoting interception can be skipped only if the call is on same this pointer
-        if (pCallee->MayBeRemotingIntercepted())
-        {
-            dwRestrictions |= INLINE_SAME_THIS;
-        }
     }
 
 #ifdef PROFILING_SUPPORTED
@@ -9169,8 +9154,6 @@ void CEEInfo::getFunctionEntryPoint(CORINFO_METHOD_HANDLE  ftnHnd,
         // should never get here for EnC methods or if interception via remoting stub is required
         _ASSERTE(!ftn->IsEnCMethod());
 
-        _ASSERTE((accessFlags & CORINFO_ACCESS_THIS) || !ftn->IsRemotingInterceptedViaVirtualDispatch());
-
         ret = (void *)ftn->GetAddrOfSlot();
 
         if (MethodTable::VTableIndir2_t::isRelative
index 2890c34..a2440ff 100644 (file)
@@ -2157,8 +2157,7 @@ PCODE MethodDesc::TryGetMultiCallableAddrOfCode(CORINFO_ACCESS_FLAGS accessFlags
     if (IsFCall())
     {
         // Call FCalls directly when possible
-        if (((accessFlags & CORINFO_ACCESS_THIS) || !IsRemotingInterceptedViaPrestub()) 
-            && !IsInterface() && !GetMethodTable()->ContainsGenericVariables())
+        if (!IsInterface() && !GetMethodTable()->ContainsGenericVariables())
         {
             BOOL fSharedOrDynamicFCallImpl;
             PCODE pFCallImpl = ECall::GetFCallImpl(this, &fSharedOrDynamicFCallImpl);
@@ -2804,13 +2803,6 @@ bool MethodDesc::CanSkipDoPrestub (
     // @todo generics: Until we fix the RVA map in zapper.cpp to be instantiation-aware, this must remain
     CheckRestore();
 
-    // The remoting interception is not necessary if we are calling on the same thisptr
-    if (!(accessFlags & CORINFO_ACCESS_THIS) && IsRemotingInterceptedViaPrestub())
-    {
-        *pReason = CORINFO_INDIRECT_CALL_REMOTING;
-        return false;
-    }
-
     // The wrapper stubs cannot be called directly (like any other stubs)
     if (IsWrapperStub())
     {
@@ -5488,7 +5480,7 @@ PrecodeType MethodDesc::GetPrecodeType()
     PrecodeType precodeType = PRECODE_INVALID;
 
 #ifdef HAS_REMOTING_PRECODE
-    if (IsRemotingInterceptedViaPrestub() || (IsComPlusCall() && !IsStatic()))
+    if (IsComPlusCall() && !IsStatic())
     {
         precodeType = PRECODE_REMOTING;
     }
index 57561ef..002985f 100644 (file)
@@ -285,7 +285,7 @@ public:
         }
         CONTRACTL_END
 
-        return !MayHaveNativeCode() || IsRemotingInterceptedViaPrestub() || IsVersionableWithPrecode();
+        return !MayHaveNativeCode() || IsVersionableWithPrecode();
     }
 
     void InterlockedUpdateFlags2(BYTE bMask, BOOL fSet);
@@ -710,51 +710,6 @@ public:
 #endif
     CHECK CheckActivated();
 
-
-    //================================================================
-    // REMOTING
-    //
-    // IsRemoting...: These predicates indicate how are remoting
-    // intercepts are implemented.
-    //
-    // Remoting intercepts are required for all invocations of  methods on
-    // MarshalByRef classes (including virtual calls on methods
-    // which end up invoking a method on the MarshalByRef class).
-    //
-    // Remoting intercepts are implemented by one of the following techniques:
-    //  (1) Non-virtual methods: inserting a stub in DoPrestub (for non-virtual calls)
-    //   See: IsRemotingInterceptedViaPrestub
-    //
-    //  (2) Virtual methods: by transparent proxy vtables, where all the entries in the vtable
-    //      are a special hook which traps into the remoting logic
-    //   See: IsRemotingInterceptedViaVirtualDispatch (context indicates
-    //        if it is a virtual call)
-    //
-    //  (3) Non-virtual-calls on virtual methods:
-    //      by forcing calls to be indirect and wrapping the
-    //      call with a stub returned by GetNonVirtualEntryPointForVirtualMethod.
-    //      (this is used when invoking virtual methods non-virtually using 'call')
-    //   See: IsRemotingInterceptedViaVirtualDispatch (context indicates
-    //        if it is a virtual call)
-    //
-    // Ultimately essentially all calls go through CTPMethodTable::OnCall in
-    // remoting.cpp.
-    //
-    // Check if this methoddesc needs to be intercepted
-    // by the context code, using a stub.
-    // Also see IsRemotingInterceptedViaVirtualDispatch()
-    BOOL IsRemotingInterceptedViaPrestub();
-
-    // Check if is intercepted by the context code, using the virtual table
-    // of TransparentProxy.
-    // If such a function is called non-virtually, it needs to be handled specially
-    BOOL IsRemotingInterceptedViaVirtualDispatch();
-
-    BOOL MayBeRemotingIntercepted();
-
-    //================================================================
-    // Does it represent a one way method call with no out/return parameters?
-
     //================================================================
     // FCalls.
     BOOL IsFCall()
index dd14900..88491f5 100644 (file)
@@ -153,25 +153,6 @@ inline void MethodDesc::SetupGenericComPlusCall()
 #endif // FEATURE_COMINTEROP
 
 
-inline BOOL MethodDesc::MayBeRemotingIntercepted()
-{
-    LIMITED_METHOD_CONTRACT;
-    return FALSE;
-}
-
-inline BOOL MethodDesc::IsRemotingInterceptedViaPrestub()
-{
-    LIMITED_METHOD_CONTRACT;
-    return FALSE;
-}
-
-inline BOOL MethodDesc::IsRemotingInterceptedViaVirtualDispatch()
-{
-    LIMITED_METHOD_CONTRACT;
-    return FALSE;
-}
-
-
 #ifdef FEATURE_COMINTEROP
 
 // static
index 5d12796..8bd96da 100644 (file)
@@ -290,80 +290,6 @@ struct CrossModuleGenericsStaticsInfo
 };  // struct CrossModuleGenericsStaticsInfo
 typedef DPTR(CrossModuleGenericsStaticsInfo) PTR_CrossModuleGenericsStaticsInfo;
 
-// This structure records methods and fields which are interesting for VTS
-// (Version Tolerant Serialization). A pointer to it is optionally appended to
-// MethodTables with VTS event methods or NotSerialized or OptionallySerialized
-// fields. The structure is variable length to incorporate a packed array of
-// data describing the disposition of fields in the type.
-struct RemotingVtsInfo
-{
-    enum VtsCallbackType
-    {
-        VTS_CALLBACK_ON_SERIALIZING = 0,
-        VTS_CALLBACK_ON_SERIALIZED,
-        VTS_CALLBACK_ON_DESERIALIZING,
-        VTS_CALLBACK_ON_DESERIALIZED,
-        VTS_NUM_CALLBACK_TYPES
-    };
-
-    FixupPointer<PTR_MethodDesc> m_pCallbacks[VTS_NUM_CALLBACK_TYPES];
-#ifdef _DEBUG
-    DWORD               m_dwNumFields;
-#endif
-    DWORD               m_rFieldTypes[1];
-
-    static DWORD GetSize(DWORD dwNumFields)
-    {
-        LIMITED_METHOD_CONTRACT;
-        // Encode each field in two bits. Round up allocation to the nearest DWORD.
-        DWORD dwBitsRequired = dwNumFields * 2;
-        DWORD dwBytesRequired = (dwBitsRequired + 7) / 8;
-        return (DWORD)(offsetof(RemotingVtsInfo, m_rFieldTypes[0]) + ALIGN_UP(dwBytesRequired, sizeof(DWORD)));
-    }
-
-    void SetIsNotSerialized(DWORD dwFieldIndex)
-    {
-        LIMITED_METHOD_CONTRACT;
-        _ASSERTE(dwFieldIndex < m_dwNumFields);
-        DWORD dwRecordIndex = dwFieldIndex * 2;
-        DWORD dwOffset = dwRecordIndex / (sizeof(DWORD) * 8);
-        DWORD dwMask = 1 << (dwRecordIndex % (sizeof(DWORD) * 8));
-        m_rFieldTypes[dwOffset] |= dwMask;
-    }
-
-    BOOL IsNotSerialized(DWORD dwFieldIndex)
-    {
-        LIMITED_METHOD_CONTRACT;
-        _ASSERTE(dwFieldIndex < m_dwNumFields);
-        DWORD dwRecordIndex = dwFieldIndex * 2;
-        DWORD dwOffset = dwRecordIndex / (sizeof(DWORD) * 8);
-        DWORD dwMask = 1 << (dwRecordIndex % (sizeof(DWORD) * 8));
-        return m_rFieldTypes[dwOffset] & dwMask;
-    }
-
-    void SetIsOptionallySerialized(DWORD dwFieldIndex)
-    {
-        LIMITED_METHOD_CONTRACT;
-        _ASSERTE(dwFieldIndex < m_dwNumFields);
-        DWORD dwRecordIndex = dwFieldIndex * 2;
-        DWORD dwOffset = dwRecordIndex / (sizeof(DWORD) * 8);
-        DWORD dwMask = 2 << (dwRecordIndex % (sizeof(DWORD) * 8));
-        m_rFieldTypes[dwOffset] |= dwMask;
-    }
-
-    BOOL IsOptionallySerialized(DWORD dwFieldIndex)
-    {
-        LIMITED_METHOD_CONTRACT;
-        _ASSERTE(dwFieldIndex < m_dwNumFields);
-        DWORD dwRecordIndex = dwFieldIndex * 2;
-        DWORD dwOffset = dwRecordIndex / (sizeof(DWORD) * 8);
-        DWORD dwMask = 2 << (dwRecordIndex % (sizeof(DWORD) * 8));
-        return m_rFieldTypes[dwOffset] & dwMask;
-    }
-};  // struct RemotingVtsInfo
-typedef DPTR(RemotingVtsInfo) PTR_RemotingVtsInfo;
-
-
 #ifdef FEATURE_COMINTEROP
 struct RCWPerTypeData;
 #endif // FEATURE_COMINTEROP
@@ -3909,8 +3835,6 @@ private:
         enum_flag_GenericsMask_SharedInst   = 0x00000020,   // shared instantiation, e.g. List<__Canon> or List<MyValueType<__Canon>>
         enum_flag_GenericsMask_TypicalInst  = 0x00000030,   // the type instantiated at its formal parameters, e.g. List<T>
 
-        enum_flag_HasRemotingVtsInfo        = 0x00000080,   // Optional data present indicating VTS methods and optional fields
-
         enum_flag_HasVariance               = 0x00000100,   // This is an instantiated type some of whose type parameters are co or contra-variant
 
         enum_flag_HasDefaultCtor            = 0x00000200,
@@ -4341,12 +4265,10 @@ private:
 
     inline static DWORD GetOptionalMembersAllocationSize(
                                                   DWORD dwMultipurposeSlotsMask,
-                                                  BOOL needsRemotableMethodInfo,
                                                   BOOL needsGenericsStaticsInfo,
                                                   BOOL needsGuidInfo,
                                                   BOOL needsCCWTemplate,
                                                   BOOL needsRCWPerTypeData,
-                                                  BOOL needsRemotingVtsInfo,
                                                   BOOL needsTokenOverflow);
     inline DWORD GetOptionalMembersSize();
 
@@ -4398,12 +4320,6 @@ private:
 
     void SetModule(Module * pModule);
 
-    /************************************
-    //
-    // CONTEXT STATIC
-    //
-    ************************************/
-
 public:
 
     BOOL Validate ();
index 6021630..52c52c8 100644 (file)
@@ -1388,26 +1388,17 @@ FORCEINLINE DWORD MethodTable::GetOffsetOfOptionalMember(OptionalMemberId id)
 }
 
 //==========================================================================================
-// this is not the pretties function however I got bitten pretty hard by the computation 
-// of the allocation size of a MethodTable done "by hand" in few places.
-// Essentially the idea is that this is going to centralize computation of size for optional
-// members so the next morons that need to add an optional member will look at this function
-// and hopefully be less exposed to code doing size computation behind their back
 inline DWORD MethodTable::GetOptionalMembersAllocationSize(DWORD dwMultipurposeSlotsMask,
-                                                           BOOL needsRemotableMethodInfo,
                                                            BOOL needsGenericsStaticsInfo,
                                                            BOOL needsGuidInfo,
                                                            BOOL needsCCWTemplate,
                                                            BOOL needsRCWPerTypeData,
-                                                           BOOL needsRemotingVtsInfo,
                                                            BOOL needsTokenOverflow)
 {
     LIMITED_METHOD_CONTRACT;
 
     DWORD size = c_OptionalMembersStartOffsets[dwMultipurposeSlotsMask] - sizeof(MethodTable);
 
-    if (needsRemotableMethodInfo)
-        size += sizeof(UINT_PTR);
     if (needsGenericsStaticsInfo)
         size += sizeof(GenericsStaticsInfo);
     if (needsGuidInfo)
@@ -1416,8 +1407,6 @@ inline DWORD MethodTable::GetOptionalMembersAllocationSize(DWORD dwMultipurposeS
         size += sizeof(UINT_PTR);
     if (needsRCWPerTypeData)
         size += sizeof(UINT_PTR);
-    if (needsRemotingVtsInfo)
-        size += sizeof(UINT_PTR);
     if (dwMultipurposeSlotsMask & enum_flag_HasInterfaceMap)
         size += sizeof(UINT_PTR);
     if (needsTokenOverflow)
index 6450e35..cfc4f4c 100644 (file)
@@ -5206,8 +5206,7 @@ MethodTableBuilder::PlaceNonVirtualMethods()
 #endif // _DEBUG
 
         if (!fCanHaveNonVtableSlots ||
-            it->GetMethodType() == METHOD_TYPE_INSTANTIATED ||
-            MayBeRemotingIntercepted(*it))
+            it->GetMethodType() == METHOD_TYPE_INSTANTIATED)
         {
             // We use slot during remoting and to map methods between generic instantiations
             // (see MethodTable::GetParallelMethodDesc). The current implementation
@@ -6964,15 +6963,6 @@ MethodTableBuilder::NeedsNativeCodeSlot(bmtMDMethod * pMDMethod)
 }
 
 //*******************************************************************************
-BOOL
-MethodTableBuilder::MayBeRemotingIntercepted(bmtMDMethod * pMDMethod)
-{
-    LIMITED_METHOD_CONTRACT;
-
-    return FALSE;
-}
-
-//*******************************************************************************
 VOID
 MethodTableBuilder::AllocAndInitDictionary()
 {
@@ -9789,9 +9779,7 @@ MethodTable * MethodTableBuilder::AllocateNewMT(Module *pLoaderModule,
                                          BOOL isInterface,
                                          BOOL fDynamicStatics,
                                          BOOL fHasGenericsStaticsInfo,
-                                         BOOL fNeedsRCWPerTypeData,
-                                         BOOL fNeedsRemotableMethodInfo,
-                                         BOOL fNeedsRemotingVtsInfo
+                                         BOOL fNeedsRCWPerTypeData
 #ifdef FEATURE_COMINTEROP
         , BOOL fHasDynamicInterfaceMap
 #endif
@@ -9836,12 +9824,10 @@ MethodTable * MethodTableBuilder::AllocateNewMT(Module *pLoaderModule,
 
     // Add space for optional members here. Same as GetOptionalMembersSize()
     cbTotalSize += MethodTable::GetOptionalMembersAllocationSize(dwMultipurposeSlotsMask,
-                                                      fNeedsRemotableMethodInfo,
                                                       fHasGenericsStaticsInfo,
                                                       FALSE, // no GuidInfo needed for canonical instantiations
                                                       FALSE, // no CCW template needed for canonical instantiations
                                                       fNeedsRCWPerTypeData,
-                                                      fNeedsRemotingVtsInfo,
                                                       RidFromToken(GetCl()) >= METHODTABLE_TOKEN_OVERFLOW);
 
     // Interface map starts here
@@ -10089,10 +10075,6 @@ MethodTableBuilder::SetupMethodTable2(
                           bmtGenerics->GetNumGenericArgs(), pClass->GetDictionaryLayout())
                    : 0;
 
-
-    BOOL fNeedsRemotableMethodInfo=FALSE;
-    BOOL fNeedsRemotingVtsInfo = FALSE;
-
 #ifdef FEATURE_COLLECTIBLE_TYPES
     BOOL fCollectible = pLoaderModule->IsCollectible();
 #endif // FEATURE_COLLECTIBLE_TYPES
@@ -10132,8 +10114,6 @@ MethodTableBuilder::SetupMethodTable2(
                                    bmtProp->fDynamicStatics,
                                    bmtProp->fGenericsStatics,
                                    fNeedsRCWPerTypeData,
-                                   fNeedsRemotableMethodInfo,
-                                   fNeedsRemotingVtsInfo,
 #ifdef FEATURE_COMINTEROP 
                                    fHasDynamicInterfaceMap,
 #endif
index cbcde31..1a21b8e 100644 (file)
@@ -1868,8 +1868,8 @@ private:
         // Counts instance fields
         DWORD dwNumInstanceFields;
 
-        // Counts both regular statics and thread statics. Currently RVA and
-        // context statics get lumped in with "regular statics".
+        // Counts both regular statics and thread statics. Currently RVA
+        // get lumped in with "regular statics".
         DWORD dwNumStaticFields;
         DWORD dwNumStaticObjRefFields;
         DWORD dwNumStaticBoxedFields;
@@ -2801,11 +2801,6 @@ private:
     NeedsNativeCodeSlot(bmtMDMethod * pMDMethod);
 
     // --------------------------------------------------------------------------------------------
-    // MethodTableBuilder version of code:MethodDesc::MayBeRemotingIntercepted. Used for MethodDesc layout.
-    BOOL
-    MayBeRemotingIntercepted(bmtMDMethod * pMDMethod);
-
-    // --------------------------------------------------------------------------------------------
     // Used to allocate and initialize the dictionary used with generic types.
     VOID
     AllocAndInitDictionary();
@@ -2940,9 +2935,7 @@ private:
                                 BOOL isIFace, 
                                 BOOL fDynamicStatics,
                                 BOOL fHasGenericsStaticsInfo,
-                                BOOL fNeedsRCWPerTypeData,
-                                BOOL fNeedsRemotableMethodInfo,
-                                BOOL fNeedsRemotingVtsInfo
+                                BOOL fNeedsRCWPerTypeData
 #ifdef FEATURE_COMINTEROP
                                 , BOOL bHasDynamicInterfaceMap
 #endif
index 5651a14..9c8d0f1 100644 (file)
@@ -85,7 +85,6 @@ class Thread;
 class BaseDomain;
 class Assembly;
 class Context;
-class CtxStaticData;
 class DomainAssembly;
 class AssemblyNative;
 class WaitHandleNative;
index cec6447..b53f136 100644 (file)
@@ -1992,11 +1992,7 @@ static PCODE PatchNonVirtualExternalMethod(MethodDesc * pMD, PCODE pCode, PTR_CO
     //
 #ifdef HAS_FIXUP_PRECODE
     if (pMD->HasPrecode() && pMD->GetPrecode()->GetType() == PRECODE_FIXUP
-        && pMD->IsNativeCodeStableAfterInit()
-#ifndef HAS_REMOTING_PRECODE
-        && !pMD->IsRemotingInterceptedViaPrestub()
-#endif
-        )
+        && pMD->IsNativeCodeStableAfterInit())
     {
         PCODE pDirectTarget = pMD->IsFCall() ? ECall::GetFCallImpl(pMD) : pMD->GetNativeCode();
         if (pDirectTarget != NULL)
index 425ceb8..93fc712 100644 (file)
@@ -3537,9 +3537,7 @@ HRESULT ProfToEEInterfaceImpl::GetThreadStaticAddress2(ClassID classId,
  *    pAddress - location for storing the resulting address location.
  *
  * Returns:
- *    S_OK on success,
- *    E_INVALIDARG if not a context static,
- *    CORPROF_E_DATAINCOMPLETE if not yet initialized.
+ *    E_NOTIMPL
  *
  */
 HRESULT ProfToEEInterfaceImpl::GetContextStaticAddress(ClassID classId,