@@ -430,27 +430,6 @@ void PinnedHeapHandleTable::EnumStaticGCRefs(promote_func* fn, ScanContext* sc)
430430 }
431431}
432432
433- // *****************************************************************************
434- // BaseDomain
435- // *****************************************************************************
436-
437- BaseDomain::BaseDomain ()
438- {
439- // initialize fields so the domain can be safely destructed
440- // shouldn't call anything that can fail here - use ::Init instead
441- CONTRACTL
442- {
443- THROWS;
444- GC_TRIGGERS;
445- MODE_ANY;
446- FORBID_FAULT;
447- }
448- CONTRACTL_END;
449-
450- // Make sure the container is set to NULL so that it gets loaded when it is used.
451- m_pPinnedHeapHandleTable = NULL ;
452- } // BaseDomain::BaseDomain
453-
454433#undef LOADERHEAP_PROFILE_COUNTER
455434
456435void AppDomain::ClearBinderContext ()
@@ -573,7 +552,7 @@ void AppDomain::SetNativeDllSearchDirectories(LPCWSTR wszNativeDllSearchDirector
573552 }
574553}
575554
576- OBJECTREF* BaseDomain ::AllocateObjRefPtrsInLargeTable (int nRequested, DynamicStaticsInfo* pStaticsInfo, MethodTable *pMTToFillWithStaticBoxes, bool isClassInitdeByUpdatingStaticPointer)
555+ OBJECTREF* AppDomain ::AllocateObjRefPtrsInLargeTable (int nRequested, DynamicStaticsInfo* pStaticsInfo, MethodTable *pMTToFillWithStaticBoxes, bool isClassInitdeByUpdatingStaticPointer)
577556{
578557 CONTRACTL
579558 {
@@ -661,7 +640,7 @@ OBJECTREF AppDomain::GetMissingObject()
661640#ifndef DACCESS_COMPILE
662641
663642
664- STRINGREF * BaseDomain ::IsStringInterned (STRINGREF *pString)
643+ STRINGREF* AppDomain ::IsStringInterned (STRINGREF *pString)
665644{
666645 CONTRACTL
667646 {
@@ -676,7 +655,7 @@ STRINGREF *BaseDomain::IsStringInterned(STRINGREF *pString)
676655 return GetLoaderAllocator ()->IsStringInterned (pString);
677656}
678657
679- STRINGREF * BaseDomain ::GetOrInternString (STRINGREF *pString)
658+ STRINGREF* AppDomain ::GetOrInternString (STRINGREF *pString)
680659{
681660 CONTRACTL
682661 {
@@ -691,7 +670,7 @@ STRINGREF *BaseDomain::GetOrInternString(STRINGREF *pString)
691670 return GetLoaderAllocator ()->GetOrInternString (pString);
692671}
693672
694- void BaseDomain ::InitPinnedHeapHandleTable ()
673+ void AppDomain ::InitPinnedHeapHandleTable ()
695674{
696675 CONTRACTL
697676 {
@@ -1622,6 +1601,30 @@ HRESULT SystemDomain::NotifyProfilerShutdown()
16221601#endif // PROFILING_SUPPORTED
16231602
16241603AppDomain::AppDomain ()
1604+ : m_handleStore{NULL }
1605+ , m_pPinnedHeapHandleTable{NULL }
1606+ , m_pDefaultBinder{NULL }
1607+ , m_pRefClassFactHash{NULL }
1608+ #ifdef FEATURE_COMINTEROP
1609+ , m_pRefDispIDCache{NULL }
1610+ , m_hndMissing{NULL }
1611+ #endif // FEATURE_COMINTEROP
1612+ , m_pDelayedLoaderAllocatorUnloadList{NULL }
1613+ , m_pRootAssembly{NULL }
1614+ , m_dwFlags{0 }
1615+ , m_cRef{1 }
1616+ #ifdef FEATURE_COMINTEROP
1617+ , m_pRCWCache{NULL }
1618+ #endif // FEATURE_COMINTEROP
1619+ #ifdef FEATURE_COMWRAPPERS
1620+ , m_pRCWRefCache{NULL }
1621+ #endif // FEATURE_COMWRAPPERS
1622+ , m_Stage{STAGE_CREATING}
1623+ , m_MemoryPressure{0 }
1624+ , m_ForceTrivialWaitOperations{false }
1625+ #ifdef FEATURE_TYPEEQUIVALENCE
1626+ , m_pTypeEquivalenceTable{NULL }
1627+ #endif // FEATURE_TYPEEQUIVALENCE
16251628{
16261629 // initialize fields so the appdomain can be safely destructed
16271630 // shouldn't call anything that can fail here - use ::Init instead
@@ -1634,45 +1637,16 @@ AppDomain::AppDomain()
16341637 }
16351638 CONTRACTL_END;
16361639
1637- m_cRef=1 ;
1638-
16391640 m_JITLock.PreInit ();
16401641 m_ClassInitLock.PreInit ();
16411642 m_ILStubGenLock.PreInit ();
16421643 m_NativeTypeLoadLock.PreInit ();
16431644 m_FileLoadLock.PreInit ();
16441645
1645- m_pDefaultBinder = NULL ;
1646- m_pRootAssembly = NULL ;
1647-
1648- m_dwFlags = 0 ;
1649- #ifdef FEATURE_COMINTEROP
1650- m_pRCWCache = NULL ;
1651- #endif // FEATURE_COMINTEROP
1652- #ifdef FEATURE_COMWRAPPERS
1653- m_pRCWRefCache = NULL ;
1654- #endif // FEATURE_COMWRAPPERS
1655-
1656- m_handleStore = NULL ;
1657-
16581646#ifdef _DEBUG
16591647 m_Assemblies.Debug_SetAppDomain (this );
16601648#endif // _DEBUG
16611649
1662- #ifdef FEATURE_COMINTEROP
1663- m_pRefDispIDCache = NULL ;
1664- m_hndMissing = NULL ;
1665- #endif
1666-
1667- m_pRefClassFactHash = NULL ;
1668-
1669- m_ForceTrivialWaitOperations = false ;
1670- m_Stage=STAGE_CREATING;
1671-
1672- #ifdef FEATURE_TYPEEQUIVALENCE
1673- m_pTypeEquivalenceTable = NULL ;
1674- #endif // FEATURE_TYPEEQUIVALENCE
1675-
16761650} // AppDomain::AppDomain
16771651
16781652AppDomain::~AppDomain ()
@@ -1696,13 +1670,10 @@ void AppDomain::Init()
16961670 CONTRACTL
16971671 {
16981672 STANDARD_VM_CHECK;
1673+ PRECONDITION (m_Stage == STAGE_CREATING);
16991674 }
17001675 CONTRACTL_END;
17011676
1702- m_pDelayedLoaderAllocatorUnloadList = NULL ;
1703-
1704- SetStage ( STAGE_CREATING);
1705-
17061677 //
17071678 // The JIT lock and the CCtor locks are at the same level (and marked as
17081679 // UNSAFE_SAME_LEVEL) because they are all part of the same deadlock detection mechanism. We
@@ -1729,8 +1700,6 @@ void AppDomain::Init()
17291700 // Set up the binding caches
17301701 m_AssemblyCache.Init (&m_DomainCacheCrst, GetHighFrequencyHeap ());
17311702
1732- m_MemoryPressure = 0 ;
1733-
17341703 m_handleStore = GCHandleUtilities::GetGCHandleManager ()->GetGlobalHandleStore ();
17351704 if (!m_handleStore)
17361705 {
@@ -4057,7 +4026,7 @@ void AppDomain::EnumStaticGCRefs(promote_func* fn, ScanContext* sc)
40574026#endif // !DACCESS_COMPILE
40584027
40594028// ------------------------------------------------------------------------
4060- PTR_LoaderAllocator BaseDomain ::GetLoaderAllocator ()
4029+ PTR_LoaderAllocator AppDomain ::GetLoaderAllocator ()
40614030{
40624031 WRAPPER_NO_CONTRACT;
40634032 return SystemDomain::GetGlobalLoaderAllocator (); // The one and only domain is not unloadable
@@ -4536,7 +4505,7 @@ SystemDomain::EnumMemoryRegions(CLRDataEnumMemoryFlags flags, bool enumThis)
45364505
45374506 if (flags == CLRDATA_ENUM_MEM_HEAP2)
45384507 {
4539- GetLoaderAllocator ()->EnumMemoryRegions (flags);
4508+ GetGlobalLoaderAllocator ()->EnumMemoryRegions (flags);
45404509 }
45414510 if (m_pSystemPEAssembly.IsValid ())
45424511 {
0 commit comments