Address PR feedback
authorSteve MacLean <Steve.MacLean@Microsoft.com>
Fri, 30 Nov 2018 22:18:46 +0000 (17:18 -0500)
committerSteve MacLean <stmaclea@microsoft.com>
Sat, 1 Dec 2018 01:37:45 +0000 (20:37 -0500)
src/vm/appdomain.cpp
src/vm/appdomain.hpp
src/vm/ceeload.cpp

index b0cb03b..19999cd 100644 (file)
@@ -3822,8 +3822,7 @@ BOOL AppDomain::IsCompilationDomain()
 
     BOOL isCompilationDomain = (m_dwFlags & COMPILATION_DOMAIN) != 0;
 #ifdef FEATURE_PREJIT
-    _ASSERTE(!isCompilationDomain ||
-             (IsCompilationProcess() && IsPassiveDomain()));
+    _ASSERTE(!isCompilationDomain || IsCompilationProcess());
 #endif // FEATURE_PREJIT
     return isCompilationDomain;
 }
index b946106..b326b26 100644 (file)
@@ -2603,18 +2603,11 @@ public:
         return (m_dwFlags & IGNORE_UNHANDLED_EXCEPTIONS);
     }
 
-    BOOL IsPassiveDomain()
-    {
-        LIMITED_METHOD_CONTRACT;
-
-        return (m_dwFlags & PASSIVE_DOMAIN);
-    }
-
     void SetCompilationDomain()
     {
         LIMITED_METHOD_CONTRACT;
 
-        m_dwFlags |= (PASSIVE_DOMAIN|COMPILATION_DOMAIN);
+        m_dwFlags |= (COMPILATION_DOMAIN);
     }
 
     BOOL IsCompilationDomain();
@@ -3283,7 +3276,6 @@ public:
         ALLOCATEDCOM =                      0x0008,
         LOAD_SYSTEM_ASSEMBLY_EVENT_SENT =   0x0040,
         COMPILATION_DOMAIN =                0x0400, // Are we ngenning?
-        PASSIVE_DOMAIN =                    0x2000, // Can we execute code in this AppDomain
         IGNORE_UNHANDLED_EXCEPTIONS =      0x10000, // AppDomain was created using the APPDOMAIN_IGNORE_UNHANDLED_EXCEPTIONS flag
         ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP    =      0x20000, // AppDomain was created using the APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP flag
         ENABLE_SKIP_PLAT_CHECKS         = 0x200000, // Skip various assembly checks (like platform check)
index a050638..c6911ed 100644 (file)
@@ -3103,49 +3103,8 @@ void Module::SetDomainFile(DomainFile *pDomainFile)
 
     DomainLocalModule* pModuleData = 0;
 
-    // Do we need to allocate memory for the non GC statics?
-    if (m_ModuleID == NULL)
-    {
-        // Allocate memory for the module statics.
-        LoaderAllocator *pLoaderAllocator = NULL;
-        if (GetAssembly()->IsCollectible())
-        {
-            pLoaderAllocator = GetAssembly()->GetLoaderAllocator();
-        }
-        else
-        {
-            pLoaderAllocator = pDomainFile->GetAppDomain()->GetLoaderAllocator();
-        }
-
-        SIZE_T size = GetDomainLocalModuleSize();
-
-        LOG((LF_CLASSLOADER, LL_INFO10, "STATICS: Allocating %i bytes for precomputed statics in module %S in LoaderAllocator %p\n",
-            size, this->GetDebugName(), pLoaderAllocator));
-
-        // We guarantee alignment for 64-bit regular statics on 32-bit platforms even without FEATURE_64BIT_ALIGNMENT for performance reasons.
-
-        _ASSERTE(size >= DomainLocalModule::OffsetOfDataBlob());
-
-        pModuleData = (DomainLocalModule*)(void*)
-            pLoaderAllocator->GetHighFrequencyHeap()->AllocAlignedMem(
-                size, MAX_PRIMITIVE_FIELD_SIZE);
-
-        // Note: Memory allocated on loader heap is zero filled
-        // memset(pModuleData, 0, size);
-
-        // Verify that the space is really zero initialized
-        _ASSERTE(pModuleData->GetPrecomputedGCStaticsBasePointer() == NULL);
-
-        // If the module was loaded as domain-specific, then we need to assign
-        // this module a domain-neutral module ID.
-        pModuleData->m_ModuleIndex = Module::AllocateModuleIndex();
-        m_ModuleIndex = pModuleData->m_ModuleIndex;
-    }
-    else
-    {
-        pModuleData = this->m_ModuleID;
-        LOG((LF_CLASSLOADER, LL_INFO10, "STATICS: Allocation not needed for ngened non shared module %s in Appdomain %08x\n"));
-    }
+    pModuleData = this->m_ModuleID;
+    LOG((LF_CLASSLOADER, LL_INFO10, "STATICS: Allocation not needed for ngened non shared module %s in Appdomain %08x\n"));
 
     // Non shared case, module points directly to the statics. In ngen case
     // m_pDomainModule is already set for the non shared case
@@ -6684,7 +6643,7 @@ void Module::FixupVTables()
     // <REVISIT_TODO>@todo: workaround!</REVISIT_TODO>
     // If we are compiling in-process, we don't want to fixup the vtables - as it
     // will have side effects on the other copy of the module!
-    if (SystemDomain::GetCurrentDomain()->IsPassiveDomain()) {
+    if (SystemDomain::GetCurrentDomain()->IsCompilationDomain()) {
         return;
     }