Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions src/coreclr/src/vm/appdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1448,13 +1448,27 @@ void SystemDomain::LoadBaseSystemClasses()
g_pEnumClass = CoreLibBinder::GetClass(CLASS__ENUM);
_ASSERTE(!g_pEnumClass->IsValueType());

// Load Array class
g_pArrayClass = CoreLibBinder::GetClass(CLASS__ARRAY);

// Load the Object array class.
g_pPredefinedArrayTypes[ELEMENT_TYPE_OBJECT] = ClassLoader::LoadArrayTypeThrowing(TypeHandle(g_pObjectClass));

// We have delayed allocation of CoreLib's static handles until we load the object class
CoreLibBinder::GetModule()->AllocateRegularStaticHandles(DefaultDomain());

// Make sure all primitive types are loaded
for (int et = ELEMENT_TYPE_VOID; et <= ELEMENT_TYPE_R8; et++)
CoreLibBinder::LoadPrimitiveType((CorElementType)et);

#ifndef CROSSGEN_COMPILE
CastCache::Initialize();
#endif // CROSSGEN_COMPILE

// Load System.RuntimeType
g_pRuntimeTypeClass = CoreLibBinder::GetClass(CLASS__CLASS);
_ASSERTE(g_pRuntimeTypeClass->IsFullyLoaded());

// Load Array class
g_pArrayClass = CoreLibBinder::GetClass(CLASS__ARRAY);

// Calling a method on IList<T> for an array requires redirection to a method on
// the SZArrayHelper class. Retrieving such methods means calling
// GetActualImplementationForArrayGenericIListMethod, which calls FetchMethod for
Expand All @@ -1472,16 +1486,6 @@ void SystemDomain::LoadBaseSystemClasses()
// Load Nullable class
g_pNullableClass = CoreLibBinder::GetClass(CLASS__NULLABLE);

// Load the Object array class.
g_pPredefinedArrayTypes[ELEMENT_TYPE_OBJECT] = ClassLoader::LoadArrayTypeThrowing(TypeHandle(g_pObjectClass));

// We have delayed allocation of CoreLib's static handles until we load the object class
CoreLibBinder::GetModule()->AllocateRegularStaticHandles(DefaultDomain());

// Make sure all primitive types are loaded
for (int et = ELEMENT_TYPE_VOID; et <= ELEMENT_TYPE_R8; et++)
CoreLibBinder::LoadPrimitiveType((CorElementType)et);

CoreLibBinder::LoadPrimitiveType(ELEMENT_TYPE_I);
CoreLibBinder::LoadPrimitiveType(ELEMENT_TYPE_U);

Expand All @@ -1503,7 +1507,6 @@ void SystemDomain::LoadBaseSystemClasses()
// further loading of nonprimitive types may need casting support.
// initialize cast cache here.
#ifndef CROSSGEN_COMPILE
CastCache::Initialize();
ECall::PopulateManagedCastHelpers();
#endif // CROSSGEN_COMPILE

Expand Down