<PropertyGroup>
<_ILLinkRuntimeRootDescriptorFilePath>$(ILLinkTrimXml)</_ILLinkRuntimeRootDescriptorFilePath>
<_NamespaceFilePath Condition=" '$(_NamespaceFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\namespace.h</_NamespaceFilePath>
- <_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\mscorlib.h</_MscorlibFilePath>
+ <_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\corelib.h</_MscorlibFilePath>
<_CortypeFilePath Condition=" '$(_CortypeFilePath)' == '' ">$(MSBuildThisFileDirectory)..\inc\cortypeinfo.h</_CortypeFilePath>
<_RexcepFilePath Condition=" '$(_RexcepFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\rexcep.h</_RexcepFilePath>
<_ILLinkDescriptorsIntermediatePath>$(IntermediateOutputPath)ILLink.Descriptors.Combined.xml</_ILLinkDescriptorsIntermediatePath>
[DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)]
private static extern int GetProcessorCount();
- // If you change this method's signature then you must change the code that calls it
- // in excep.cpp and probably you will have to visit mscorlib.h to add the new signature
- // as well as metasig.h to create the new signature type
+ // Used by VM
internal static string? GetResourceStringLocal(string key) => SR.GetResourceString(key);
public static string StackTrace
}
// This piece of infrastructure exists to help avoid deadlocks
- // between parts of mscorlib that might throw an exception while
- // holding a lock that are also used by mscorlib's ResourceManager
+ // between parts of CoreLib that might throw an exception while
+ // holding a lock that are also used by CoreLib's ResourceManager
// instance. As a special case of code that may throw while holding
// a lock, we also need to fix our asynchronous exceptions to use
// Win32 resources as well (assuming we ever call a managed
public static void WaitForPendingFinalizers()
{
- // QCalls can not be exposed from mscorlib directly, need to wrap it.
+ // QCalls can not be exposed directly, need to wrap it.
_WaitForPendingFinalizers();
}
{
internal static class CompatibilitySwitch
{
- /* This class contains 3 sets of api:
- * 1. internal apis : These apis are supposed to be used by mscorlib.dll and other assemblies which use the <runtime> section in config
- * These apis query for the value of quirk not only in windows quirk DB but also in runtime section of config files,
- * registry and environment vars.
- * 2. public apis : These apis are supposed to be used by FX assemblies which do not read the runtime section of config files and have
- * have their own section in config files or do not use configs at all.
- *
- * 3. specialized apis: These apis are defined in order to retrieve a specific value defined in CLR Config. That value can have specific look-up rules
- * for the order and location of the config sources used.
- *
- * These apis are for internal use only for FX assemblies. It has not been decided if they can be used by OOB components due to EULA restrictions
- */
- internal static string? GetValueInternal(string compatibilitySwitchName)
- {
- return GetValueInternalCall(compatibilitySwitchName, false);
- }
-
[MethodImpl(MethodImplOptions.InternalCall)]
- private static extern string? GetValueInternalCall(string compatibilitySwitchName, bool onlyDB);
+ internal static extern string? GetValueInternal(string compatibilitySwitchName);
}
}
// Satellite assembly's path:
// * Absolute path when looking for a file on disk
// * Bundle-relative path when looking within the single-file bundle.
- StackSString sMscorlibSatellite;
+ StackSString sCoreLibSatellite;
BinderTracing::PathSource pathSource = BinderTracing::PathSource::Bundle;
BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(relativePath, /*pathIsBundleRelative */ true);
if (!bundleFileLocation.IsValid())
{
- sMscorlibSatellite.Set(systemDirectory);
+ sCoreLibSatellite.Set(systemDirectory);
pathSource = BinderTracing::PathSource::ApplicationAssemblies;
}
- CombinePath(sMscorlibSatellite, relativePath, sMscorlibSatellite);
+ CombinePath(sCoreLibSatellite, relativePath, sCoreLibSatellite);
ReleaseHolder<Assembly> pSystemAssembly;
- IF_FAIL_GO(AssemblyBinder::GetAssembly(sMscorlibSatellite,
+ IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLibSatellite,
TRUE /* fIsInGAC */,
FALSE /* fExplicitBindToNativeImage */,
&pSystemAssembly,
NULL /* szMDAssemblyPath */,
bundleFileLocation));
- BinderTracing::PathProbed(sMscorlibSatellite, pathSource, hr);
+ BinderTracing::PathProbed(sCoreLibSatellite, pathSource, hr);
*ppSystemAssembly = pSystemAssembly.Extract();
return ulRef;
}
- BOOL AssemblyName::IsMscorlib()
+ BOOL AssemblyName::IsCoreLib()
{
// TODO: Is this simple comparison enough?
- return EqualsCaseInsensitive(GetSimpleName(), g_BinderVariables->mscorlib);
+ return EqualsCaseInsensitive(GetSimpleName(), g_BinderVariables->corelib);
}
ULONG AssemblyName::Hash(DWORD dwIncludeFlags)
// ActivityTracker or EventSource may have triggered the system satellite load.
// Don't track system satellite binding to avoid potential infinite recursion.
- m_ignoreBind = m_bindRequest.AssemblySpec->IsMscorlibSatellite();
+ m_ignoreBind = m_bindRequest.AssemblySpec->IsCoreLibSatellite();
m_checkedIgnoreBind = true;
return m_ignoreBind;
}
HRESULT hr = S_OK;
#ifdef _DEBUG
- // MSCORLIB should be bound using BindToSystem
- _ASSERTE(!pAssemblyName->IsMscorlib());
+ // CoreLib should be bound using BindToSystem
+ _ASSERTE(!pAssemblyName->IsCoreLib());
#endif
// Do we have the assembly already loaded in the context of the current binder?
// Disallow attempt to bind to the core library. Aside from that,
// the LoadContext can load any assembly (even if it was in a different LoadContext like TPA).
- if (pAssemblyName->IsMscorlib())
+ if (pAssemblyName->IsCoreLib())
{
IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND));
}
HRESULT hr = S_OK;
#ifdef _DEBUG
- // MSCORLIB should be bound using BindToSystem
- _ASSERTE(!pAssemblyName->IsMscorlib());
+ // CoreLib should be bound using BindToSystem
+ _ASSERTE(!pAssemblyName->IsCoreLib());
#endif
hr = AssemblyBinder::BindAssembly(&m_appContext,
IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_BAD_FORMAT));
}
- // Easy out for mscorlib
- if (pAssemblyName->IsMscorlib())
+ // Easy out for CoreLib
+ if (pAssemblyName->IsCoreLib())
{
IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND));
}
inline void SetHave(DWORD dwIdentityFlags);
- BOOL IsMscorlib();
+ BOOL IsCoreLib();
ULONG Hash(/* in */ DWORD dwIncludeFlags);
BOOL Equals(/* in */ AssemblyName *pAssemblyName,
// AssemblyName string constants
SString cultureNeutral;
- SString mscorlib;
+ SString corelib;
};
extern Variables *g_BinderVariables;
// AssemblyName string constants
cultureNeutral.SetLiteral(W("neutral"));
- mscorlib.SetLiteral(CoreLibName_W);
+ corelib.SetLiteral(CoreLibName_W);
}
EX_CATCH_HRESULT(hr);
value->data = (BYTE*)origArgPtr + (sizeof(void*)-1);
}
#endif
- value->type = MscorlibBinder::GetElementType(elemType);
+ value->type = CoreLibBinder::GetElementType(elemType);
break;
case ELEMENT_TYPE_I2:
value->data = (BYTE*)origArgPtr + (sizeof(void*)-2);
}
#endif
- value->type = MscorlibBinder::GetElementType(elemType);
+ value->type = CoreLibBinder::GetElementType(elemType);
break;
case ELEMENT_TYPE_I4:
case ELEMENT_TYPE_STRING:
case ELEMENT_TYPE_I:
case ELEMENT_TYPE_U:
- value->type = MscorlibBinder::GetElementType(elemType);
+ value->type = CoreLibBinder::GetElementType(elemType);
break;
case ELEMENT_TYPE_I8:
case ELEMENT_TYPE_U8:
case ELEMENT_TYPE_R8:
- value->type = MscorlibBinder::GetElementType(elemType);
+ value->type = CoreLibBinder::GetElementType(elemType);
#if !defined(HOST_64BIT) && (DATA_ALIGNMENT > 4)
if ( fData && origArgPtr == value->data ) {
// allocate an aligned copy of the value
// Lookup operations run the class loader in non-load mode.
ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE();
- MethodTable * pMethodTable = (&g_Mscorlib)->GetElementType(elementType);
+ MethodTable * pMethodTable = (&g_CoreLib)->GetElementType(elementType);
return TypeHandle(pMethodTable);
} // DacDbiInterfaceImpl::FindLoadedElementType
if (mt->IsString())
{
COR_TYPEID token;
- token.token1 = MscorlibBinder::GetElementType(ELEMENT_TYPE_CHAR).GetAddr();
+ token.token1 = CoreLibBinder::GetElementType(ELEMENT_TYPE_CHAR).GetAddr();
token.token2 = 0;
pLayout->componentID = token;
}
CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_pEEDbgInterfaceImpl.EnumMem(); )
CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_CORDebuggerControlFlags.EnumMem(); )
- CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_Mscorlib.EnumMem(); )
+ CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_CoreLib.EnumMem(); )
CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_pPredefinedArrayTypes[ELEMENT_TYPE_OBJECT].EnumMemoryRegions(flags); )
CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( StubManager::EnumMemoryRegions(flags); )
CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_pFinalizerThread.EnumMem(); )
// Perform extra checks to identify well-known classes.
//
- if ((&g_Mscorlib)->IsClass(typeHandle.GetMethodTable(), CLASS__STRING))
+ if ((&g_CoreLib)->IsClass(typeHandle.GetMethodTable(), CLASS__STRING))
{
otherFlags |= CLRDATA_VALUE_IS_STRING;
}
m_dis(dis),
m_MetadataSize(0),
m_ILHostCopy(NULL),
- m_isMscorlibHardBound(false),
+ m_isCoreLibHardBound(false),
m_sectionAlignment(0)
{
IfFailThrow(m_display->GetDumpOptions(&m_dumpOptions));
/* XXX Wed 12/14/2005
* Now for the real insanity. I need to initialize static classes in
- * the DAC. First I need to find mscorlib's dependency entry. Search
+ * the DAC. First I need to find CoreLib's dependency entry. Search
* through all of the dependencies to find the one marked as
- * fIsMscorlib. If I don't find anything marked that way, then "self"
- * is mscorlib.
+ * fIsCoreLib. If I don't find anything marked that way, then "self"
+ * is CoreLib.
*/
- Dependency * mscorlib = NULL;
+ Dependency * corelib = NULL;
for( COUNT_T i = 0; i < m_numDependencies; ++i )
{
- if( m_dependencies[i].fIsMscorlib )
+ if( m_dependencies[i].fIsCoreLib )
{
- mscorlib = &m_dependencies[i];
+ corelib = &m_dependencies[i];
break;
}
}
- //If we're actually dumping mscorlib, remap the mscorlib dependency to our own native image.
- if( (mscorlib == NULL) || !wcscmp(m_name, CoreLibName_W))
+ //If we're actually dumping CoreLib, remap the CoreLib dependency to our own native image.
+ if( (corelib == NULL) || !wcscmp(m_name, CoreLibName_W))
{
- mscorlib = GetDependency(0);
- mscorlib->fIsMscorlib = TRUE;
- _ASSERTE(mscorlib->fIsHardbound);
+ corelib = GetDependency(0);
+ corelib->fIsCoreLib = TRUE;
+ _ASSERTE(corelib->fIsHardbound);
}
- _ASSERTE(mscorlib != NULL);
- if( mscorlib->fIsHardbound )
+ _ASSERTE(corelib != NULL);
+ if( corelib->fIsHardbound )
{
- m_isMscorlibHardBound = true;
+ m_isCoreLibHardBound = true;
}
- if( m_isMscorlibHardBound )
+ if( m_isCoreLibHardBound )
{
//go through the module to the binder.
- PTR_Module mscorlibModule = mscorlib->pModule;
+ PTR_Module corelibModule = corelib->pModule;
- PTR_MscorlibBinder binder = mscorlibModule->m_pBinder;
- g_Mscorlib = *binder;
+ PTR_CoreLibBinder binder = corelibModule->m_pBinder;
+ g_CoreLib = *binder;
- PTR_MethodTable mt = MscorlibBinder::GetExistingClass(CLASS__OBJECT);
+ PTR_MethodTable mt = CoreLibBinder::GetExistingClass(CLASS__OBJECT);
g_pObjectClass = mt;
}
if (g_pObjectClass == NULL)
{
- //if mscorlib is not hard bound, then warn the user (many features of nidump are shut off)
- m_display->ErrorPrintF( "Assembly %S is soft bound to mscorlib. nidump cannot dump MethodTables completely.\n", m_name );
+ //if CoreLib is not hard bound, then warn the user (many features of nidump are shut off)
+ m_display->ErrorPrintF( "Assembly %S is soft bound to CoreLib. nidump cannot dump MethodTables completely.\n", m_name );
// TritonTODO: reason?
// reset "hard bound state"
- m_isMscorlibHardBound = false;
+ m_isCoreLibHardBound = false;
}
}
m_display->ErrorPrintF("\tSize: %x (%d)\n", dependency->size, dependency->size);
m_display->ErrorPrintF("\tModule: P=%p, L=%p\n", DataPtrToDisplay(dac_cast<TADDR>(dependency->pModule)),
PTR_TO_TADDR(dependency->pModule));
- m_display->ErrorPrintF("Mscorlib=%s, Hardbound=%s\n",
- (dependency->fIsMscorlib ? "true" : "false"),
+ m_display->ErrorPrintF("CoreLib=%s, Hardbound=%s\n",
+ (dependency->fIsCoreLib ? "true" : "false"),
(dependency->fIsHardbound ? "true" : "false"));
m_display->ErrorPrintF("Name: %S\n", dependency->name);
}
}
else if (wcscmp(szAssemblyName, CoreLibName_W) == 0)
{
- // Mscorlib is special - version number and public key token are ignored.
+ // CoreLib is special - version number and public key token are ignored.
ret = currentRef;
break;
}
metadata.usBuildNumber == 255 &&
metadata.usRevisionNumber == 255)
{
- // WinMDs encode all assemblyrefs with version 255.255.255.255 including CLR assembly dependencies (mscorlib, System).
+ // WinMDs encode all assemblyrefs with version 255.255.255.255 including CLR assembly dependencies (corelib, System).
ret = currentRef;
}
else
Dependency& dependency = m_dependencies[index];
AppendTokenName(entry->dwAssemblyRef, buf, m_manifestImport, true);
bool isHardBound = !!(entry->signNativeImage != INVALID_NGEN_SIGNATURE);
- SString mscorlibStr(SString::Literal, CoreLibName_W);
- bool isMscorlib = (0 == buf.Compare( mscorlibStr ));
+ SString corelibStr(SString::Literal, CoreLibName_W);
+ bool isCoreLib = (0 == buf.Compare( corelibStr ));
dependency.fIsHardbound = isHardBound;
wcscpy_s(dependency.name, _countof(dependency.name),
(const WCHAR*)buf);
ofRead,
IID_IMetaDataImport2,
(IUnknown **) &dependency.pImport));
- dependency.fIsMscorlib = isMscorlib;
+ dependency.fIsCoreLib = isCoreLib;
}
m_dependencies[index].entry = entry;
/* REVISIT_TODO Fri 10/14/2005
* Dump the binder
*/
- PTR_MscorlibBinder binder = module->m_pBinder;
+ PTR_CoreLibBinder binder = module->m_pBinder;
if( NULL != binder )
{
DisplayStartStructureWithOffset( m_pBinder, DPtrToPreferredAddr(binder),
//these four fields don't have anything useful in ngen images.
DisplayWriteFieldPointer( m_classDescriptions,
DPtrToPreferredAddr(binder->m_classDescriptions),
- MscorlibBinder, MODULE );
+ CoreLibBinder, MODULE );
DisplayWriteFieldPointer( m_methodDescriptions,
DPtrToPreferredAddr(binder->m_methodDescriptions),
- MscorlibBinder, MODULE );
+ CoreLibBinder, MODULE );
DisplayWriteFieldPointer( m_fieldDescriptions,
DPtrToPreferredAddr(binder->m_fieldDescriptions),
- MscorlibBinder, MODULE );
+ CoreLibBinder, MODULE );
DisplayWriteFieldPointer( m_pModule,
DPtrToPreferredAddr(binder->m_pModule),
- MscorlibBinder, MODULE );
+ CoreLibBinder, MODULE );
- DisplayWriteFieldInt( m_cClasses, binder->m_cClasses, MscorlibBinder,
+ DisplayWriteFieldInt( m_cClasses, binder->m_cClasses, CoreLibBinder,
MODULE );
DisplayWriteFieldAddress( m_pClasses,
DPtrToPreferredAddr(binder->m_pClasses),
sizeof(*binder->m_pClasses)
* binder->m_cClasses,
- MscorlibBinder, MODULE );
- DisplayWriteFieldInt( m_cFields, binder->m_cFields, MscorlibBinder,
+ CoreLibBinder, MODULE );
+ DisplayWriteFieldInt( m_cFields, binder->m_cFields, CoreLibBinder,
MODULE );
DisplayWriteFieldAddress( m_pFields,
DPtrToPreferredAddr(binder->m_pFields),
sizeof(*binder->m_pFields)
* binder->m_cFields,
- MscorlibBinder, MODULE );
- DisplayWriteFieldInt( m_cMethods, binder->m_cMethods, MscorlibBinder,
+ CoreLibBinder, MODULE );
+ DisplayWriteFieldInt( m_cMethods, binder->m_cMethods, CoreLibBinder,
MODULE );
DisplayWriteFieldAddress( m_pMethods,
DPtrToPreferredAddr(binder->m_pMethods),
sizeof(*binder->m_pMethods)
* binder->m_cMethods,
- MscorlibBinder, MODULE );
+ CoreLibBinder, MODULE );
DisplayEndStructure( MODULE ); //m_pBinder
}
MethodTableToString( mt, buf );
m_display->ErrorPrintF( "WARNING! MethodTable %S is generic but is not hard bound to its EEClass. Cannot compute generic dictionary sizes.\n", (const WCHAR *)buf );
}
- else if( !m_isMscorlibHardBound )
+ else if( !m_isCoreLibHardBound )
{
/* REVISIT_TODO Mon 8/20/2007
- * If we're not hard bound to mscorlib, most things don't work. They depend on knowing what
- * g_pObjectClass is. Without the hard binding to mscorlib, I can't figure that out.
+ * If we're not hard bound to CoreLib, most things don't work. They depend on knowing what
+ * g_pObjectClass is. Without the hard binding to CoreLib, I can't figure that out.
*/
haveCompleteExtents = false;
}
TADDR pMetadataStartTarget;
TADDR pMetadataStartHost;
SIZE_T MetadataSize;
- bool fIsMscorlib;
+ bool fIsCoreLib;
bool fIsHardbound;
WCHAR name[128];
};
COUNT_T m_ILSectionSize;
#endif
- //This is true if we are hard bound to mscorlib. This enables various forms of generics dumping and MT
+ //This is true if we are hard bound to corelib. This enables various forms of generics dumping and MT
//dumping that require g_pObjectClass to be set.
- bool m_isMscorlibHardBound;
+ bool m_isCoreLibHardBound;
#if 0
PTR_CCOR_SIGNATURE metadataToHostDAC( PCCOR_SIGNATURE pSig,
OBJECTREF value = pResolver->GetManagedResolver();
if (value)
{
- FieldDesc *pField = (&g_Mscorlib)->GetField(FIELD__DYNAMICRESOLVER__DYNAMIC_METHOD);
+ FieldDesc *pField = (&g_CoreLib)->GetField(FIELD__DYNAMICRESOLVER__DYNAMIC_METHOD);
_ASSERTE(pField);
value = pField->GetRefValue(value);
if (value)
// XXX Microsoft - Sometimes types can't be looked
// up and this at least allows the value to be used,
// but is it the right behavior?
- argType = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_U8));
+ argType = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_U8));
valueFlags = 0;
}
else
// Determining if something is a VC or not can involve asking the EE.
// We could do it ourselves based on the metadata but it's non-trivial
// determining if a class has System.ValueType as a parent (we have
- // to find and OpenScope the mscorlib.dll which we don't currently do
+ // to find and OpenScope the System.Private.CoreLib.dll which we don't currently do
// on the right-side). But the IsValueClass call can fail if the
// class is not yet loaded on the right side. In that case we
// ignore the failure and return ELEMENT_TYPE_CLASS
if (pModule == SystemDomain::SystemModule())
{
- // We don't look up PDBs for mscorlib. This is not quite right, but avoids
+ // We don't look up PDBs for CoreLib. This is not quite right, but avoids
// a bootstrapping problem. When an EXE loads, it has the option of setting
// the COM apartment model to STA if we need to. It is important that no
// other Coinitialize happens before this. Since loading the PDB reader uses
// com we can not come first. However managed code IS run before the COM
// apartment model is set, and thus we have a problem since this code is
// called for when JITTing managed code. We avoid the problem by just
- // bailing for mscorlib.
+ // bailing for CoreLib.
return;
}
#endif
// DomainFile is a base-class for a CLR module, with app-domain affinity.
-// For domain-neutral modules (like mscorlib), there is a DomainFile instance
+// For domain-neutral modules (like CoreLib), there is a DomainFile instance
// for each appdomain the module lives in.
// This is the canonical handle ICorDebug uses to a CLR module.
DEFINE_VMPTR(class DomainFile, PTR_DomainFile, VMPTR_DomainFile);
}
#if defined(CROSSGEN_COMPILE)
-void SetMscorlibPath(LPCWSTR wzSystemDirectory)
+void SetCoreLibPath(LPCWSTR wzSystemDirectory)
{
DWORD len = (DWORD)wcslen(wzSystemDirectory);
bool appendSeparator = wzSystemDirectory[len-1] != DIRECTORY_SEPARATOR_CHAR_W;
* They are currently used for EnC for adding new field members to existing instantiations under EnC modes where
* the primary object is the original instantiation and the secondary represents the added field.
*
- * They are also used to implement the ConditionalWeakTable class in mscorlib.dll. If you want to use
+ * They are also used to implement the managed ConditionalWeakTable class. If you want to use
* these from managed code, they are exposed to BCL through the managed DependentHandle class.
*
*
/*
===========================================================================
- BCL routines. These are routines that are directly exposed by mscorlib
+ BCL routines. These are routines that are directly exposed by CoreLib
as a part of the `System.GC` class. These routines behave in the same
manner as the functions on `System.GC`.
===========================================================================
virtual int GetGcLatencyMode() = 0;
// Sets the current GC latency mode. newLatencyMode has already been
- // verified by mscorlib to be valid.
+ // verified by CoreLib to be valid.
virtual int SetGcLatencyMode(int newLatencyMode) = 0;
// Gets the current LOH compaction mode.
virtual int GetLOHCompactionMode() = 0;
// Sets the current LOH compaction mode. newLOHCompactionMode has
- // already been verified by mscorlib to be valid.
+ // already been verified by CoreLib to be valid.
virtual void SetLOHCompactionMode(int newLOHCompactionMode) = 0;
// Registers for a full GC notification, raising a notification if the gen 2 or
// So, the host must call StartupAsCompilationProcess before compiling
// any code, and Shutdown after finishing.
//
- // The arguments control which native image of mscorlib to use.
+ // The arguments control which native image of CoreLib to use.
// This matters for hardbinding.
//
mdFieldDef *token
) = 0;
- // Get the loader module for mscorlib
- virtual CORINFO_MODULE_HANDLE GetLoaderModuleForMscorlib() = 0;
+ // Get the loader module for CoreLib
+ virtual CORINFO_MODULE_HANDLE GetLoaderModuleForCoreLib() = 0;
// Get the loader module for a type (where the type is regarded as
// living for the purposes of loading, unloading, and ngen).
* Assembly interface
* An ICorDebugAssembly instance corresponds to a a managed assembly loaded
* into a specific AppDomain in the CLR. For assemblies shared between multiple
- * AppDomains (eg. mscorlib), there will be a separate ICorDebugAssembly instance
+ * AppDomains (eg. CoreLib), there will be a separate ICorDebugAssembly instance
* per AppDomain in which it is used.
* ------------------------------------------------------------------------- */
[
* specific AppDomain. Normally this is an executable or a DLL, but it may also be
* some other file of a multi-module assembly. There is an ICorDebugModule instance
* for each AppDomain a module is loaded into, even in the case of shared modules like
- * mscorlib.
+ * CoreLib.
*/
[
<Comment> File is PE32 </Comment>
</HRESULT>
-<HRESULT NumericValue="0x80131f06">
- <SymbolicName>NGEN_E_SYS_ASM_NI_MISSING</SymbolicName>
- <Message>"NGen cannot proceed because Mscorlib.dll does not have a native image"</Message>
- <Comment>Compiling any assembly other than mscorlib in the absence of mscorlib.ni.dll is not allowed.</Comment>
-</HRESULT>
-
<HRESULT NumericValue="0x80131fff">
<SymbolicName>CLDB_E_INTERNALERROR</SymbolicName>
</HRESULT>
<HRESULT NumericValue="0x80132006">
<SymbolicName>CLR_E_BIND_SYS_ASM_NI_MISSING</SymbolicName>
- <Message>"Could not use native image because Mscorlib.dll is missing a native image"</Message>
- <Comment>Returned when loading an assembly that only has a native image and no IL and cannot hardbind to mscorlib.ni.dll.</Comment>
+ <Message>"Could not use native image because System.Private.CoreLib.dll is missing a native image"</Message>
+ <Comment>Returned when loading an assembly that only has a native image and no IL and cannot hardbind to System.Private.CoreLib.ni.dll.</Comment>
</HRESULT>
<HRESULT NumericValue="0x80132007">
// All COM+ exceptions are expressed as a RaiseException with this exception
// code. If you change this value, you must also change
-// mscorlib\src\system\Exception.cs's _COMPlusExceptionCode value.
+// Exception.cs's _COMPlusExceptionCode value.
#define EXCEPTION_MSVC 0xe06d7363 // 0xe0000000 | 'msc'
// where the encoding/decoding takes place.
ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d,
- ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for [mscorlib]System.__Canon
+ ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for System.__Canon
ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id#
} CorElementTypeZapSig;
DEFINE_DACVAR(ULONG, PTR_EEConfig, dac__g_pConfig, ::g_pConfig)
-DEFINE_DACVAR(ULONG, MscorlibBinder, dac__g_Mscorlib, ::g_Mscorlib)
+DEFINE_DACVAR(ULONG, CoreLibBinder, dac__g_CoreLib, ::g_CoreLib)
#if defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)
DEFINE_DACVAR(ULONG, ProfControlBlock, dac__g_profControlBlock, ::g_profControlBlock)
//
//
-// Defines a random number generator, initially from the System.Random code in the BCL. If you notice any problems,
-// please compare to the implementation in src\mscorlib\src\system\random.cs.
+// Defines a random number generator, initially from the System.Random code in the BCL.
//
// Main advantages over rand() are:
//
~Zapper();
- // The arguments control which native image of mscorlib to use.
+ // The arguments control which native image of CoreLib to use.
// This matters for hardbinding.
void InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument);
void LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT ICorJitCompiler** ppICorJitCompiler);
// - Generate fully interruptible code for loops that contains calls
// - Generate fully interruptible code for leaf methods
//
- // Given the limited benefit from this optimization (<10k for mscorlib NGen image), the extra complexity
+ // Given the limited benefit from this optimization (<10k for CoreLib NGen image), the extra complexity
// is not worth it.
//
rsPushRegs |= RBM_LR; // We must save the return address (in the LR register)
{
#if 0
// Switching between size & speed has measurable throughput impact
- // (3.5% on NGen mscorlib when measured). It used to be enabled for
+ // (3.5% on NGen CoreLib when measured). It used to be enabled for
// DEBUG, but should generate identical code between CHK & RET builds,
// so that's not acceptable.
// TODO-Throughput: Figure out what to do about size vs. speed & throughput.
return true;
}
- // TODO-CQ: there are a bunch of managed methods in [mscorlib]System.ThrowHelper
+ // TODO-CQ: there are a bunch of managed methods in System.ThrowHelper
// that would be nice to recognize.
return false;
// If this is a call to JitTestLabel.Mark, do "early inlining", and record the test attribute.
// This recognition should really be done by knowing the methHnd of the relevant Mark method(s).
- // These should be in mscorlib.h, and available through a JIT/EE interface call.
+ // These should be in corelib.h, and available through a JIT/EE interface call.
const char* modName;
const char* className;
const char* methodName;
// Root context will be null if we're not optimizing the method.
//
- // Note there are cases of this in mscorlib even in release builds,
+ // Note there are cases of this in System.Private.CoreLib even in release builds,
// eg Task.NotifyDebuggerOfWaitCompletion.
//
// For such methods there aren't any inlines.
// 0.100 * m_CalleeNativeSizeEstimate +
// -0.100 * m_CallsiteNativeSizeEstimate
//
-// On the inlines in CoreCLR's mscorlib, release windows x64, this
+// On the inlines in CoreCLR's CoreLib, release windows x64, this
// yields scores of R=0.42, MSE=228, and MAE=7.25.
//
// This estimate can be improved slighly by refitting, resulting in
*
* TODO-XArch-CQ: (Low-pri): Jit64 generates in-line code of 8 instructions for (i) above.
* There are hardly any occurrences of this conversion operation in platform
- * assemblies or in CQ perf benchmarks (1 occurrence in mscorlib, microsoft.jscript,
+ * assemblies or in CQ perf benchmarks (1 occurrence in corelib, microsoft.jscript,
* 1 occurence in Roslyn and no occurrences in system, system.core, system.numerics
* system.windows.forms, scimark, fractals, bio mums). If we ever find evidence that
* doing this optimization is a win, should consider generating in-lined code.
We still report all the arguments at the very start of the method so that
the user can see the arguments at the very start of the method (offset=0).
- Disabling this decreased the debug maps in mscorlib by 10% (01/2003)
+ Disabling this decreased the debug maps in CoreLib by 10% (01/2003)
*/
#if 0
// - SSA doesn't allow a single node to contain multiple SSA definitions.
// - and PROMOTION_TYPE_DEPENDEDNT fields are never candidates for a register.
//
- // Example mscorlib method: CompatibilitySwitches:IsCompatibilitySwitchSet
- //
return false;
}
else if (varDsc->lvIsStructField && m_pCompiler->lvaGetDesc(varDsc->lvParentLcl)->lvIsMultiRegRet)
class UnwindPrologCodes : public UnwindBase, public UnwindCodesBase
{
- // UPC_LOCAL_COUNT is the amount of memory local to this class. For ARM mscorlib.dll, the maximum size is 34.
+ // UPC_LOCAL_COUNT is the amount of memory local to this class. For ARM CoreLib, the maximum size is 34.
// Here is a histogram of other interesting sizes:
// <=16 79%
// <=24 96%
class UnwindEpilogCodes : public UnwindBase, public UnwindCodesBase
{
- // UEC_LOCAL_COUNT is the amount of memory local to this class. For ARM mscorlib.dll, the maximum size is 6,
+ // UEC_LOCAL_COUNT is the amount of memory local to this class. For ARM CoreLib, the maximum size is 6,
// while 89% of epilogs fit in 4. So, set it to 4 to maintain array alignment and hit most cases.
static const int UEC_LOCAL_COUNT = 4;
MSG_FOR_URT_HR(CORDBG_E_UNSUPPORTED_DELEGATE) "The delegate contains a delegate currently not supported by the API."
MSG_FOR_URT_HR(PEFMT_E_64BIT) "File is PE32+."
MSG_FOR_URT_HR(PEFMT_E_32BIT) "File is PE32"
- MSG_FOR_URT_HR(NGEN_E_SYS_ASM_NI_MISSING) "NGen cannot proceed because Mscorlib.dll does not have a native image"
MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW) "The bound assembly has a version that is lower than that of the request."
MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH) "The assembly version has a public key token that does not match that of the request."
MSG_FOR_URT_HR(CLR_E_BIND_IMAGE_UNAVAILABLE) "The requested image was not found or is unavailable."
MSG_FOR_URT_HR(CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT) "The provided identity format is not recognized."
MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_NOT_FOUND) "A binding for the specified assembly name was not found."
MSG_FOR_URT_HR(CLR_E_BIND_TYPE_NOT_FOUND) "A binding for the specified type name was not found."
- MSG_FOR_URT_HR(CLR_E_BIND_SYS_ASM_NI_MISSING) "Could not use native image because Mscorlib.dll is missing a native image"
+ MSG_FOR_URT_HR(CLR_E_BIND_SYS_ASM_NI_MISSING) "Could not use native image because System.Private.CoreLib.dll is missing a native image"
MSG_FOR_URT_HR(CLR_E_BIND_NI_SECURITY_FAILURE) "Native image was generated in a different trust level than present at runtime"
MSG_FOR_URT_HR(CLR_E_BIND_NI_DEP_IDENTITY_MISMATCH) "Native image identity mismatch with respect to its dependencies"
MSG_FOR_URT_HR(CLR_E_GC_OOM) "Failfast due to an OOM during a GC"
#define CORDBG_E_UNSUPPORTED_DELEGATE EMAKEHR(0x1c68)
#define PEFMT_E_64BIT EMAKEHR(0x1d02)
#define PEFMT_E_32BIT EMAKEHR(0x1d0b)
-#define NGEN_E_SYS_ASM_NI_MISSING EMAKEHR(0x1f06)
#define CLDB_E_INTERNALERROR EMAKEHR(0x1fff)
#define CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW EMAKEHR(0x2000)
#define CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH EMAKEHR(0x2001)
unicode/utf8.c
Abstract:
- Functions to encode and decode UTF-8 strings. This is a port of the C# version from mscorlib.
+ Functions to encode and decode UTF-8 strings. This is a port of the C# version from Utf8Encoding.cs.
Revision History:
//#include "stdafx.h"
#include "resultbuffer.h"
-//
-//#using <mscorlib.dll>
-//
-//using namespace System;
-
ResultBuffer:: ResultBuffer(int ThreadCount, int ThreadLogSize)
{
//#include "stdafx.h"
#include "resultbuffer.h"
-//
-//#using <mscorlib.dll>
-//
-//using namespace System;
-
ResultBuffer:: ResultBuffer(int ThreadCount, int ThreadLogSize)
{
//#include "stdafx.h"
#include "resultbuffer.h"
-//
-//#using <mscorlib.dll>
-//
-//using namespace System;
-
ResultBuffer:: ResultBuffer(int ThreadCount, int ThreadLogSize)
{
// where the encoding/decoding takes place.
ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d,
- ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for [mscorlib]System.__Canon
+ ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for System.__Canon
ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id#
ELEMENT_TYPE_HANDLE = 64,
//
// Ordinary volatile loads and stores only guarantee atomicity for pointer-sized (or smaller) data.
// So, on 32-bit platforms we must use Interlocked operations instead for the 64-bit types.
- // The implementation in mscorlib already does this, so we will only substitute a new
+ // The implementation in CoreLib already does this, so we will only substitute a new
// IL body if we're running on a 64-bit platform.
//
case TypeFlags.Int64 when method.Context.Target.PointerSize == 8:
${CLRJIT_CROSSGEN}
gcinfo_crossgen
corzap_crossgen
- mscorlib_crossgen
+ corelib_crossgen
utilcode_crossgen
)
STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzDiasymreaderPath);
STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, SIZE_T customBaseAddress=0, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr);
void SetSvcLogger(ICorSvcLogger *pCorSvcLogger);
-void SetMscorlibPath(LPCWSTR wzSystemDirectory);
+void SetCoreLibPath(LPCWSTR wzSystemDirectory);
/* --------------------------------------------------------------------------- *
* Console stuff
// When using the Phone binding model (TrustedPlatformAssemblies), automatically
// detect which path CoreLib.[ni.]dll lies in.
//
-bool ComputeMscorlibPathFromTrustedPlatformAssemblies(SString& pwzMscorlibPath, LPCWSTR pwzTrustedPlatformAssemblies)
+bool ComputeCoreLibPathFromTrustedPlatformAssemblies(SString& pwzCoreLibPath, LPCWSTR pwzTrustedPlatformAssemblies)
{
LPWSTR wszTrustedPathCopy = new WCHAR[wcslen(pwzTrustedPlatformAssemblies) + 1];
wcscpy_s(wszTrustedPathCopy, wcslen(pwzTrustedPlatformAssemblies) + 1, pwzTrustedPlatformAssemblies);
if (StringEndsWith(wszSingleTrustedPath, DIRECTORY_SEPARATOR_STR_W CoreLibName_IL_W) ||
StringEndsWith(wszSingleTrustedPath, DIRECTORY_SEPARATOR_STR_W CoreLibName_NI_W))
{
- pwzMscorlibPath.Set(wszSingleTrustedPath);
- SString::Iterator pwzSeparator = pwzMscorlibPath.End();
+ pwzCoreLibPath.Set(wszSingleTrustedPath);
+ SString::Iterator pwzSeparator = pwzCoreLibPath.End();
bool retval = true;
- if (!SUCCEEDED(CopySystemDirectory(pwzMscorlibPath, pwzMscorlibPath)))
+ if (!SUCCEEDED(CopySystemDirectory(pwzCoreLibPath, pwzCoreLibPath)))
{
retval = false;
}
// No NIs are supported when creating NI images (other than NI of System.Private.CoreLib.dll).
if (!fCreatePDB)
{
- // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-mscorlib assemblies.
+ // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-CoreLib assemblies.
if (StringEndsWith((LPWSTR)pwszFilename, W(".ni.dll")))
{
fAddFileToTPAList = false;
if (pwzTrustedPlatformAssemblies != nullptr)
{
- if (ComputeMscorlibPathFromTrustedPlatformAssemblies(wzTrustedPathRoot, pwzTrustedPlatformAssemblies))
+ if (ComputeCoreLibPathFromTrustedPlatformAssemblies(wzTrustedPathRoot, pwzTrustedPlatformAssemblies))
{
pwzPlatformAssembliesPaths = wzTrustedPathRoot.GetUnicode();
- SetMscorlibPath(pwzPlatformAssembliesPaths);
+ SetCoreLibPath(pwzPlatformAssembliesPaths);
}
}
comthreadpool.cpp
comutilnative.cpp
comwaithandle.cpp
+ corelib.cpp # <DisablePrecompiledHeaders>true</DisablePrecompiledHeaders>
customattribute.cpp
custommarshalerinfo.cpp
autotrace.cpp
marshalnative.cpp
methodtablebuilder.cpp
mlinfo.cpp
- mscorlib.cpp # <DisablePrecompiledHeaders>true</DisablePrecompiledHeaders>
multicorejit.cpp # Condition="'$(FeatureMulticoreJIT)' == 'true'
multicorejitplayer.cpp # Condition="'$(FeatureMulticoreJIT)' == 'true'
nativeeventsource.cpp
marshalnative.h
methodtablebuilder.h
mlinfo.h
- mscorlib.h
+ corelib.h
multicorejit.h
multicorejitimpl.h
nativeeventsource.h
#define DELEGATE_FIELD_OFFSET__METHOD_AUX 0x20
ASMCONSTANTS_RUNTIME_ASSERT(DELEGATE_FIELD_OFFSET__METHOD_AUX == Object::GetOffsetOfFirstField() +
- MscorlibBinder::GetFieldOffset(FIELD__DELEGATE__METHOD_PTR_AUX));
+ CoreLibBinder::GetFieldOffset(FIELD__DELEGATE__METHOD_PTR_AUX));
#define ASM_LARGE_OBJECT_SIZE 85000
if (!m_hndMissing)
{
// Get the field
- FieldDesc *pValueFD = MscorlibBinder::GetField(FIELD__MISSING__VALUE);
+ FieldDesc *pValueFD = CoreLibBinder::GetField(FIELD__MISSING__VALUE);
pValueFD->CheckRunClassInitThrowing();
DWORD size = 0;
- // Get the install directory so we can find mscorlib
+ // Get the install directory so we can find CoreLib
hr = GetInternalSystemDirectory(NULL, &size);
if (hr != HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER))
ThrowHR(hr);
}
#endif
- // Finish loading mscorlib now.
+ // Finish loading CoreLib now.
m_pSystemAssembly->GetDomainAssembly()->EnsureActive();
}
// the globals in this function before finishing the load.
m_pSystemAssembly = DefaultDomain()->LoadDomainAssembly(NULL, m_pSystemFile, FILE_LOAD_POST_LOADLIBRARY)->GetCurrentAssembly();
- // Set up binder for mscorlib
- MscorlibBinder::AttachModule(m_pSystemAssembly->GetManifestModule());
+ // Set up binder for CoreLib
+ CoreLibBinder::AttachModule(m_pSystemAssembly->GetManifestModule());
// Load Object
- g_pObjectClass = MscorlibBinder::GetClass(CLASS__OBJECT);
+ g_pObjectClass = CoreLibBinder::GetClass(CLASS__OBJECT);
// Now that ObjectClass is loaded, we can set up
// the system for finalizers. There is no point in deferring this, since we need
// to know this before we allocate our first object.
- g_pObjectFinalizerMD = MscorlibBinder::GetMethod(METHOD__OBJECT__FINALIZE);
+ g_pObjectFinalizerMD = CoreLibBinder::GetMethod(METHOD__OBJECT__FINALIZE);
- g_pCanonMethodTableClass = MscorlibBinder::GetClass(CLASS____CANON);
+ g_pCanonMethodTableClass = CoreLibBinder::GetClass(CLASS____CANON);
// NOTE: !!!IMPORTANT!!! ValueType and Enum MUST be loaded one immediately after
// the other, because we have coded MethodTable::IsChildValueType
// in such a way that it depends on this behaviour.
// Load the ValueType class
- g_pValueTypeClass = MscorlibBinder::GetClass(CLASS__VALUE_TYPE);
+ g_pValueTypeClass = CoreLibBinder::GetClass(CLASS__VALUE_TYPE);
// Load the enum class
- g_pEnumClass = MscorlibBinder::GetClass(CLASS__ENUM);
+ g_pEnumClass = CoreLibBinder::GetClass(CLASS__ENUM);
_ASSERTE(!g_pEnumClass->IsValueType());
// Load System.RuntimeType
- g_pRuntimeTypeClass = MscorlibBinder::GetClass(CLASS__CLASS);
+ g_pRuntimeTypeClass = CoreLibBinder::GetClass(CLASS__CLASS);
_ASSERTE(g_pRuntimeTypeClass->IsFullyLoaded());
// Load Array class
- g_pArrayClass = MscorlibBinder::GetClass(CLASS__ARRAY);
+ 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
// the corresponding method on SZArrayHelper. This basically results in a class
// load due to a method call, which the debugger cannot handle, so we pre-load
// the SZArrayHelper class here.
- g_pSZArrayHelperClass = MscorlibBinder::GetClass(CLASS__SZARRAYHELPER);
+ g_pSZArrayHelperClass = CoreLibBinder::GetClass(CLASS__SZARRAYHELPER);
// Load ByReference class
//
// NOTE: ByReference<T> must be the first by-ref-like system type to be loaded,
// because MethodTable::ClassifyEightBytesWithManagedLayout depends on it.
- g_pByReferenceClass = MscorlibBinder::GetClass(CLASS__BYREFERENCE);
+ g_pByReferenceClass = CoreLibBinder::GetClass(CLASS__BYREFERENCE);
// Load Nullable class
- g_pNullableClass = MscorlibBinder::GetClass(CLASS__NULLABLE);
+ 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 mscorlib's static handles until we load the object class
- MscorlibBinder::GetModule()->AllocateRegularStaticHandles(DefaultDomain());
+ // 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++)
- MscorlibBinder::LoadPrimitiveType((CorElementType)et);
+ CoreLibBinder::LoadPrimitiveType((CorElementType)et);
- MscorlibBinder::LoadPrimitiveType(ELEMENT_TYPE_I);
- MscorlibBinder::LoadPrimitiveType(ELEMENT_TYPE_U);
+ CoreLibBinder::LoadPrimitiveType(ELEMENT_TYPE_I);
+ CoreLibBinder::LoadPrimitiveType(ELEMENT_TYPE_U);
- g_TypedReferenceMT = MscorlibBinder::GetClass(CLASS__TYPED_REFERENCE);
+ g_TypedReferenceMT = CoreLibBinder::GetClass(CLASS__TYPED_REFERENCE);
// unfortunately, the following cannot be delay loaded since the jit
// uses it to compute method attributes within a function that cannot
// where a complus exception can be thrown. It is unfortunate, because
// we know that the delegate class and multidelegate class are always
// guaranteed to be found.
- g_pDelegateClass = MscorlibBinder::GetClass(CLASS__DELEGATE);
- g_pMulticastDelegateClass = MscorlibBinder::GetClass(CLASS__MULTICAST_DELEGATE);
+ g_pDelegateClass = CoreLibBinder::GetClass(CLASS__DELEGATE);
+ g_pMulticastDelegateClass = CoreLibBinder::GetClass(CLASS__MULTICAST_DELEGATE);
#ifndef CROSSGEN_COMPILE
CrossLoaderAllocatorHashSetup::EnsureTypesLoaded();
#endif // CROSSGEN_COMPILE
// used by IsImplicitInterfaceOfSZArray
- MscorlibBinder::GetClass(CLASS__IENUMERABLEGENERIC);
- MscorlibBinder::GetClass(CLASS__ICOLLECTIONGENERIC);
- MscorlibBinder::GetClass(CLASS__ILISTGENERIC);
- MscorlibBinder::GetClass(CLASS__IREADONLYCOLLECTIONGENERIC);
- MscorlibBinder::GetClass(CLASS__IREADONLYLISTGENERIC);
+ CoreLibBinder::GetClass(CLASS__IENUMERABLEGENERIC);
+ CoreLibBinder::GetClass(CLASS__ICOLLECTIONGENERIC);
+ CoreLibBinder::GetClass(CLASS__ILISTGENERIC);
+ CoreLibBinder::GetClass(CLASS__IREADONLYCOLLECTIONGENERIC);
+ CoreLibBinder::GetClass(CLASS__IREADONLYLISTGENERIC);
// Load String
- g_pStringClass = MscorlibBinder::LoadPrimitiveType(ELEMENT_TYPE_STRING);
+ g_pStringClass = CoreLibBinder::LoadPrimitiveType(ELEMENT_TYPE_STRING);
#ifdef FEATURE_UTF8STRING
// Load Utf8String
- g_pUtf8StringClass = MscorlibBinder::GetClass(CLASS__UTF8_STRING);
+ g_pUtf8StringClass = CoreLibBinder::GetClass(CLASS__UTF8_STRING);
#endif // FEATURE_UTF8STRING
#ifndef CROSSGEN_COMPILE
ECall::PopulateManagedStringConstructors();
#endif // CROSSGEN_COMPILE
- g_pExceptionClass = MscorlibBinder::GetClass(CLASS__EXCEPTION);
- g_pOutOfMemoryExceptionClass = MscorlibBinder::GetException(kOutOfMemoryException);
- g_pStackOverflowExceptionClass = MscorlibBinder::GetException(kStackOverflowException);
- g_pExecutionEngineExceptionClass = MscorlibBinder::GetException(kExecutionEngineException);
- g_pThreadAbortExceptionClass = MscorlibBinder::GetException(kThreadAbortException);
+ g_pExceptionClass = CoreLibBinder::GetClass(CLASS__EXCEPTION);
+ g_pOutOfMemoryExceptionClass = CoreLibBinder::GetException(kOutOfMemoryException);
+ g_pStackOverflowExceptionClass = CoreLibBinder::GetException(kStackOverflowException);
+ g_pExecutionEngineExceptionClass = CoreLibBinder::GetException(kExecutionEngineException);
+ g_pThreadAbortExceptionClass = CoreLibBinder::GetException(kThreadAbortException);
- g_pThreadClass = MscorlibBinder::GetClass(CLASS__THREAD);
+ g_pThreadClass = CoreLibBinder::GetClass(CLASS__THREAD);
#ifdef FEATURE_COMINTEROP
- g_pBaseCOMObject = MscorlibBinder::GetClass(CLASS__COM_OBJECT);
+ g_pBaseCOMObject = CoreLibBinder::GetClass(CLASS__COM_OBJECT);
#endif
- g_pIDynamicInterfaceCastableInterface = MscorlibBinder::GetClass(CLASS__IDYNAMICINTERFACECASTABLE);
+ g_pIDynamicInterfaceCastableInterface = CoreLibBinder::GetClass(CLASS__IDYNAMICINTERFACECASTABLE);
#ifdef FEATURE_ICASTABLE
- g_pICastableInterface = MscorlibBinder::GetClass(CLASS__ICASTABLE);
+ g_pICastableInterface = CoreLibBinder::GetClass(CLASS__ICASTABLE);
#endif // FEATURE_ICASTABLE
// Make sure that FCall mapping for Monitor.Enter is initialized. We need it in case Monitor.Enter is used only as JIT helper.
// For more details, see comment in code:JITutil_MonEnterWorker around "__me = GetEEFuncEntryPointMacro(JIT_MonEnter)".
- ECall::GetFCallImpl(MscorlibBinder::GetMethod(METHOD__MONITOR__ENTER));
+ ECall::GetFCallImpl(CoreLibBinder::GetMethod(METHOD__MONITOR__ENTER));
#ifdef PROFILING_SUPPORTED
// Note that g_profControlBlock.fBaseSystemClassesLoaded must be set to TRUE only after
#if defined(_DEBUG) && !defined(CROSSGEN_COMPILE)
if (!NingenEnabled())
{
- g_Mscorlib.Check();
+ g_CoreLib.Check();
}
#endif
if (GCStress<cfg_instr_ngen>::IsEnabled())
{
// Setting up gc coverage requires the base system classes
- // to be initialized. So we have deferred it until now for mscorlib.
- Module *pModule = MscorlibBinder::GetModule();
+ // to be initialized. So we have deferred it until now for CoreLib.
+ Module *pModule = CoreLibBinder::GetModule();
_ASSERTE(pModule->IsSystem());
if(pModule->HasNativeImage())
{
MethodTable* pCaller = pMeth->GetMethodTable();
- // All Reflection Invocation methods are defined in mscorlib.dll
+ // All Reflection Invocation methods are defined in CoreLib
if (!pCaller->GetModule()->IsSystem())
return false;
// Make sure all types are loaded so that we can use faster GetExistingClass()
for (unsigned i = 0; i < NumItems(reflectionInvocationTypes); i++)
{
- MscorlibBinder::GetClass(reflectionInvocationTypes[i]);
+ CoreLibBinder::GetClass(reflectionInvocationTypes[i]);
}
VolatileStore(&fInited, true);
{
for (unsigned i = 0; i < NumItems(reflectionInvocationTypes); i++)
{
- if (MscorlibBinder::GetExistingClass(reflectionInvocationTypes[i]) == pCaller)
+ if (CoreLibBinder::GetExistingClass(reflectionInvocationTypes[i]) == pCaller)
return true;
}
}
// Skipping reflection frames. We don't need to be quite as exhaustive here
// as the security or reflection stack walking code since we know this logic
- // is only invoked for selected methods in mscorlib itself. So we're
+ // is only invoked for selected methods in CoreLib itself. So we're
// reasonably sure we won't have any sensitive methods late bound invoked on
// constructors, properties or events. This leaves being invoked via
// MethodInfo, Type or Delegate (and depending on which invoke overload is
// Make sure we release the lock on exit
FileLoadLockRefHolder lockRef(pLock);
- // We need to perform the early steps of loading mscorlib without a domain transition. This is
- // important for bootstrapping purposes - we need to get mscorlib at least partially loaded
+ // We need to perform the early steps of loading CoreLib without a domain transition. This is
+ // important for bootstrapping purposes - we need to get CoreLib at least partially loaded
// into a domain before we can run serialization code to do the transition.
//
// Note that we cannot do this in general for all assemblies, because some of the security computations
// Because we are allocating/referencing objects, need to be in cooperative mode
GCX_COOP();
- DomainLocalModule *pLocalModule = MscorlibBinder::GetModule()->GetDomainLocalModule();
+ DomainLocalModule *pLocalModule = CoreLibBinder::GetModule()->GetDomainLocalModule();
// This is a convenient place to initialize String.Empty.
// It is treated as intrinsic by the JIT as so the static constructor would never run.
// String should not have any static constructors.
_ASSERTE(g_pStringClass->IsClassPreInited());
- FieldDesc * pEmptyStringFD = MscorlibBinder::GetField(FIELD__STRING__EMPTY);
+ FieldDesc * pEmptyStringFD = CoreLibBinder::GetField(FIELD__STRING__EMPTY);
OBJECTREF* pEmptyStringHandle = (OBJECTREF*)
((TADDR)pLocalModule->GetPrecomputedGCStaticsBasePointer()+pEmptyStringFD->GetOffset());
SetObjectReference( pEmptyStringHandle, StringObject::GetEmptyString());
{
WRAPPER_NO_CONTRACT;
- // Check to see if this fits our rather loose idea of a reference to mscorlib.
+ // Check to see if this fits our rather loose idea of a reference to CoreLib.
// If so, don't use fusion to bind it - do it ourselves.
- if (pSpec->IsMscorlib())
+ if (pSpec->IsCoreLib())
return TRUE;
return m_AssemblyCache.Contains(pSpec);
}
CONTRACTL_END;
- // Check to see if this fits our rather loose idea of a reference to mscorlib.
+ // Check to see if this fits our rather loose idea of a reference to CoreLib.
// If so, don't use fusion to bind it - do it ourselves.
- if (fThrow && pSpec->IsMscorlib())
+ if (fThrow && pSpec->IsCoreLib())
{
CONSISTENCY_CHECK(SystemDomain::System()->SystemAssembly() != NULL);
PEAssembly *pFile = SystemDomain::System()->SystemFile();
if (bindResult.Found())
{
- if (SystemDomain::SystemFile() && bindResult.IsMscorlib())
+ if (SystemDomain::SystemFile() && bindResult.IsCoreLib())
{
- // Avoid rebinding to another copy of mscorlib
+ // Avoid rebinding to another copy of CoreLib
result = SystemDomain::SystemFile();
result.SuppressRelease(); // Didn't get a refcount
}
else
{
- // IsSystem on the PEFile should be false, even for mscorlib satellites
+ // IsSystem on the PEFile should be false, even for CoreLib satellites
result = PEAssembly::Open(&bindResult,
FALSE);
}
// return an assembly that does not match, and this can cause recursive resource lookups during error
// reporting. The CoreLib satellite assembly is loaded from relative locations based on the culture, see
// AssemblySpec::Bind().
- if (!pSpec->IsMscorlibSatellite())
+ if (!pSpec->IsCoreLibSatellite())
{
// Trigger the resolve event also for non-throw situation.
AssemblySpec NewSpec(this);
EX_TRY
{
- if (MscorlibBinder::GetField(FIELD__ASSEMBLYLOADCONTEXT__ASSEMBLY_LOAD)->GetStaticOBJECTREF() != NULL)
+ if (CoreLibBinder::GetField(FIELD__ASSEMBLYLOADCONTEXT__ASSEMBLY_LOAD)->GetStaticOBJECTREF() != NULL)
{
struct _gc {
OBJECTREF orThis;
_ASSERTE(this == GetThread()->GetDomain());
- OBJECTREF orDelegate = MscorlibBinder::GetField(FIELD__APPCONTEXT__UNHANDLED_EXCEPTION)->GetStaticOBJECTREF();
+ OBJECTREF orDelegate = CoreLibBinder::GetField(FIELD__APPCONTEXT__UNHANDLED_EXCEPTION)->GetStaticOBJECTREF();
if (orDelegate == NULL)
return FALSE;
BinderTracing::ResolutionAttemptedOperation tracer{pAssemblyName, 0 /*binderID*/, pManagedAssemblyLoadContextToBindWithin, hr};
// Allocate an AssemblyName managed object
- _gcRefs.oRefAssemblyName = (ASSEMBLYNAMEREF) AllocateObject(MscorlibBinder::GetClass(CLASS__ASSEMBLY_NAME));
+ _gcRefs.oRefAssemblyName = (ASSEMBLYNAMEREF) AllocateObject(CoreLibBinder::GetClass(CLASS__ASSEMBLY_NAME));
// Initialize the AssemblyName object from the AssemblySpec
spec.AssemblyNameInit(&_gcRefs.oRefAssemblyName, NULL);
#endif // DACCESS_COMPILE
//****************************************************************************************
- // Routines to deal with the base library (currently mscorlib.dll)
LPCWSTR BaseLibrary()
{
WRAPPER_NO_CONTRACT;
{
WRAPPER_NO_CONTRACT;
- // See if it is the installation path to mscorlib
+ // See if it is the installation path to CoreLib
if (path.EqualsCaseInsensitive(m_BaseLibrary))
return TRUE;
- // Or, it might be the GAC location of mscorlib
+ // Or, it might be the GAC location of CoreLib
if (System()->SystemAssembly() != NULL
&& path.EqualsCaseInsensitive(System()->SystemAssembly()->GetManifestFile()->GetPath()))
return TRUE;
{
WRAPPER_NO_CONTRACT;
- // See if it is the installation path to mscorlib.resources
+ // See if it is the installation path to corelib.resources
SString s(SString::Ascii,g_psBaseLibrarySatelliteAssemblyName);
if (path.EqualsCaseInsensitive(s))
return TRUE;
#ifdef FEATURE_PREJIT
protected:
- // These flags let the correct native image of mscorlib to be loaded.
+ // These flags let the correct native image of CoreLib to be loaded.
// This is important for hardbinding to it
SVAL_DECL(BOOL, s_fForceDebug);
HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
- MethodTable * pAssemblyClass = MscorlibBinder::GetClass(CLASS__ASSEMBLY);
+ MethodTable * pAssemblyClass = CoreLibBinder::GetClass(CLASS__ASSEMBLY);
AppDomain * pApp = GetAppDomain();
DWORD dwTotalLocalNum = NewLocal(ELEMENT_TYPE_I4);
DWORD dwLengthLocalNum = NewLocal(ELEMENT_TYPE_I4);
- mdToken tokRawData = GetToken(MscorlibBinder::GetField(FIELD__RAW_DATA__DATA));
+ mdToken tokRawData = GetToken(CoreLibBinder::GetField(FIELD__RAW_DATA__DATA));
ILCodeLabel * pRangeExceptionLabel = NewCodeLabel();
ILCodeLabel * pRangeExceptionLabel1 = NewCodeLabel();
m_pCode->EmitLabel(pRangeExceptionLabel1); // Assumes that there is one "int" pushed on the stack
m_pCode->EmitPOP();
- mdToken tokIndexOutOfRangeCtorExcep = GetToken((MscorlibBinder::GetException(kIndexOutOfRangeException))->GetDefaultConstructor());
+ mdToken tokIndexOutOfRangeCtorExcep = GetToken((CoreLibBinder::GetException(kIndexOutOfRangeException))->GetDefaultConstructor());
m_pCode->EmitLabel(pRangeExceptionLabel);
m_pCode->EmitNEWOBJ(tokIndexOutOfRangeCtorExcep, 0);
m_pCode->EmitTHROW();
if(pTypeMismatchExceptionLabel != NULL)
{
- mdToken tokTypeMismatchExcepCtor = GetToken((MscorlibBinder::GetException(kArrayTypeMismatchException))->GetDefaultConstructor());
+ mdToken tokTypeMismatchExcepCtor = GetToken((CoreLibBinder::GetException(kArrayTypeMismatchException))->GetDefaultConstructor());
m_pCode->EmitLabel(pTypeMismatchExceptionLabel);
m_pCode->EmitNEWOBJ(tokTypeMismatchExcepCtor, 0);
PRECONDITION(pInterfaceMT->IsInterface());
PRECONDITION(pInterfaceMT->HasInstantiation());
- // Is target interface Anything<T> in mscorlib?
+ // Is target interface Anything<T> in CoreLib?
if (!pInterfaceMT->HasInstantiation() || !pInterfaceMT->GetModule()->IsSystem())
return FALSE;
unsigned rid = pInterfaceMT->GetTypeDefRid();
// Is target interface IList<T> or one of its ancestors, or IReadOnlyList<T>?
- return (rid == MscorlibBinder::GetExistingClass(CLASS__ILISTGENERIC)->GetTypeDefRid() ||
- rid == MscorlibBinder::GetExistingClass(CLASS__ICOLLECTIONGENERIC)->GetTypeDefRid() ||
- rid == MscorlibBinder::GetExistingClass(CLASS__IENUMERABLEGENERIC)->GetTypeDefRid() ||
- rid == MscorlibBinder::GetExistingClass(CLASS__IREADONLYCOLLECTIONGENERIC)->GetTypeDefRid() ||
- rid == MscorlibBinder::GetExistingClass(CLASS__IREADONLYLISTGENERIC)->GetTypeDefRid());
+ return (rid == CoreLibBinder::GetExistingClass(CLASS__ILISTGENERIC)->GetTypeDefRid() ||
+ rid == CoreLibBinder::GetExistingClass(CLASS__ICOLLECTIONGENERIC)->GetTypeDefRid() ||
+ rid == CoreLibBinder::GetExistingClass(CLASS__IENUMERABLEGENERIC)->GetTypeDefRid() ||
+ rid == CoreLibBinder::GetExistingClass(CLASS__IREADONLYCOLLECTIONGENERIC)->GetTypeDefRid() ||
+ rid == CoreLibBinder::GetExistingClass(CLASS__IREADONLYLISTGENERIC)->GetTypeDefRid());
}
//----------------------------------------------------------------------------------
unsigned int inheritanceDepth = pItfcMeth->GetMethodTable()->GetNumInterfaces() - 1;
PREFIX_ASSUME(0 <= inheritanceDepth && inheritanceDepth < NumItems(startingMethod));
- MethodDesc *pGenericImplementor = MscorlibBinder::GetMethod((BinderMethodID)(startingMethod[inheritanceDepth] + slot));
+ MethodDesc *pGenericImplementor = CoreLibBinder::GetMethod((BinderMethodID)(startingMethod[inheritanceDepth] + slot));
// The most common reason for this assert is that the order of the SZArrayHelper methods in
- // mscorlib.h does not match the order they are implemented on the generic interfaces.
+ // corelib.h does not match the order they are implemented on the generic interfaces.
_ASSERTE(pGenericImplementor == MemberLoader::FindMethodByName(g_pSZArrayHelperClass, pItfcMeth->GetName()));
// OPTIMIZATION: For any method other than GetEnumerator(), we can safely substitute
if (gc.filename->GetStringLength() == 0)
COMPlusThrow(kArgumentException, W("Argument_EmptyFileName"));
- gc.result = (ASSEMBLYNAMEREF) AllocateObject(MscorlibBinder::GetClass(CLASS__ASSEMBLY_NAME));
+ gc.result = (ASSEMBLYNAMEREF) AllocateObject(CoreLibBinder::GetClass(CLASS__ASSEMBLY_NAME));
///////////////////////////////////////////////
DWORD dwMessageID = IDS_EE_FILELOAD_ERROR_GENERIC;
- // Set the caller's assembly to be mscorlib
+ // Set the caller's assembly to be CoreLib
DomainAssembly *pCallersAssembly = SystemDomain::System()->SystemAssembly()->GetDomainAssembly();
PEAssembly *pParentAssembly = pCallersAssembly->GetFile();
GCPROTECT_BEGIN(orModules);
// Return the modules
- orModules = (PTRARRAYREF)AllocateObjectArray(modules.GetCount(), MscorlibBinder::GetClass(CLASS__MODULE));
+ orModules = (PTRARRAYREF)AllocateObjectArray(modules.GetCount(), CoreLibBinder::GetClass(CLASS__MODULE));
for(COUNT_T i = 0; i < modules.GetCount(); i++)
{
GCPROTECT_BEGIN(orTypes);
// Return the types
- orTypes = (PTRARRAYREF)AllocateObjectArray(types.GetCount(), MscorlibBinder::GetClass(CLASS__TYPE));
+ orTypes = (PTRARRAYREF)AllocateObjectArray(types.GetCount(), CoreLibBinder::GetClass(CLASS__TYPE));
for(COUNT_T i = 0; i < types.GetCount(); i++)
{
GCPROTECT_BEGIN(orTypes);
// Return the types
- orTypes = (PTRARRAYREF)AllocateObjectArray(types.GetCount(), MscorlibBinder::GetClass(CLASS__TYPE));
+ orTypes = (PTRARRAYREF)AllocateObjectArray(types.GetCount(), CoreLibBinder::GetClass(CLASS__TYPE));
for(COUNT_T i = 0; i < types.GetCount(); i++)
{
IMDInternalImport *pImport = pAssembly->GetAssembly()->GetManifestImport();
- MethodTable* pAsmNameClass = MscorlibBinder::GetClass(CLASS__ASSEMBLY_NAME);
+ MethodTable* pAsmNameClass = CoreLibBinder::GetClass(CLASS__ASSEMBLY_NAME);
HENUMInternalHolder phEnum(pImport);
DWORD dwCount = 0;
{
// We should aways having the binding context in the PEAssembly. The only exception to this are the following:
//
- // 1) when we are here during EEStartup and loading mscorlib.dll.
+ // 1) when we are here during EEStartup and loading CoreLib.
// 2) We are dealing with dynamic assemblies
_ASSERTE((pExpectedBinder != NULL) || pFile->IsSystem() || pFile->IsDynamic());
SetBindingContext(pExpectedBinder);
if ((m_context.usMajorVersion != (USHORT) -1) &&
(m_context.usMinorVersion != (USHORT) -1)) {
- MethodTable* pVersion = MscorlibBinder::GetClass(CLASS__VERSION);
+ MethodTable* pVersion = CoreLibBinder::GetClass(CLASS__VERSION);
// version
gc.Version = AllocateObject(pVersion);
// cultureinfo
if (m_context.szLocale) {
- MethodTable* pCI = MscorlibBinder::GetClass(CLASS__CULTURE_INFO);
+ MethodTable* pCI = CoreLibBinder::GetClass(CLASS__CULTURE_INFO);
gc.CultureInfo = AllocateObject(pCI);
gc.Locale = StringObject::NewString(m_context.szLocale);
// Check if the AssemblySpec already has specified its binding context. This will be set for assemblies that are
// attempted to be explicitly bound using AssemblyLoadContext LoadFrom* methods.
- if(!pSpec->IsAssemblySpecForMscorlib())
+ if(!pSpec->IsAssemblySpecForCoreLib())
pBinderContextForLookup = pSpec->GetBindingContext();
else
{
if (fGetBindingContextFromParent)
{
- // MScorlib does not have a binding context associated with it and its lookup will only be done
+ // CoreLib does not have a binding context associated with it and its lookup will only be done
// using its AssemblySpec hash.
- if (!pSpec->IsAssemblySpecForMscorlib())
+ if (!pSpec->IsAssemblySpecForCoreLib())
{
pBinderContextForLookup = pSpec->GetBindingContextFromParentAssembly(pSpecDomain);
pSpec->SetBindingContext(pBinderContextForLookup);
pBinderToSaveException = pSpec->GetBindingContext();
if (pBinderToSaveException == NULL)
{
- if (!pSpec->IsAssemblySpecForMscorlib())
+ if (!pSpec->IsAssemblySpecForCoreLib())
{
pBinderToSaveException = pSpec->GetBindingContextFromParentAssembly(pSpec->GetAppDomain());
UINT_PTR binderID = 0;
}
#ifndef DACCESS_COMPILE
-BOOL BaseAssemblySpec::IsMscorlib()
+BOOL BaseAssemblySpec::IsCoreLib()
{
CONTRACTL
{
( (iNameLen == CoreLibNameLen) || (m_pAssemblyName[CoreLibNameLen] == ',') ) ) ) );
}
-BOOL BaseAssemblySpec::IsAssemblySpecForMscorlib()
+BOOL BaseAssemblySpec::IsAssemblySpecForCoreLib()
{
CONTRACTL
{
}
CONTRACTL_END;
- BOOL fIsAssemblySpecForMscorlib = FALSE;
+ BOOL fIsAssemblySpecForCoreLib = FALSE;
if (m_pAssemblyName)
{
size_t iNameLen = strlen(m_pAssemblyName);
- fIsAssemblySpecForMscorlib = ( (iNameLen >= CoreLibNameLen) &&
+ fIsAssemblySpecForCoreLib = ( (iNameLen >= CoreLibNameLen) &&
( (!_stricmp(m_pAssemblyName, g_psBaseLibrary)) ||
( (!_strnicmp(m_pAssemblyName, g_psBaseLibraryName, CoreLibNameLen)) &&
( (iNameLen == CoreLibNameLen) || (m_pAssemblyName[CoreLibNameLen] == ',') ) ) ) );
}
- return fIsAssemblySpecForMscorlib;
+ return fIsAssemblySpecForCoreLib;
}
-#define MSCORLIB_PUBLICKEY g_rbTheSilverlightPlatformKey
+#define CORELIB_PUBLICKEY g_rbTheSilverlightPlatformKey
-// A satellite assembly for mscorlib is named "mscorlib.resources" or
-// mscorlib.debug.resources.dll and uses the same public key as mscorlib.
+// A satellite assembly for CoreLib is named "System.Private.CoreLib.resources" or
+// System.Private.CoreLib.debug.resources.dll and uses the same public key as CoreLib.
// It does not necessarily have the same version, and the Culture will
// always be set to something like "jp-JP".
-BOOL BaseAssemblySpec::IsMscorlibSatellite() const
+BOOL BaseAssemblySpec::IsCoreLibSatellite() const
{
CONTRACTL
{
// <TODO>More of bug 213471</TODO>
size_t iNameLen = strlen(m_pAssemblyName);
- // we allow name to be of the form mscorlib.resources.dll only
- BOOL r = ( (m_cbPublicKeyOrToken == sizeof(MSCORLIB_PUBLICKEY)) &&
+ // we allow name to be of the form System.Private.CoreLib.resources.dll only
+ BOOL r = ( (m_cbPublicKeyOrToken == sizeof(CORELIB_PUBLICKEY)) &&
(iNameLen >= CoreLibSatelliteNameLen) &&
(!SString::_strnicmp(m_pAssemblyName, g_psBaseLibrarySatelliteAssemblyName, CoreLibSatelliteNameLen)) &&
( (iNameLen == CoreLibSatelliteNameLen) || (m_pAssemblyName[CoreLibSatelliteNameLen] == ',') ) );
- r = r && ( memcmp(m_pbPublicKeyOrToken,MSCORLIB_PUBLICKEY,sizeof(MSCORLIB_PUBLICKEY)) == 0);
+ r = r && ( memcmp(m_pbPublicKeyOrToken,CORELIB_PUBLICKEY,sizeof(CORELIB_PUBLICKEY)) == 0);
return r;
}
return m_pBindingContext;
}
- BOOL IsAssemblySpecForMscorlib();
+ BOOL IsAssemblySpecForCoreLib();
HRESULT ParseName();
DWORD Hash();
BOOL IsStrongNamed() const;
BOOL HasPublicKey() const;
BOOL HasPublicKeyToken() const;
- BOOL IsMscorlibSatellite() const;
- BOOL IsMscorlib();
+ BOOL IsCoreLibSatellite() const;
+ BOOL IsCoreLib();
// Returns true
inline BOOL HasUniqueIdentity() const
// If the assemblySpec contains the binding context, then check if they match.
- if (!(pSpec->IsAssemblySpecForMscorlib() && IsAssemblySpecForMscorlib()))
+ if (!(pSpec->IsAssemblySpecForCoreLib() && IsAssemblySpecForCoreLib()))
{
if (!AreSameBinderInstance(pSpec->m_pBindingContext, m_pBindingContext))
{
//
// Retrieve structures from ID.
//
-NOINLINE PTR_MethodTable MscorlibBinder::LookupClass(BinderClassID id)
+NOINLINE PTR_MethodTable CoreLibBinder::LookupClass(BinderClassID id)
{
WRAPPER_NO_CONTRACT;
- return (&g_Mscorlib)->LookupClassLocal(id);
+ return (&g_CoreLib)->LookupClassLocal(id);
}
-PTR_MethodTable MscorlibBinder::GetClassLocal(BinderClassID id)
+PTR_MethodTable CoreLibBinder::GetClassLocal(BinderClassID id)
{
WRAPPER_NO_CONTRACT;
return pMT;
}
-PTR_MethodTable MscorlibBinder::LookupClassLocal(BinderClassID id)
+PTR_MethodTable CoreLibBinder::LookupClassLocal(BinderClassID id)
{
CONTRACTL
{
PTR_MethodTable pMT = NULL;
- // Binder methods are used for loading "known" types from mscorlib.dll. Thus they are unlikely to be part
+ // Binder methods are used for loading "known" types. Thus they are unlikely to be part
// of a recursive cycle. This is used too broadly to force manual overrides at every callsite.
OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED);
- const MscorlibClassDescription *d = m_classDescriptions + (int)id;
+ const CoreLibClassDescription *d = m_classDescriptions + (int)id;
pMT = ClassLoader::LoadTypeByNameThrowing(GetModule()->GetAssembly(), d->nameSpace, d->name).AsMethodTable();
return pMT;
}
-NOINLINE MethodDesc * MscorlibBinder::LookupMethod(BinderMethodID id)
+NOINLINE MethodDesc * CoreLibBinder::LookupMethod(BinderMethodID id)
{
WRAPPER_NO_CONTRACT;
- return (&g_Mscorlib)->LookupMethodLocal(id);
+ return (&g_CoreLib)->LookupMethodLocal(id);
}
-MethodDesc * MscorlibBinder::GetMethodLocal(BinderMethodID id)
+MethodDesc * CoreLibBinder::GetMethodLocal(BinderMethodID id)
{
WRAPPER_NO_CONTRACT;
return pMD;
}
-MethodDesc * MscorlibBinder::LookupMethodLocal(BinderMethodID id)
+MethodDesc * CoreLibBinder::LookupMethodLocal(BinderMethodID id)
{
CONTRACTL
{
#ifndef DACCESS_COMPILE
MethodDesc * pMD = NULL;
- const MscorlibMethodDescription *d = m_methodDescriptions + (id - 1);
+ const CoreLibMethodDescription *d = m_methodDescriptions + (id - 1);
MethodTable * pMT = GetClassLocal(d->classID);
- _ASSERTE(pMT != NULL && "Couldn't find a type in mscorlib!");
+ _ASSERTE(pMT != NULL && "Couldn't find a type in System.Private.CoreLib!");
if (d->sig != NULL)
{
#endif
}
-NOINLINE FieldDesc * MscorlibBinder::LookupField(BinderFieldID id)
+NOINLINE FieldDesc * CoreLibBinder::LookupField(BinderFieldID id)
{
WRAPPER_NO_CONTRACT;
- return (&g_Mscorlib)->LookupFieldLocal(id);
+ return (&g_CoreLib)->LookupFieldLocal(id);
}
-FieldDesc * MscorlibBinder::GetFieldLocal(BinderFieldID id)
+FieldDesc * CoreLibBinder::GetFieldLocal(BinderFieldID id)
{
WRAPPER_NO_CONTRACT;
return pFD;
}
-FieldDesc * MscorlibBinder::LookupFieldLocal(BinderFieldID id)
+FieldDesc * CoreLibBinder::LookupFieldLocal(BinderFieldID id)
{
CONTRACTL
{
FieldDesc * pFD = NULL;
- const MscorlibFieldDescription *d = m_fieldDescriptions + (id - 1);
+ const CoreLibFieldDescription *d = m_fieldDescriptions + (id - 1);
MethodTable * pMT = GetClassLocal(d->classID);
return pFD;
}
-NOINLINE PTR_MethodTable MscorlibBinder::LookupClassIfExist(BinderClassID id)
+NOINLINE PTR_MethodTable CoreLibBinder::LookupClassIfExist(BinderClassID id)
{
CONTRACTL
{
MODE_ANY;
PRECONDITION(id != CLASS__NIL);
- PRECONDITION(id <= (&g_Mscorlib)->m_cClasses);
+ PRECONDITION(id <= (&g_CoreLib)->m_cClasses);
}
CONTRACTL_END;
// Run the class loader in non-load mode.
ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE();
- // Binder methods are used for loading "known" types from mscorlib.dll. Thus they are unlikely to be part
+ // Binder methods are used for loading "known" types. Thus they are unlikely to be part
// of a recursive cycle. This is used too broadly to force manual overrides at every callsite.
OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED);
- const MscorlibClassDescription *d = (&g_Mscorlib)->m_classDescriptions + (int)id;
+ const CoreLibClassDescription *d = (&g_CoreLib)->m_classDescriptions + (int)id;
PTR_MethodTable pMT = ClassLoader::LoadTypeByNameThrowing(GetModule()->GetAssembly(), d->nameSpace, d->name,
ClassLoader::ReturnNullIfNotFound, ClassLoader::DontLoadTypes, CLASS_LOAD_UNRESTOREDTYPEKEY).AsMethodTable();
#ifndef DACCESS_COMPILE
if ((pMT != NULL) && pMT->IsFullyLoaded())
- VolatileStore(&(g_Mscorlib.m_pClasses[id]), pMT);
+ VolatileStore(&(g_CoreLib.m_pClasses[id]), pMT);
#endif
return pMT;
}
-Signature MscorlibBinder::GetSignature(LPHARDCODEDMETASIG pHardcodedSig)
+Signature CoreLibBinder::GetSignature(LPHARDCODEDMETASIG pHardcodedSig)
{
CONTRACTL
{
}
#endif
- return (&g_Mscorlib)->GetSignatureLocal(pHardcodedSig);
+ return (&g_CoreLib)->GetSignatureLocal(pHardcodedSig);
}
-Signature MscorlibBinder::GetTargetSignature(LPHARDCODEDMETASIG pHardcodedSig)
+Signature CoreLibBinder::GetTargetSignature(LPHARDCODEDMETASIG pHardcodedSig)
{
CONTRACTL
{
#ifdef CROSSGEN_COMPILE
return GetModule()->m_pBinder->GetSignatureLocal(pHardcodedSig);
#else
- return (&g_Mscorlib)->GetSignatureLocal(pHardcodedSig);
+ return (&g_CoreLib)->GetSignatureLocal(pHardcodedSig);
#endif
}
// Get the metasig, do a one-time conversion if necessary
-Signature MscorlibBinder::GetSignatureLocal(LPHARDCODEDMETASIG pHardcodedSig)
+Signature CoreLibBinder::GetSignatureLocal(LPHARDCODEDMETASIG pHardcodedSig)
{
CONTRACTL
{
#ifndef DACCESS_COMPILE
-bool MscorlibBinder::ConvertType(const BYTE*& pSig, SigBuilder * pSigBuilder)
+bool CoreLibBinder::ConvertType(const BYTE*& pSig, SigBuilder * pSigBuilder)
{
bool bSomethingResolved = false;
// Resolve type references in the hardcoded metasig.
// Returns a new signature with type refences resolved.
//------------------------------------------------------------------
-void MscorlibBinder::BuildConvertedSignature(const BYTE* pSig, SigBuilder * pSigBuilder)
+void CoreLibBinder::BuildConvertedSignature(const BYTE* pSig, SigBuilder * pSigBuilder)
{
CONTRACTL
{
_ASSERTE(bSomethingResolved);
}
-const BYTE* MscorlibBinder::ConvertSignature(LPHARDCODEDMETASIG pHardcodedSig, const BYTE* pSig)
+const BYTE* CoreLibBinder::ConvertSignature(LPHARDCODEDMETASIG pHardcodedSig, const BYTE* pSig)
{
CONTRACTL
{
#endif // #ifndef DACCESS_COMPILE
#ifdef _DEBUG
-void MscorlibBinder::TriggerGCUnderStress()
+void CoreLibBinder::TriggerGCUnderStress()
{
CONTRACTL
{
}
#endif // _DEBUG
-DWORD MscorlibBinder::GetFieldOffset(BinderFieldID id)
+DWORD CoreLibBinder::GetFieldOffset(BinderFieldID id)
{
WRAPPER_NO_CONTRACT;
#ifndef DACCESS_COMPILE
-CrstStatic MscorlibBinder::s_SigConvertCrst;
+CrstStatic CoreLibBinder::s_SigConvertCrst;
/*static*/
-void MscorlibBinder::Startup()
+void CoreLibBinder::Startup()
{
WRAPPER_NO_CONTRACT
s_SigConvertCrst.Init(CrstSigConvert);
// NoClass is used to suppress check for unmanaged and managed size match
#define NoClass char[USHRT_MAX]
-const MscorlibBinder::OffsetAndSizeCheck MscorlibBinder::OffsetsAndSizes[] =
+const CoreLibBinder::OffsetAndSizeCheck CoreLibBinder::OffsetsAndSizes[] =
{
#define DEFINE_CLASS_U(nameSpace, stringName, unmanagedType) \
{ PTR_CSTR((TADDR) g_ ## nameSpace ## NS ), PTR_CUTF8((TADDR) # stringName), sizeof(unmanagedType), 0, 0, 0 },
#define DEFINE_FIELD_U(stringName, unmanagedContainingType, unmanagedOffset) \
{ 0, 0, 0, PTR_CUTF8((TADDR) # stringName), offsetof(unmanagedContainingType, unmanagedOffset), sizeof(((unmanagedContainingType*)1)->unmanagedOffset) },
- #include "mscorlib.h"
+ #include "corelib.h"
};
//
-// check the basic consistency between mscorlib and mscorwks
+// check the basic consistency between CoreLib and VM
//
-void MscorlibBinder::Check()
+void CoreLibBinder::Check()
{
STANDARD_VM_CONTRACT;
else
if (p->fieldName != NULL)
{
- // This assert will fire if there is DEFINE_FIELD_U macro without preceeding DEFINE_CLASS_U macro in mscorlib.h
+ // This assert will fire if there is DEFINE_FIELD_U macro without preceeding DEFINE_CLASS_U macro in corelib.h
_ASSERTE(pMT != NULL);
FieldDesc * pFD = MemberLoader::FindField(pMT, p->fieldName, NULL, 0, NULL);
#endif // CHECK_FCALL_SIGNATURE
//
-// extended check of consistency between mscorlib and mscorwks:
-// - verifies that all references from mscorlib to mscorwks are present
-// - verifies that all references from mscorwks to mscorlib are present
+// extended check of consistency between CoreLib and VM:
+// - verifies that all references from CoreLib to VM are present
+// - verifies that all references from VM to CoreLib are present
// - limited detection of mismatches between managed and unmanaged fcall signatures
//
-void MscorlibBinder::CheckExtended()
+void CoreLibBinder::CheckExtended()
{
STANDARD_VM_CONTRACT;
- // check the consistency of BCL and VM
+ // check the consistency of CoreLib and VM
// note: it is not enabled by default because of it is time consuming and
// changes the bootstrap sequence of the EE
if (!CLRConfig::GetConfigValue(CLRConfig::INTERNAL_ConsistencyCheck))
return;
//
- // VM referencing BCL (mscorlib.h)
+ // VM referencing CoreLib (corelib.h)
//
for (BinderClassID cID = (BinderClassID) 1; (int)cID < m_cClasses; cID = (BinderClassID) (cID + 1))
{
bool fError = false;
EX_TRY
{
- if (MscorlibBinder::GetClassName(cID) != NULL) // Allow for CorSigElement entries with no classes
+ if (CoreLibBinder::GetClassName(cID) != NULL) // Allow for CorSigElement entries with no classes
{
- if (NULL == MscorlibBinder::GetClass(cID))
+ if (NULL == CoreLibBinder::GetClass(cID))
{
fError = true;
}
if (fError)
{
- printf("CheckExtended: VM expects type to exist: %s.%s\n", MscorlibBinder::GetClassNameSpace(cID), MscorlibBinder::GetClassName(cID));
+ printf("CheckExtended: VM expects type to exist: %s.%s\n", CoreLibBinder::GetClassNameSpace(cID), CoreLibBinder::GetClassName(cID));
}
}
- for (BinderMethodID mID = (BinderMethodID) 1; mID < (BinderMethodID) MscorlibBinder::m_cMethods; mID = (BinderMethodID) (mID + 1))
+ for (BinderMethodID mID = (BinderMethodID) 1; mID < (BinderMethodID) CoreLibBinder::m_cMethods; mID = (BinderMethodID) (mID + 1))
{
bool fError = false;
BinderClassID cID = m_methodDescriptions[mID-1].classID;
EX_TRY
{
- if (NULL == MscorlibBinder::GetMethod(mID))
+ if (NULL == CoreLibBinder::GetMethod(mID))
{
fError = true;
}
if (fError)
{
- printf("CheckExtended: VM expects method to exist: %s.%s::%s\n", MscorlibBinder::GetClassNameSpace(cID), MscorlibBinder::GetClassName(cID), MscorlibBinder::GetMethodName(mID));
+ printf("CheckExtended: VM expects method to exist: %s.%s::%s\n", CoreLibBinder::GetClassNameSpace(cID), CoreLibBinder::GetClassName(cID), CoreLibBinder::GetMethodName(mID));
}
}
- for (BinderFieldID fID = (BinderFieldID) 1; fID < (BinderFieldID) MscorlibBinder::m_cFields; fID = (BinderFieldID) (fID + 1))
+ for (BinderFieldID fID = (BinderFieldID) 1; fID < (BinderFieldID) CoreLibBinder::m_cFields; fID = (BinderFieldID) (fID + 1))
{
bool fError = false;
BinderClassID cID = m_fieldDescriptions[fID-1].classID;
EX_TRY
{
- if (NULL == MscorlibBinder::GetField(fID))
+ if (NULL == CoreLibBinder::GetField(fID))
{
fError = true;
}
if (fError)
{
- printf("CheckExtended: VM expects field to exist: %s.%s::%s\n", MscorlibBinder::GetClassNameSpace(cID), MscorlibBinder::GetClassName(cID), MscorlibBinder::GetFieldName(fID));
+ printf("CheckExtended: VM expects field to exist: %s.%s::%s\n", CoreLibBinder::GetClassNameSpace(cID), CoreLibBinder::GetClassName(cID), CoreLibBinder::GetFieldName(fID));
}
}
//
- // BCL referencing VM (ecall.cpp)
+ // CoreLib referencing VM (ecalllist.h)
//
SetSHash<DWORD> usedECallIds;
HRESULT hr = S_OK;
- Module *pModule = MscorlibBinder::m_pModule;
+ Module *pModule = CoreLibBinder::m_pModule;
IMDInternalImport *pInternalImport = pModule->GetMDImport();
HENUMInternal hEnum;
{
pszClassName = pszNameSpace = "Invalid TypeDef record";
}
- printf("CheckExtended: Unable to load class from mscorlib: %s.%s\n", pszNameSpace, pszClassName);
+ printf("CheckExtended: Unable to load class from System.Private.CoreLib: %s.%s\n", pszNameSpace, pszClassName);
}
EX_END_CATCH(SwallowAllExceptions)
#define ASMCONSTANTS_RUNTIME_ASSERT(cond) _ASSERTE(cond)
#include "asmconstants.h"
- _ASSERTE(sizeof(VARIANT) == MscorlibBinder::GetClass(CLASS__NATIVEVARIANT)->GetNativeSize());
+ _ASSERTE(sizeof(VARIANT) == CoreLibBinder::GetClass(CLASS__NATIVEVARIANT)->GetNativeSize());
printf("CheckExtended: completed without exception.\n");
#endif // _DEBUG && !CROSSGEN_COMPILE
-extern const MscorlibClassDescription c_rgMscorlibClassDescriptions[];
-extern const USHORT c_nMscorlibClassDescriptions;
+extern const CoreLibClassDescription c_rgCoreLibClassDescriptions[];
+extern const USHORT c_nCoreLibClassDescriptions;
-extern const MscorlibMethodDescription c_rgMscorlibMethodDescriptions[];
-extern const USHORT c_nMscorlibMethodDescriptions;
+extern const CoreLibMethodDescription c_rgCoreLibMethodDescriptions[];
+extern const USHORT c_nCoreLibMethodDescriptions;
-extern const MscorlibFieldDescription c_rgMscorlibFieldDescriptions[];
-extern const USHORT c_nMscorlibFieldDescriptions;
+extern const CoreLibFieldDescription c_rgCoreLibFieldDescriptions[];
+extern const USHORT c_nCoreLibFieldDescriptions;
#ifdef CROSSGEN_COMPILE
-namespace CrossGenMscorlib
+namespace CrossGenCoreLib
{
- extern const MscorlibClassDescription c_rgMscorlibClassDescriptions[];
- extern const USHORT c_nMscorlibClassDescriptions;
+ extern const CoreLibClassDescription c_rgCoreLibClassDescriptions[];
+ extern const USHORT c_nCoreLibClassDescriptions;
- extern const MscorlibMethodDescription c_rgMscorlibMethodDescriptions[];
- extern const USHORT c_nMscorlibMethodDescriptions;
+ extern const CoreLibMethodDescription c_rgCoreLibMethodDescriptions[];
+ extern const USHORT c_nCoreLibMethodDescriptions;
- extern const MscorlibFieldDescription c_rgMscorlibFieldDescriptions[];
- extern const USHORT c_nMscorlibFieldDescriptions;
+ extern const CoreLibFieldDescription c_rgCoreLibFieldDescriptions[];
+ extern const USHORT c_nCoreLibFieldDescriptions;
};
#endif
-void MscorlibBinder::AttachModule(Module * pModule)
+void CoreLibBinder::AttachModule(Module * pModule)
{
STANDARD_VM_CONTRACT;
- MscorlibBinder * pGlobalBinder = &g_Mscorlib;
+ CoreLibBinder * pGlobalBinder = &g_CoreLib;
pGlobalBinder->SetDescriptions(pModule,
- c_rgMscorlibClassDescriptions, c_nMscorlibClassDescriptions,
- c_rgMscorlibMethodDescriptions, c_nMscorlibMethodDescriptions,
- c_rgMscorlibFieldDescriptions, c_nMscorlibFieldDescriptions);
+ c_rgCoreLibClassDescriptions, c_nCoreLibClassDescriptions,
+ c_rgCoreLibMethodDescriptions, c_nCoreLibMethodDescriptions,
+ c_rgCoreLibFieldDescriptions, c_nCoreLibFieldDescriptions);
#if defined(FEATURE_PREJIT) && !defined(CROSSGEN_COMPILE)
- MscorlibBinder * pPersistedBinder = pModule->m_pBinder;
+ CoreLibBinder * pPersistedBinder = pModule->m_pBinder;
if (pPersistedBinder != NULL
- // Do not use persisted binder for profiling native images. See comment in code:MscorlibBinder::Fixup.
+ // Do not use persisted binder for profiling native images. See comment in code:CoreLibBinder::Fixup.
&& !(pModule->GetNativeImage()->GetNativeVersionInfo()->wConfigFlags & CORCOMPILE_CONFIG_PROFILING))
{
pGlobalBinder->m_pClasses = pPersistedBinder->m_pClasses;
pGlobalBinder->AllocateTables();
#ifdef CROSSGEN_COMPILE
- MscorlibBinder * pTargetBinder = (MscorlibBinder *)(void *)
+ CoreLibBinder * pTargetBinder = (CoreLibBinder *)(void *)
pModule->GetAssembly()->GetLowFrequencyHeap()
- ->AllocMem(S_SIZE_T(sizeof(MscorlibBinder)));
+ ->AllocMem(S_SIZE_T(sizeof(CoreLibBinder)));
pTargetBinder->SetDescriptions(pModule,
- CrossGenMscorlib::c_rgMscorlibClassDescriptions, CrossGenMscorlib::c_nMscorlibClassDescriptions,
- CrossGenMscorlib::c_rgMscorlibMethodDescriptions, CrossGenMscorlib::c_nMscorlibMethodDescriptions,
- CrossGenMscorlib::c_rgMscorlibFieldDescriptions, CrossGenMscorlib::c_nMscorlibFieldDescriptions);
+ CrossGenCoreLib::c_rgCoreLibClassDescriptions, CrossGenCoreLib::c_nCoreLibClassDescriptions,
+ CrossGenCoreLib::c_rgCoreLibMethodDescriptions, CrossGenCoreLib::c_nCoreLibMethodDescriptions,
+ CrossGenCoreLib::c_rgCoreLibFieldDescriptions, CrossGenCoreLib::c_nCoreLibFieldDescriptions);
pTargetBinder->AllocateTables();
#endif
}
-void MscorlibBinder::SetDescriptions(Module * pModule,
- const MscorlibClassDescription * pClassDescriptions, USHORT nClasses,
- const MscorlibMethodDescription * pMethodDescriptions, USHORT nMethods,
- const MscorlibFieldDescription * pFieldDescriptions, USHORT nFields)
+void CoreLibBinder::SetDescriptions(Module * pModule,
+ const CoreLibClassDescription * pClassDescriptions, USHORT nClasses,
+ const CoreLibMethodDescription * pMethodDescriptions, USHORT nMethods,
+ const CoreLibFieldDescription * pFieldDescriptions, USHORT nFields)
{
LIMITED_METHOD_CONTRACT;
m_cFields = nFields;
}
-void MscorlibBinder::AllocateTables()
+void CoreLibBinder::AllocateTables()
{
STANDARD_VM_CONTRACT;
// ZeroMemory(m_pFields, m_cFieldRIDs * sizeof(*m_pFields));
}
-PTR_MethodTable MscorlibBinder::LoadPrimitiveType(CorElementType et)
+PTR_MethodTable CoreLibBinder::LoadPrimitiveType(CorElementType et)
{
STANDARD_VM_CONTRACT;
- PTR_MethodTable pMT = g_Mscorlib.m_pClasses[et];
+ PTR_MethodTable pMT = g_CoreLib.m_pClasses[et];
// Primitive types hit cyclic reference on binder during type loading so we have to load them in two steps
if (pMT == NULL)
{
- const MscorlibClassDescription *d = (&g_Mscorlib)->m_classDescriptions + (int)et;
+ const CoreLibClassDescription *d = (&g_CoreLib)->m_classDescriptions + (int)et;
pMT = ClassLoader::LoadTypeByNameThrowing(GetModule()->GetAssembly(), d->nameSpace, d->name,
ClassLoader::ThrowIfNotFound, ClassLoader::LoadTypes, CLASS_LOAD_APPROXPARENTS).AsMethodTable();
- g_Mscorlib.m_pClasses[et] = pMT;
+ g_CoreLib.m_pClasses[et] = pMT;
ClassLoader::EnsureLoaded(pMT);
}
}
#ifdef FEATURE_NATIVE_IMAGE_GENERATION
-void MscorlibBinder::BindAll()
+void CoreLibBinder::BindAll()
{
STANDARD_VM_CONTRACT;
GetFieldLocal(fID);
}
-void MscorlibBinder::Save(DataImage *image)
+void CoreLibBinder::Save(DataImage *image)
{
STANDARD_VM_CONTRACT;
- image->StoreStructure(this, sizeof(MscorlibBinder),
+ image->StoreStructure(this, sizeof(CoreLibBinder),
DataImage::ITEM_BINDER);
image->StoreStructure(m_pClasses, m_cClasses * sizeof(*m_pClasses),
DataImage::ITEM_BINDER_ITEMS);
}
-void MscorlibBinder::Fixup(DataImage *image)
+void CoreLibBinder::Fixup(DataImage *image)
{
STANDARD_VM_CONTRACT;
- image->FixupPointerField(this, offsetof(MscorlibBinder, m_pModule));
+ image->FixupPointerField(this, offsetof(CoreLibBinder, m_pModule));
int i;
- image->FixupPointerField(this, offsetof(MscorlibBinder, m_pClasses));
+ image->FixupPointerField(this, offsetof(CoreLibBinder, m_pClasses));
for (i = 1; i < m_cClasses; i++)
{
#if _DEBUG
image->FixupPointerField(m_pClasses, i * sizeof(m_pClasses[0]));
}
- image->FixupPointerField(this, offsetof(MscorlibBinder, m_pMethods));
+ image->FixupPointerField(this, offsetof(CoreLibBinder, m_pMethods));
for (i = 1; i < m_cMethods; i++)
{
#if _DEBUG
image->FixupPointerField(m_pMethods, i * sizeof(m_pMethods[0]));
}
- image->FixupPointerField(this, offsetof(MscorlibBinder, m_pFields));
+ image->FixupPointerField(this, offsetof(CoreLibBinder, m_pFields));
for (i = 1; i < m_cFields; i++)
{
image->FixupPointerField(m_pFields, i * sizeof(m_pFields[0]));
}
- image->ZeroPointerField(this, offsetof(MscorlibBinder, m_classDescriptions));
- image->ZeroPointerField(this, offsetof(MscorlibBinder, m_methodDescriptions));
- image->ZeroPointerField(this, offsetof(MscorlibBinder, m_fieldDescriptions));
+ image->ZeroPointerField(this, offsetof(CoreLibBinder, m_classDescriptions));
+ image->ZeroPointerField(this, offsetof(CoreLibBinder, m_methodDescriptions));
+ image->ZeroPointerField(this, offsetof(CoreLibBinder, m_fieldDescriptions));
}
#endif // FEATURE_NATIVE_IMAGE_GENERATION
#ifdef DACCESS_COMPILE
void
-MscorlibBinder::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
+CoreLibBinder::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
{
SUPPORTS_DAC;
DAC_ENUM_DTHIS();
DacEnumMemoryRegion(dac_cast<TADDR>(m_classDescriptions),
- m_cClasses * sizeof(MscorlibClassDescription));
+ m_cClasses * sizeof(CoreLibClassDescription));
DacEnumMemoryRegion(dac_cast<TADDR>(m_methodDescriptions),
- (m_cMethods - 1) * sizeof(MscorlibMethodDescription));
+ (m_cMethods - 1) * sizeof(CoreLibMethodDescription));
DacEnumMemoryRegion(dac_cast<TADDR>(m_fieldDescriptions),
- (m_cFields - 1) * sizeof(MscorlibFieldDescription));
+ (m_cFields - 1) * sizeof(CoreLibFieldDescription));
if (m_pModule.IsValid())
{
#endif // #ifdef DACCESS_COMPILE
-GVAL_IMPL(MscorlibBinder, g_Mscorlib);
+GVAL_IMPL(CoreLibBinder, g_CoreLib);
// Use the Binder objects to avoid doing unnecessary name lookup
// (esp. in the prejit case)
//
-// E.g. MscorlibBinder::GetClass(CLASS__APP_DOMAIN);
+// E.g. CoreLibBinder::GetClass(CLASS__APP_DOMAIN);
//
// BinderClassIDs are of the form CLASS__XXX
#undef TYPEINFO
#define DEFINE_CLASS(i,n,s) CLASS__ ## i,
-#include "mscorlib.h"
+#include "corelib.h"
- CLASS__MSCORLIB_COUNT,
+ CLASS__CORELIB_COUNT,
// Aliases for element type classids
CLASS__NIL = CLASS__ELEMENT_TYPE_END,
METHOD__NIL = 0,
#define DEFINE_METHOD(c,i,s,g) METHOD__ ## c ## __ ## i,
-#include "mscorlib.h"
+#include "corelib.h"
- METHOD__MSCORLIB_COUNT,
+ METHOD__CORELIB_COUNT,
};
// BinderFieldIDs are of the form FIELD__XXX__YYY,
FIELD__NIL = 0,
#define DEFINE_FIELD(c,i,s) FIELD__ ## c ## __ ## i,
-#include "mscorlib.h"
+#include "corelib.h"
- FIELD__MSCORLIB_COUNT,
+ FIELD__CORELIB_COUNT,
};
-struct MscorlibClassDescription
+struct CoreLibClassDescription
{
PTR_CSTR nameSpace;
PTR_CSTR name;
};
-struct MscorlibMethodDescription
+struct CoreLibMethodDescription
{
BinderClassID classID;
PTR_CSTR name;
PTR_HARDCODEDMETASIG sig;
};
-struct MscorlibFieldDescription
+struct CoreLibFieldDescription
{
BinderClassID classID;
PTR_CSTR name;
};
-class MscorlibBinder
+class CoreLibBinder
{
public:
#ifdef DACCESS_COMPILE
//
// Retrieve structures from ID.
//
- // Note that none of the MscorlibBinder methods trigger static
+ // Note that none of the CoreLibBinder methods trigger static
// constructors. The JITed code takes care of triggering them.
//
static PTR_MethodTable GetClass(BinderClassID id);
static MethodTable *GetException(RuntimeExceptionKind kind)
{
WRAPPER_NO_CONTRACT;
- _ASSERTE(kind <= kLastExceptionInMscorlib); // Not supported for exceptions defined outside mscorlib.
- BinderClassID id = (BinderClassID) (kind + CLASS__MSCORLIB_COUNT);
+ _ASSERTE(kind < kLastException);
+ BinderClassID id = (BinderClassID) (kind + CLASS__CORELIB_COUNT);
return GetClass(id);
}
static BOOL IsException(MethodTable *pMT, RuntimeExceptionKind kind)
{
WRAPPER_NO_CONTRACT;
- _ASSERTE(kind <= kLastExceptionInMscorlib); // Not supported for exceptions defined outside mscorlib.
- BinderClassID id = (BinderClassID) (kind + CLASS__MSCORLIB_COUNT);
+ _ASSERTE(kind < kLastException);
+ BinderClassID id = (BinderClassID) (kind + CLASS__CORELIB_COUNT);
return dac_cast<TADDR>(GetClassIfExist(id)) == dac_cast<TADDR>(pMT);
}
static LPCUTF8 GetExceptionName(RuntimeExceptionKind kind)
{
WRAPPER_NO_CONTRACT;
- _ASSERTE(kind <= kLastExceptionInMscorlib); // Not supported for exceptions defined outside mscorlib.
- BinderClassID id = (BinderClassID) (kind + CLASS__MSCORLIB_COUNT);
+ _ASSERTE(kind < kLastException);
+ BinderClassID id = (BinderClassID) (kind + CLASS__CORELIB_COUNT);
return GetClassName(id);
}
const BYTE* ConvertSignature(LPHARDCODEDMETASIG pHardcodedSig, const BYTE* pSig);
void SetDescriptions(Module * pModule,
- const MscorlibClassDescription * pClassDescriptions, USHORT nClasses,
- const MscorlibMethodDescription * pMethodDescriptions, USHORT nMethods,
- const MscorlibFieldDescription * pFieldDescriptions, USHORT nFields);
+ const CoreLibClassDescription * pClassDescriptions, USHORT nClasses,
+ const CoreLibMethodDescription * pMethodDescriptions, USHORT nMethods,
+ const CoreLibFieldDescription * pFieldDescriptions, USHORT nFields);
void AllocateTables();
DPTR(PTR_FieldDesc) m_pFields;
// This is necessary to avoid embeding copy of the descriptions into mscordacwks
- DPTR(const MscorlibClassDescription) m_classDescriptions;
- DPTR(const MscorlibMethodDescription) m_methodDescriptions;
- DPTR(const MscorlibFieldDescription) m_fieldDescriptions;
+ DPTR(const CoreLibClassDescription) m_classDescriptions;
+ DPTR(const CoreLibMethodDescription) m_methodDescriptions;
+ DPTR(const CoreLibFieldDescription) m_fieldDescriptions;
USHORT m_cClasses;
USHORT m_cMethods;
// Global bound modules:
//
-GVAL_DECL(MscorlibBinder, g_Mscorlib);
+GVAL_DECL(CoreLibBinder, g_CoreLib);
-FORCEINLINE PTR_MethodTable MscorlibBinder::GetClass(BinderClassID id)
+FORCEINLINE PTR_MethodTable CoreLibBinder::GetClass(BinderClassID id)
{
CONTRACTL
{
INJECT_FAULT(ThrowOutOfMemory());
PRECONDITION(id != CLASS__NIL);
- PRECONDITION((&g_Mscorlib)->m_cClasses > 0); // Make sure mscorlib has been loaded.
- PRECONDITION(id <= (&g_Mscorlib)->m_cClasses);
+ PRECONDITION((&g_CoreLib)->m_cClasses > 0); // Make sure CoreLib has been loaded.
+ PRECONDITION(id <= (&g_CoreLib)->m_cClasses);
}
CONTRACTL_END;
// Force a GC here under stress because type loading could trigger GC nondeterminsticly
INDEBUG(TriggerGCUnderStress());
- PTR_MethodTable pMT = VolatileLoad(&((&g_Mscorlib)->m_pClasses[id]));
+ PTR_MethodTable pMT = VolatileLoad(&((&g_CoreLib)->m_pClasses[id]));
if (pMT == NULL)
return LookupClass(id);
return pMT;
}
-FORCEINLINE MethodDesc * MscorlibBinder::GetMethod(BinderMethodID id)
+FORCEINLINE MethodDesc * CoreLibBinder::GetMethod(BinderMethodID id)
{
CONTRACTL
{
INJECT_FAULT(ThrowOutOfMemory());
PRECONDITION(id != METHOD__NIL);
- PRECONDITION(id <= (&g_Mscorlib)->m_cMethods);
+ PRECONDITION(id <= (&g_CoreLib)->m_cMethods);
}
CONTRACTL_END;
// Force a GC here under stress because type loading could trigger GC nondeterminsticly
INDEBUG(TriggerGCUnderStress());
- MethodDesc * pMD = VolatileLoad(&((&g_Mscorlib)->m_pMethods[id]));
+ MethodDesc * pMD = VolatileLoad(&((&g_CoreLib)->m_pMethods[id]));
if (pMD == NULL)
return LookupMethod(id);
return pMD;
}
-FORCEINLINE FieldDesc * MscorlibBinder::GetField(BinderFieldID id)
+FORCEINLINE FieldDesc * CoreLibBinder::GetField(BinderFieldID id)
{
CONTRACTL
{
INJECT_FAULT(ThrowOutOfMemory());
PRECONDITION(id != FIELD__NIL);
- PRECONDITION(id <= (&g_Mscorlib)->m_cFields);
+ PRECONDITION(id <= (&g_CoreLib)->m_cFields);
}
CONTRACTL_END;
// Force a GC here under stress because type loading could trigger GC nondeterminsticly
INDEBUG(TriggerGCUnderStress());
- FieldDesc * pFD = VolatileLoad(&((&g_Mscorlib)->m_pFields[id]));
+ FieldDesc * pFD = VolatileLoad(&((&g_CoreLib)->m_pFields[id]));
if (pFD == NULL)
return LookupField(id);
return pFD;
}
-FORCEINLINE PTR_MethodTable MscorlibBinder::GetExistingClass(BinderClassID id)
+FORCEINLINE PTR_MethodTable CoreLibBinder::GetExistingClass(BinderClassID id)
{
LIMITED_METHOD_DAC_CONTRACT;
- PTR_MethodTable pMT = (&g_Mscorlib)->m_pClasses[id];
+ PTR_MethodTable pMT = (&g_CoreLib)->m_pClasses[id];
_ASSERTE(pMT != NULL);
return pMT;
}
-FORCEINLINE MethodDesc * MscorlibBinder::GetExistingMethod(BinderMethodID id)
+FORCEINLINE MethodDesc * CoreLibBinder::GetExistingMethod(BinderMethodID id)
{
LIMITED_METHOD_DAC_CONTRACT;
- MethodDesc * pMD = (&g_Mscorlib)->m_pMethods[id];
+ MethodDesc * pMD = (&g_CoreLib)->m_pMethods[id];
_ASSERTE(pMD != NULL);
return pMD;
}
-FORCEINLINE FieldDesc * MscorlibBinder::GetExistingField(BinderFieldID id)
+FORCEINLINE FieldDesc * CoreLibBinder::GetExistingField(BinderFieldID id)
{
LIMITED_METHOD_DAC_CONTRACT;
- FieldDesc * pFD = (&g_Mscorlib)->m_pFields[id];
+ FieldDesc * pFD = (&g_CoreLib)->m_pFields[id];
_ASSERTE(pFD != NULL);
return pFD;
}
-FORCEINLINE PTR_MethodTable MscorlibBinder::GetClassIfExist(BinderClassID id)
+FORCEINLINE PTR_MethodTable CoreLibBinder::GetClassIfExist(BinderClassID id)
{
CONTRACTL
{
MODE_ANY;
PRECONDITION(id != CLASS__NIL);
- PRECONDITION(id <= (&g_Mscorlib)->m_cClasses);
+ PRECONDITION(id <= (&g_CoreLib)->m_cClasses);
}
CONTRACTL_END;
- PTR_MethodTable pMT = VolatileLoad(&((&g_Mscorlib)->m_pClasses[id]));
+ PTR_MethodTable pMT = VolatileLoad(&((&g_CoreLib)->m_pClasses[id]));
if (pMT == NULL)
return LookupClassIfExist(id);
return pMT;
}
-FORCEINLINE PTR_Module MscorlibBinder::GetModule()
+FORCEINLINE PTR_Module CoreLibBinder::GetModule()
{
LIMITED_METHOD_DAC_CONTRACT;
- PTR_Module pModule = (&g_Mscorlib)->m_pModule;
+ PTR_Module pModule = (&g_CoreLib)->m_pModule;
_ASSERTE(pModule != NULL);
return pModule;
}
-FORCEINLINE LPCUTF8 MscorlibBinder::GetClassNameSpace(BinderClassID id)
+FORCEINLINE LPCUTF8 CoreLibBinder::GetClassNameSpace(BinderClassID id)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(id != CLASS__NIL);
- _ASSERTE(id <= (&g_Mscorlib)->m_cClasses);
- return (&g_Mscorlib)->m_classDescriptions[id].nameSpace;
+ _ASSERTE(id <= (&g_CoreLib)->m_cClasses);
+ return (&g_CoreLib)->m_classDescriptions[id].nameSpace;
}
-FORCEINLINE LPCUTF8 MscorlibBinder::GetClassName(BinderClassID id)
+FORCEINLINE LPCUTF8 CoreLibBinder::GetClassName(BinderClassID id)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(id != CLASS__NIL);
- _ASSERTE(id <= (&g_Mscorlib)->m_cClasses);
- return (&g_Mscorlib)->m_classDescriptions[id].name;
+ _ASSERTE(id <= (&g_CoreLib)->m_cClasses);
+ return (&g_CoreLib)->m_classDescriptions[id].name;
}
-FORCEINLINE LPCUTF8 MscorlibBinder::GetMethodName(BinderMethodID id)
+FORCEINLINE LPCUTF8 CoreLibBinder::GetMethodName(BinderMethodID id)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(id != METHOD__NIL);
- _ASSERTE(id <= (&g_Mscorlib)->m_cMethods);
- return (&g_Mscorlib)->m_methodDescriptions[id-1].name;
+ _ASSERTE(id <= (&g_CoreLib)->m_cMethods);
+ return (&g_CoreLib)->m_methodDescriptions[id-1].name;
}
-FORCEINLINE LPHARDCODEDMETASIG MscorlibBinder::GetMethodSig(BinderMethodID id)
+FORCEINLINE LPHARDCODEDMETASIG CoreLibBinder::GetMethodSig(BinderMethodID id)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(id != METHOD__NIL);
- _ASSERTE(id <= (&g_Mscorlib)->m_cMethods);
- return (&g_Mscorlib)->m_methodDescriptions[id-1].sig;
+ _ASSERTE(id <= (&g_CoreLib)->m_cMethods);
+ return (&g_CoreLib)->m_methodDescriptions[id-1].sig;
}
-FORCEINLINE LPCUTF8 MscorlibBinder::GetFieldName(BinderFieldID id)
+FORCEINLINE LPCUTF8 CoreLibBinder::GetFieldName(BinderFieldID id)
{
LIMITED_METHOD_CONTRACT;
_ASSERTE(id != FIELD__NIL);
- _ASSERTE(id <= (&g_Mscorlib)->m_cFields);
- return (&g_Mscorlib)->m_fieldDescriptions[id-1].name;
+ _ASSERTE(id <= (&g_CoreLib)->m_cFields);
+ return (&g_CoreLib)->m_fieldDescriptions[id-1].name;
}
#endif // _BINDERMODULE_H_
_ASSERTE(!NingenEnabled() && "You cannot invoke managed code inside the ngen compilation process.");
- // If we're invoking an mscorlib method, lift the restriction on type load limits. Calls into mscorlib are
+ // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are
// typically calls into specific and controlled helper methods for security checks and other linktime tasks.
//
// @todo: In an ideal world, we would require each of those sites to do the override rather than disabling
- // the assert broadly here. However, by limiting the override to mscorlib methods, we should still be able
+ // the assert broadly here. However, by limiting the override to CoreLib methods, we should still be able
// to effectively enforce the more general rule about loader recursion.
MAYBE_OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED, m_pMD->GetModule()->IsSystem());
#endif
public:
- // Used to avoid touching metadata for mscorlib methods.
+ // Used to avoid touching metadata for CoreLib methods.
// instance methods must pass in the 'this' object
// static methods must pass null
MethodDescCallSite(BinderMethodID id, OBJECTREF* porProtectedThis = NULL) :
m_pMD(
- MscorlibBinder::GetMethod(id)
+ CoreLibBinder::GetMethod(id)
),
m_methodSig(id),
m_argIt(&m_methodSig)
DefaultInit(porProtectedThis);
}
- // Used to avoid touching metadata for mscorlib methods.
+ // Used to avoid touching metadata for CoreLib methods.
// instance methods must pass in the 'this' object
// static methods must pass null
MethodDescCallSite(BinderMethodID id, OBJECTHANDLE hThis) :
m_pMD(
- MscorlibBinder::GetMethod(id)
+ CoreLibBinder::GetMethod(id)
),
m_methodSig(id),
m_argIt(&m_methodSig)
PCODE __pSlot = VolatileLoad(&s_pAddr##id); \
if ( __pSlot == NULL ) \
{ \
- MethodDesc *pMeth = MscorlibBinder::GetMethod(id); \
+ MethodDesc *pMeth = CoreLibBinder::GetMethod(id); \
_ASSERTE(pMeth); \
__pSlot = pMeth->GetMultiCallableAddrOfCode(); \
VolatileStore(&s_pAddr##id, __pSlot); \
}
#define PREPARE_VIRTUAL_CALLSITE(id, objref) \
- MethodDesc *__pMeth = MscorlibBinder::GetMethod(id); \
+ MethodDesc *__pMeth = CoreLibBinder::GetMethod(id); \
PCODE __pSlot = __pMeth->GetCallTarget(&objref);
#define PREPARE_VIRTUAL_CALLSITE_USING_METHODDESC(pMD, objref) \
WORD __slot = VolatileLoad(&s_slot##id); \
if (__slot == MethodTable::NO_SLOT) \
{ \
- MethodDesc *pMeth = MscorlibBinder::GetMethod(id); \
+ MethodDesc *pMeth = CoreLibBinder::GetMethod(id); \
_ASSERTE(pMeth); \
__slot = pMeth->GetSlot(); \
VolatileStore(&s_slot##id, __slot); \
if (ELEMENT_TYPE_PTR == eType)
COMPlusThrow(kNotSupportedException);
- MethodTable *pMT = MscorlibBinder::GetElementType(eType);
+ MethodTable *pMT = CoreLibBinder::GetElementType(eType);
OBJECTREF pObj = pMT->Allocate();
if (fIsByRef)
// Allocate all needed arrays for callsite arg details
gc.Args = (PTRARRAYREF)AllocateObjectArray(numArgs, g_pObjectClass);
- MethodTable *typeMT = MscorlibBinder::GetClass(CLASS__TYPE);
+ MethodTable *typeMT = CoreLibBinder::GetClass(CLASS__TYPE);
gc.ArgsTypes = (PTRARRAYREF)AllocateObjectArray(numArgs, typeMT);
gc.ArgsIsByRef = (BOOLARRAYREF)AllocatePrimitiveArray(ELEMENT_TYPE_BOOLEAN, numArgs);
}
CONTRACTL_END;
- FieldDesc* pTableField = MscorlibBinder::GetField(FIELD__CASTHELPERS__TABLE);
+ FieldDesc* pTableField = CoreLibBinder::GetField(FIELD__CASTHELPERS__TABLE);
GCX_COOP();
s_pTableRef = (BASEARRAYREF*)pTableField->GetCurrentStaticAddress();
if (GCStress<cfg_instr_ngen>::IsEnabled())
{
// Setting up gc coverage requires the base system classes
- // to be initialized. So we must defer this for mscorlib.
+ // to be initialized. So we must defer this for CoreLib.
if(!IsSystem())
{
SetupGcCoverageForNativeImage(this);
if (!pOtherModule->IsLowLevelSystemAssemblyByName())
return true;
- // Every module depends upon mscorlib
+ // Every module depends upon CoreLib
if (pModule->IsSystem())
return true;
- // mscorlib does not depend upon any other module
+ // CoreLib does not depend upon any other module
if (pOtherModule->IsSystem())
return false;
}
return false;
}
- // At this point neither pModule or pOtherModule is mscorlib
+ // At this point neither pModule or pOtherModule is CoreLib
#ifndef DACCESS_COMPILE
//
RETURN dac_cast<PTR_Module>(pOpenModule);
}
- // The initial value of pCurrentPZM is the pDefinitionModule or mscorlib
- Module* pCurrentPZM = (pDefinitionModule != NULL) ? pDefinitionModule : MscorlibBinder::GetModule();
+ // The initial value of pCurrentPZM is the pDefinitionModule or CoreLib
+ Module* pCurrentPZM = (pDefinitionModule != NULL) ? pDefinitionModule : CoreLibBinder::GetModule();
bool preferredZapModuleBasedOnValueType = false;
for (DWORD i = 0; i < totalArgs; i++)
// pCurrentPZM is a dependency of pParamPZM
// and pParamPZM is not a dependency of pCurrentPZM
//
- // note that the second condition is alway true when pCurrentPZM is mscorlib
+ // note that the second condition is alway true when pCurrentPZM is CoreLib
//
if (!IsLikelyDependencyOf(pParamPZM, pCurrentPZM))
{
// For various reasons, the IDs issued by the IdDispenser start at 1.
// Domain neutral module IDs have historically started at 0, and we
- // have always assigned ID 0 to mscorlib. Thus, to make it so that
+ // have always assigned ID 0 to CoreLib. Thus, to make it so that
// domain neutral module IDs start at 0, we will subtract 1 from the
// ID that we got back from the ID dispenser.
ModuleIndex index((SIZE_T)(val-1));
m_ModuleID->SetDomainFile(pDomainFile);
// Allocate static handles now.
- // NOTE: Bootstrapping issue with mscorlib - we will manually allocate later
+ // NOTE: Bootstrapping issue with CoreLib - we will manually allocate later
// If the assembly is collectible, we don't initialize static handles for them
// as it is currently initialized through the DomainLocalModule::PopulateClass in MethodTable::CheckRunClassInitThrowing
// (If we don't do this, it would allocate here unused regular static handles that will be overridden later)
}
/* Unfortunately, this assert won't work in some cases of generics, consider the following scenario:
- 1) Generic type in mscorlib.
+ 1) Generic type in CoreLib.
2) Instantiation of generic (1) (via valuetype) in another module
3) other module now holds a copy of the code of the generic for that particular instantiation
- however, it is resolving the string literals against mscorlib, which breaks the invariant
+ however, it is resolving the string literals against CoreLib, which breaks the invariant
this assert was based on (no string fixups against other modules). In fact, with NoStringInterning,
our behavior is not very intuitive.
*/
if (pDomainAssembly != NULL)
{
_ASSERTE(
- pDomainAssembly->IsSystem() || // GetAssemblyIfLoaded will not find mscorlib (see AppDomain::FindCachedFile)
+ pDomainAssembly->IsSystem() || // GetAssemblyIfLoaded will not find CoreLib (see AppDomain::FindCachedFile)
!pDomainAssembly->IsLoaded() || // GetAssemblyIfLoaded will not find not-yet-loaded assemblies
GetAssemblyIfLoaded(kAssemblyRef, NULL, FALSE, pDomainAssembly->GetFile()->GetHostAssembly()) != NULL); // GetAssemblyIfLoaded should find all remaining cases
//
// This still leaves the problem of runtime lookup performance. Touches to the cold section of a LookupMap
// aren't all that critical (after all the data is meant to be cold), but looking up the last entry of a map
-// with 22 thousand entries (roughly what the MethodDefToDesc map in mscorlib is sized at at the time of
+// with 22 thousand entries (roughly what the MethodDefToDesc map in CoreLib is sized at at the time of
// writing) is still likely to so inefficient as to be noticeable. Remember that the issue is that we have to
// decode all predecessor entries in order to compute the value of a given entry in the table.
//
//
// The main areas in which this algorithm can be tuned are the number of bits used as an index into the
// encoding lengths table (kLookupMapLengthBits) and the frequency with which entries are bookmarked in the
-// index (kLookupMapIndexStride). The current values have been set based on looking at models of mscorlib,
+// index (kLookupMapIndexStride). The current values have been set based on looking at models of CoreLib,
// PresentationCore and PresentationFramework built from the actual ridmap data in their ngen images and
// methodically trying different values in order to maximize compression or balance size versus likely runtime
// performance. An alternative strategy was considered using direct (non-length prefix) encoding of the
PTR_EEClassHashTable m_pAvailableClassesCaseIns;
// Pointer to binder, if we have one
- friend class MscorlibBinder;
- PTR_MscorlibBinder m_pBinder;
+ friend class CoreLibBinder;
+ PTR_CoreLibBinder m_pBinder;
public:
BOOL IsCollectible()
HRESULT hr = E_FAIL;
- // On non x86 platforms, when we load mscorlib.dll during EEStartup, we will
- // re-enter _CorDllMain with a DLL_PROCESS_ATTACH for mscorlib.dll. We are
+ // On non x86 platforms, when we load CoreLib during EEStartup, we will
+ // re-enter _CorDllMain with a DLL_PROCESS_ATTACH for CoreLib. We are
// far enough in startup that this is allowed, however we don't want to
// re-start the startup code so we need to check to see if startup has
// been initiated or completed before we call EEStartup.
AccessCheckOptions::Startup();
- MscorlibBinder::Startup();
+ CoreLibBinder::Startup();
Stub::Init();
StubLinkerCPU::Init();
SystemDomain::SystemModule()->ExpandAll();
}
- // Perform mscorlib consistency check if requested
- g_Mscorlib.CheckExtended();
+ // Perform CoreLib consistency check if requested
+ g_CoreLib.CheckExtended();
#endif // _DEBUG
// EEStartup is responsible for all the one time intialization of the runtime. Some of the highlights of
// what it does include
// * Creates the default and shared, appdomains.
-// * Loads mscorlib.dll and loads up the fundamental types (System.Object ...)
+// * Loads System.Private.CoreLib and loads up the fundamental types (System.Object ...)
//
// see code:EEStartup#TableOfContents for more on the runtime in general.
// see code:#EEShutdown for a analagous routine run during shutdown.
//
// ResetProcessorStateHolder saves/restores processor state around calls to
-// mscorlib during exception handling.
+// CoreLib during exception handling.
//
class ResetProcessorStateHolder
{
}
bmtVT->pParentMethodTable = bmtParent->pParentMethodTable;
}
-
-#if 0
- // @<TODO>todo: Figure out the right way to override Equals for value
- // types only.
- //
- // This is broken because
- // (a) g_pObjectClass->FindMethod("Equals", &gsig_IM_Obj_RetBool); will return
- // the EqualsValue method
- // (b) When mscorlib has been preloaded (and thus the munge already done
- // ahead of time), we cannot easily find both methods
- // to compute EqualsAddr & EqualsSlot
- //
- // For now, the Equals method has a runtime check to see if it's
- // comparing value types.
- //</TODO>
-
- // If it is a value type, over ride a few of the base class methods.
- if (IsValueClass())
- {
- static WORD EqualsSlot;
-
- // If we haven't been through here yet, get some stuff from the Object class definition.
- if (EqualsSlot == NULL)
- {
- // Get the slot of the Equals method.
- MethodDesc *pEqualsMD = g_pObjectClass->FindMethod("Equals", &gsig_IM_Obj_RetBool);
- THROW_BAD_FORMAT_MAYBE(pEqualsMD != NULL, 0, this);
- EqualsSlot = pEqualsMD->GetSlot();
-
- // Get the address of the EqualsValue method.
- MethodDesc *pEqualsValueMD = g_pObjectClass->FindMethod("EqualsValue", &gsig_IM_Obj_RetBool);
- THROW_BAD_FORMAT_MAYBE(pEqualsValueMD != NULL, 0, this);
-
- // Patch the EqualsValue method desc in a dangerous way to
- // look like the Equals method desc.
- pEqualsValueMD->SetSlot(EqualsSlot);
- pEqualsValueMD->SetMemberDef(pEqualsMD->GetMemberDef());
- }
-
- // Override the valuetype "Equals" with "EqualsValue".
- bmtVT->SetMethodDescForSlot(EqualsSlot, EqualsSlot);
- }
-#endif // 0
}
if (NumDeclaredMethods() > 0)
// from the managed size and alignment.
// Crossgen scenarios block Vector<T> from even being loaded, so only do this check when not in crossgen.
#ifndef CROSSGEN_COMPILE
- if (pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTORT)))
+ if (pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTORT)))
{
pNativeLayoutInfo->m_size = pEEClassLayoutInfo->GetManagedSize();
pNativeLayoutInfo->m_alignmentRequirement = pEEClassLayoutInfo->m_ManagedLargestAlignmentRequirementOfAllMembers;
}
else
#endif
- if (pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTOR64T)) ||
- pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTOR128T)) ||
- pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTOR256T)))
+ if (pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR64T)) ||
+ pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR128T)) ||
+ pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR256T)))
{
pNativeLayoutInfo->m_alignmentRequirement = pEEClassLayoutInfo->m_ManagedLargestAlignmentRequirementOfAllMembers;
}
// CreateThrowable() and is being caught in this EX_TRY/EX_CATCH.)
// If that exception is the same as the one for which this GetThrowable()
// was called, we're in a recursive situation.
- // Since the CreateThrowable() call should return a type from mscorlib,
+ // Since the CreateThrowable() call should return a type from CoreLib,
// there really shouldn't be much opportunity for error. We could be
// out of memory, we could overflow the stack, or the runtime could
// be in a weird state(the thread could be aborted as well).
return;
// Otherwise, report the class's generic message
- LPCUTF8 pszExceptionName = MscorlibBinder::GetExceptionName(m_kind);
+ LPCUTF8 pszExceptionName = CoreLibBinder::GetExceptionName(m_kind);
result.SetUTF8(pszExceptionName);
}
_ASSERTE(g_pPreallocatedOutOfMemoryException != NULL);
static int allocCount = 0;
- MethodTable *pMT = MscorlibBinder::GetException(m_kind);
+ MethodTable *pMT = CoreLibBinder::GetException(m_kind);
ThreadPreventAsyncHolder preventAsyncHolder(m_kind == kThreadAbortException);
//
result.Printf("%s (message resource %s)",
- MscorlibBinder::GetExceptionName(m_kind), m_resourceName.GetUnicode());
+ CoreLibBinder::GetExceptionName(m_kind), m_resourceName.GetUnicode());
}
BOOL EEResourceException::GetThrowableMessage(SString &result)
ResMgrGetString(m_resourceName, &prot.s1);
GCPROTECT_BEGIN(prot);
- MethodTable *pMT = MscorlibBinder::GetException(m_kind);
+ MethodTable *pMT = CoreLibBinder::GetException(m_kind);
prot.pThrowable = AllocateObject(pMT);
MethodDesc* pMD = MemberLoader::FindMethod(prot.pThrowable->GetMethodTable(),
}
CONTRACTL_END;
- MethodTable *pMT = MscorlibBinder::GetException(kTypeLoadException);
+ MethodTable *pMT = CoreLibBinder::GetException(kTypeLoadException);
struct _gc {
OBJECTREF pNewException;
GCPROTECT_BEGIN(gc);
gc.pNewFileString = StringObject::NewString(m_name);
- gc.pNewException = AllocateObject(MscorlibBinder::GetException(m_kind));
+ gc.pNewException = AllocateObject(CoreLibBinder::GetException(m_kind));
MethodDesc* pMD = MemberLoader::FindMethod(gc.pNewException->GetMethodTable(),
COR_CTOR_METHOD_NAME, &gsig_IM_Str_Int_RetVoid);
// Some useful effects of this rule (for ngen purposes) are:
//
// * G<object,...,object> lives in the module defining G
-// * non-mscorlib instantiations of mscorlib-defined generic types live in the module
+// * non-CoreLib instantiations of CoreLib-defined generic types live in the module
// of the instantiation (when only one module is invloved in the instantiation)
//
if (pLoaderModule == NULL)
{
- CONSISTENCY_CHECK(MscorlibBinder::GetModule() && MscorlibBinder::GetModule()->IsSystem());
+ CONSISTENCY_CHECK(CoreLibBinder::GetModule() && CoreLibBinder::GetModule()->IsSystem());
- pLoaderModule = MscorlibBinder::GetModule();
+ pLoaderModule = CoreLibBinder::GetModule();
}
if (FALSE)
// We're a little stuck - we can't force the item into an NGEN image at this point. So just bail out
// and use the loader module we've computed without recording the choice. The loader module should always
- // be mscorlib in this case.
+ // be CoreLib in this case.
AppDomain * pAppDomain = GetAppDomain();
if (!pAppDomain->IsCompilationDomain() ||
!pAppDomain->ToCompilationDomain()->GetTargetModule())
// let <Type>* type have a method table
// System.UIntPtr's method table is used for types like int*, void *, string * etc.
if (kind == ELEMENT_TYPE_PTR)
- templateMT = MscorlibBinder::GetElementType(ELEMENT_TYPE_U);
+ templateMT = CoreLibBinder::GetElementType(ELEMENT_TYPE_U);
else
templateMT = NULL;
if (pClass == g_pRuntimeTypeClass)
return FALSE;
- if (MscorlibBinder::IsClass(pClass, CLASS__TYPE_BUILDER))
+ if (CoreLibBinder::IsClass(pClass, CLASS__TYPE_BUILDER))
return FALSE;
- if (MscorlibBinder::IsClass(pClass, CLASS__TYPE))
+ if (CoreLibBinder::IsClass(pClass, CLASS__TYPE))
return FALSE;
- if (MscorlibBinder::IsClass(pClass, CLASS__ENUM_BUILDER))
+ if (CoreLibBinder::IsClass(pClass, CLASS__ENUM_BUILDER))
return FALSE;
// Check to see if the MethodTable associated with the wrapper implements IExpando.
- return pClass->ImplementsInterface(MscorlibBinder::GetClass(CLASS__IREFLECT));
+ return pClass->ImplementsInterface(CoreLibBinder::GetClass(CLASS__IREFLECT));
}
//--------------------------------------------------------------------------
CONTRACTL_END;
// Check to see if the MethodTable associated with the wrapper implements IExpando.
- return pClass->ImplementsInterface(MscorlibBinder::GetClass(CLASS__IEXPANDO));
+ return pClass->ImplementsInterface(CoreLibBinder::GetClass(CLASS__IEXPANDO));
}
// NOINLINE to prevent RCWHolder from forcing caller to push/pop an FS:0 handler
// System.Reflection.MethodBody, and System.Reflection.ParameterInfo.
// Some interesting derived types that get blocked as a result are:
// System.Type, System.Reflection.TypeInfo, System.Reflection.MethodInfo, and System.Reflection.FieldInfo
- if (pMt->CanCastToClass(MscorlibBinder::GetClass(CLASS__ASSEMBLYBASE)) ||
- pMt->CanCastToClass(MscorlibBinder::GetClass(CLASS__MEMBER)) ||
- pMt->CanCastToClass(MscorlibBinder::GetClass(CLASS__MODULEBASE)) ||
- pMt->CanCastToClass(MscorlibBinder::GetClass(CLASS__RUNTIME_METHOD_BODY)) ||
- pMt->CanCastToClass(MscorlibBinder::GetClass(CLASS__PARAMETER)))
+ if (pMt->CanCastToClass(CoreLibBinder::GetClass(CLASS__ASSEMBLYBASE)) ||
+ pMt->CanCastToClass(CoreLibBinder::GetClass(CLASS__MEMBER)) ||
+ pMt->CanCastToClass(CoreLibBinder::GetClass(CLASS__MODULEBASE)) ||
+ pMt->CanCastToClass(CoreLibBinder::GetClass(CLASS__RUNTIME_METHOD_BODY)) ||
+ pMt->CanCastToClass(CoreLibBinder::GetClass(CLASS__PARAMETER)))
{
isSafe = FALSE;
}
// update pItfMT in case code:CreateComMethodTableForInterface decided to redirect the interface
pItfMT = pItfComMT->GetMethodTable();
- if (pItfMT == MscorlibBinder::GetExistingClass(CLASS__ICUSTOM_QUERYINTERFACE))
+ if (pItfMT == CoreLibBinder::GetExistingClass(CLASS__ICUSTOM_QUERYINTERFACE))
{
m_flags |= enum_ImplementsICustomQueryInterface;
}
// Eagerly create the interface CMTs.
// when iterate the interfaces implemented by the methodtable, we can check whether
// the interface supports ICustomQueryInterface.
- MscorlibBinder::GetClass(CLASS__ICUSTOM_QUERYINTERFACE);
+ CoreLibBinder::GetClass(CLASS__ICUSTOM_QUERYINTERFACE);
it.Reset();
while (it.Next())
if (m_pICustomQueryInterfaceGetInterfaceMD == NULL)
m_pICustomQueryInterfaceGetInterfaceMD = m_thClass.GetMethodTable()->GetMethodDescForInterfaceMethod(
- MscorlibBinder::GetMethod(METHOD__ICUSTOM_QUERYINTERFACE__GET_INTERFACE),
+ CoreLibBinder::GetMethod(METHOD__ICUSTOM_QUERYINTERFACE__GET_INTERFACE),
TRUE /* throwOnConflict */);
RETURN m_pICustomQueryInterfaceGetInterfaceMD;
}
// Get count of delegates
pCode->EmitLoadThis();
- pCode->EmitLDFLD(pCode->GetToken(MscorlibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_COUNT)));
+ pCode->EmitLDFLD(pCode->GetToken(CoreLibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_COUNT)));
pCode->EmitSTLOC(dwInvocationCountNum);
// initialize counter
// Load next delegate from array using LoopCounter as index
pCode->EmitLoadThis();
- pCode->EmitLDFLD(pCode->GetToken(MscorlibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_LIST)));
+ pCode->EmitLDFLD(pCode->GetToken(CoreLibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_LIST)));
pCode->EmitLDLOC(dwLoopCounterNum);
pCode->EmitLDELEM_REF();
// Load the "real" delegate
pCode->EmitLoadThis();
- pCode->EmitLDFLD(pCode->GetToken(MscorlibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_LIST)));
+ pCode->EmitLDFLD(pCode->GetToken(CoreLibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_LIST)));
// Load the arguments
UINT paramCount = 0;
{
// case 3
if (isCollectible)
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_COLLECTIBLE_VIRTUAL_DISPATCH);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_COLLECTIBLE_VIRTUAL_DISPATCH);
else
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_VIRTUAL_DISPATCH);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_VIRTUAL_DISPATCH);
}
else
{
// case 2, 6
if (isCollectible)
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_COLLECTIBLE_OPENED);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_COLLECTIBLE_OPENED);
else
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_OPENED);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_OPENED);
}
Stub *pShuffleThunk = NULL;
if (!pTargetMethod->IsStatic() && pTargetMethod->HasRetBuffArg() && IsRetBuffPassedAsFirstArg())
pTargetMethod->GetMethodTable()->IsValueType() && !pTargetMethod->IsUnboxingStub();
if (needsRuntimeInfo)
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_RT_CLOSED);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_RT_CLOSED);
else
{
if (!isStatic)
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_CLOSED);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_CLOSED);
else
{
if (isCollectible)
{
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_COLLECTIBLE_CLOSED_STATIC);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_COLLECTIBLE_CLOSED_STATIC);
pCtorData->pArg3 = pTargetMethodLoaderAllocator->GetLoaderAllocatorObjectHandle();
}
else
{
- pRealCtor = MscorlibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_CLOSED_STATIC);
+ pRealCtor = CoreLibBinder::GetMethod(METHOD__MULTICAST_DELEGATE__CTOR_CLOSED_STATIC);
}
}
}
EX_TRY
{
- MethodTable *pMT = MscorlibBinder::GetClass(CLASS__UNHANDLED_EVENTARGS);
+ MethodTable *pMT = CoreLibBinder::GetClass(CLASS__UNHANDLED_EVENTARGS);
*pOutEventArgs = AllocateObject(pMT);
MethodDescCallSite ctor(METHOD__UNHANDLED_EVENTARGS__CTOR, pOutEventArgs);
if (pModule->IsResource())
{
- refArrClasses = (PTRARRAYREF) AllocateObjectArray(0, MscorlibBinder::GetClass(CLASS__CLASS));
+ refArrClasses = (PTRARRAYREF) AllocateObjectArray(0, CoreLibBinder::GetClass(CLASS__CLASS));
RETURN(OBJECTREFToObject(refArrClasses));
}
// Allocate the COM+ array
bSystemAssembly = (pModule->GetAssembly() == SystemDomain::SystemAssembly());
AllocSize = dwNumTypeDefs;
- refArrClasses = (PTRARRAYREF) AllocateObjectArray(AllocSize, MscorlibBinder::GetClass(CLASS__CLASS));
+ refArrClasses = (PTRARRAYREF) AllocateObjectArray(AllocSize, CoreLibBinder::GetClass(CLASS__CLASS));
int curPos = 0;
OBJECTREF throwable = 0;
typedef DPTR(class MethodDescChunk) PTR_MethodDescChunk;
typedef DPTR(class MethodImpl) PTR_MethodImpl;
typedef DPTR(class MethodTable) PTR_MethodTable;
-typedef DPTR(class MscorlibBinder) PTR_MscorlibBinder;
+typedef DPTR(class CoreLibBinder) PTR_CoreLibBinder;
typedef VPTR(class Module) PTR_Module;
typedef DPTR(class NDirectMethodDesc) PTR_NDirectMethodDesc;
typedef DPTR(class Thread) PTR_Thread;
#include "clrconfig.h"
#include "compatibilityswitch.h"
-FCIMPL2(StringObject*, CompatibilitySwitch::GetValue, StringObject* switchNameUNSAFE, CLR_BOOL onlyDB) {
+FCIMPL1(StringObject*, CompatibilitySwitch::GetValue, StringObject* switchNameUNSAFE) {
CONTRACTL {
FCALL_CHECK;
}
HELPER_METHOD_FRAME_BEGIN_RET_1(name);
CLRConfig::ConfigStringInfo info;
info.name = name->GetBuffer();
- if(onlyDB)
- {
- // for public managed apis we ignore checking in registry/config/env
- // only check in windows appcompat DB
- info.options = CLRConfig::IgnoreEnv |
- CLRConfig::IgnoreHKLM |
- CLRConfig::IgnoreHKCU;
- }
- else
- {
- // for mscorlib (i.e. which use internal apis) also check in
- // registry/config/env in addition to windows appcompat DB
- info.options = CLRConfig::EEConfig_default;
- }
+ info.options = CLRConfig::EEConfig_default;
LPWSTR strVal = CLRConfig::GetConfigValue(info);
refName = StringObject::NewString(strVal);
HELPER_METHOD_FRAME_END();
class CompatibilitySwitch
{
public:
- static FCDECL2(StringObject*, GetValue, StringObject *switchNameUNSAFE, CLR_BOOL onlyDB);
+ static FCDECL1(StringObject*, GetValue, StringObject *switchNameUNSAFE);
};
AssemblySpec spec;
spec.InitializeSpec(TokenFromRid(1, mdtAssembly), pImage->GetMDImport(), NULL);
- if (spec.IsMscorlib())
+ if (spec.IsCoreLib())
{
pAssembly = SystemDomain::System()->SystemAssembly();
}
if (!pAssembly->IsSystem())
{
- // It is possible to get through a compile without calling BindAssemblySpec on mscorlib. This
- // is because refs to mscorlib are short circuited in a number of places. So, we will explicitly
+ // It is possible to get through a compile without calling BindAssemblySpec on CoreLib. This
+ // is because refs to CoreLib are short circuited in a number of places. So, we will explicitly
// add it to our dependencies.
- AssemblySpec mscorlib;
- mscorlib.InitializeSpec(SystemDomain::SystemFile());
- GetAppDomain()->BindAssemblySpec(&mscorlib,TRUE);
-
- if (!IsReadyToRunCompilation() && !SystemDomain::SystemFile()->HasNativeImage())
- {
- return NGEN_E_SYS_ASM_NI_MISSING;
- }
+ AssemblySpec corelib;
+ corelib.InitializeSpec(SystemDomain::SystemFile());
+ GetAppDomain()->BindAssemblySpec(&corelib,TRUE);
}
if (IsReadyToRunCompilation() && !pModule->GetFile()->IsILOnly())
COOPERATIVE_TRANSITION_END();
}
-CORINFO_MODULE_HANDLE CEECompileInfo::GetLoaderModuleForMscorlib()
+CORINFO_MODULE_HANDLE CEECompileInfo::GetLoaderModuleForCoreLib()
{
STANDARD_VM_CONTRACT;
{
STANDARD_VM_CONTRACT;
- Module * pInfoModule = MscorlibBinder::GetModule();
+ Module * pInfoModule = CoreLibBinder::GetModule();
SigPointer ptr((PCCOR_SIGNATURE)signature);
// Override the default ObjectComparer for special cases
//
if (elemTypeHnd.CanCastTo(
- TypeHandle(MscorlibBinder::GetClass(CLASS__ICOMPARABLEGENERIC)).Instantiate(Instantiation(&elemTypeHnd, 1))))
+ TypeHandle(CoreLibBinder::GetClass(CLASS__ICOMPARABLEGENERIC)).Instantiate(Instantiation(&elemTypeHnd, 1))))
{
ss.Set(W("System.Collections.Generic.GenericComparer`1"));
return;
{
Instantiation nullableInst = elemTypeHnd.AsMethodTable()->GetInstantiation();
if (nullableInst[0].CanCastTo(
- TypeHandle(MscorlibBinder::GetClass(CLASS__ICOMPARABLEGENERIC)).Instantiate(nullableInst)))
+ TypeHandle(CoreLibBinder::GetClass(CLASS__ICOMPARABLEGENERIC)).Instantiate(nullableInst)))
{
ss.Set(W("System.Collections.Generic.NullableComparer`1"));
inst = nullableInst;
// Override the default ObjectEqualityComparer for special cases
//
if (elemTypeHnd.CanCastTo(
- TypeHandle(MscorlibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(Instantiation(&elemTypeHnd, 1))))
+ TypeHandle(CoreLibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(Instantiation(&elemTypeHnd, 1))))
{
ss.Set(W("System.Collections.Generic.GenericEqualityComparer`1"));
return;
{
Instantiation nullableInst = elemTypeHnd.AsMethodTable()->GetInstantiation();
if (nullableInst[0].CanCastTo(
- TypeHandle(MscorlibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(nullableInst)))
+ TypeHandle(CoreLibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(nullableInst)))
{
ss.Set(W("System.Collections.Generic.NullableEqualityComparer`1"));
inst = nullableInst;
pMT = pMT->GetCanonicalMethodTable();
- // The TypeDependencyAttribute attribute is currently only allowed on mscorlib types
+ // The TypeDependencyAttribute attribute is currently only allowed on CoreLib types
// Don't even look for the attribute on types in other assemblies.
if(!pMT->GetModule()->IsSystem()) {
return;
TypeHandle typicalDepTH = TypeName::GetTypeUsingCASearchRules(ss.GetUnicode(), pMT->GetAssembly());
_ASSERTE(!typicalDepTH.IsNull());
- // This attribute is currently only allowed to refer to mscorlib types
+ // This attribute is currently only allowed to refer to CoreLib types
_ASSERTE(typicalDepTH.GetModule()->IsSystem());
if (!typicalDepTH.GetModule()->IsSystem())
continue;
// For IList<T>, ICollection<T>, IEnumerable<T>, IReadOnlyCollection<T> & IReadOnlyList<T>, include SZArrayHelper's
// generic methods (or at least the relevant ones) in the ngen image in
// case someone casts a T[] to an IList<T> (or ICollection<T> or IEnumerable<T>, etc).
- if (MscorlibBinder::IsClass(typicalDepTH.AsMethodTable(), CLASS__SZARRAYHELPER))
+ if (CoreLibBinder::IsClass(typicalDepTH.AsMethodTable(), CLASS__SZARRAYHELPER))
{
#ifdef FEATURE_FULL_NGEN
if (pMT->GetNumGenericArgs() != 1 || !pMT->IsInterface()) {
METHOD__SZARRAYHELPER__REMOVEAT, // Last method of IList<T>
};
- // Assuming the binder ID's are properly laid out in mscorlib.h
+ // Assuming the binder ID's are properly laid out in corelib.h
#if _DEBUG
for(unsigned int i=0; i < NumItems(LastMethodOnGenericArrayInterfaces) - 1; i++) {
_ASSERTE(LastMethodOnGenericArrayInterfaces[i] < LastMethodOnGenericArrayInterfaces[i+1]);
}
#endif
- MethodTable* pExactMT = MscorlibBinder::GetClass(CLASS__SZARRAYHELPER);
+ MethodTable* pExactMT = CoreLibBinder::GetClass(CLASS__SZARRAYHELPER);
// Subtract one from the non-generic IEnumerable that the generic IEnumerable<T>
// inherits from.
if (SZArrayHelperMethodIDs[i] > LastMethodOnGenericArrayInterfaces[inheritanceDepth])
continue;
- MethodDesc * pPrimaryMD = MscorlibBinder::GetMethod(SZArrayHelperMethodIDs[i]);
+ MethodDesc * pPrimaryMD = CoreLibBinder::GetMethod(SZArrayHelperMethodIDs[i]);
MethodDesc * pInstantiatedMD = MethodDesc::FindOrCreateAssociatedMethodDesc(pPrimaryMD,
pExactMT, false, Instantiation(&elemTypeHnd, 1), false);
else
if (MethodIsVisibleOutsideItsAssembly(pMD))
{
- // We are inlining only leaf methods, except for mscorlib. Thus we can assume that only methods
+ // We are inlining only leaf methods, except for CoreLib. Thus we can assume that only methods
// visible outside its assembly are likely to be inlined.
region = CORCOMPILE_ILREGION_INLINEABLE;
}
if (pFile)
{
DomainAssembly *pAssembly = GetAppDomain()->LoadDomainAssembly(NULL, pFile, FILE_LOAD_CREATE);
- // Note that this can trigger an assembly load (of mscorlib)
+ // Note that this can trigger an assembly load (of CoreLib)
pAssembly->GetOptimizedIdentitySignature(&pDependency->signAssemblyDef);
// This assert prevents dependencies from silently being loaded without being recorded.
_ASSERTE(m_pEmit);
- // Normalize any reference to mscorlib; we don't want to record other non-canonical
- // mscorlib references in the ngen image since fusion doesn't understand how to bind them.
+ // Normalize any reference to CoreLib; we don't want to record other non-canonical
+ // CoreLib references in the ngen image since fusion doesn't understand how to bind them.
// (Not to mention the fact that they are redundant.)
AssemblySpec spec;
- if (pRefSpec->IsMscorlib())
+ if (pRefSpec->IsCoreLib())
{
- _ASSERTE(pFile); // mscorlib had better not be missing
+ _ASSERTE(pFile); // CoreLib had better not be missing
if (!pFile)
return E_UNEXPECTED;
- // Don't store a binding from mscorlib to itself.
+ // Don't store a binding from CoreLib to itself.
if (m_pTargetAssembly == SystemDomain::SystemAssembly())
return S_OK;
}
else if (m_pTargetAssembly == NULL && pFile)
{
- // If target assembly is still NULL, we must be loading either the target assembly or mscorlib.
- // Mscorlib is already handled above, so we must be loading the target assembly if we get here.
+ // If target assembly is still NULL, we must be loading either the target assembly or CoreLib.
+ // CoreLib is already handled above, so we must be loading the target assembly if we get here.
// Use the assembly name given in the target assembly so that the native image is deterministic
// regardless of how the target assembly is specified on the command line.
spec.InitializeSpec(pFile);
//
// CoreCLR does not have attributes for fine grained eager binding control.
- // We hard bind to mscorlib.dll only.
+ // We hard bind to CoreLib only.
//
return targetModule->IsSystem();
}
LPWSTR *pHardBindList,
DWORD cHardBindList);
- CORINFO_MODULE_HANDLE GetLoaderModuleForMscorlib();
+ CORINFO_MODULE_HANDLE GetLoaderModuleForCoreLib();
CORINFO_MODULE_HANDLE GetLoaderModuleForEmbeddableType(CORINFO_CLASS_HANDLE classHandle);
CORINFO_MODULE_HANDLE GetLoaderModuleForEmbeddableMethod(CORINFO_METHOD_HANDLE methodHandle);
CORINFO_MODULE_HANDLE GetLoaderModuleForEmbeddableField(CORINFO_FIELD_HANDLE fieldHandle);
_ASSERTE(pMeth);
MethodDescCallSite invokeMethod(pMeth, &gc.orDelegate);
- if (MscorlibBinder::IsClass(gc.orDelegate->GetMethodTable(), CLASS__PARAMETERIZEDTHREADSTART))
+ if (CoreLibBinder::IsClass(gc.orDelegate->GetMethodTable(), CLASS__PARAMETERIZEDTHREADSTART))
{
//Parameterized ThreadStart
ARG_SLOT arg[2];
// To avoid reflection trying to bypass deserialization tracking, check the caller
// and only allow SerializationInfo to call into this method.
MethodTable* pCallerMT = SystemDomain::GetCallersType(stackMark);
- if (pCallerMT != MscorlibBinder::GetClass(CLASS__SERIALIZATION_INFO))
+ if (pCallerMT != CoreLibBinder::GetClass(CLASS__SERIALIZATION_INFO))
{
COMPlusThrowArgumentException(W("stackMark"), NULL);
}
orState = ObjectFromHandle(((DelegateInfo*) args->delegateInfo)->m_stateHandle);
#ifdef _DEBUG
- MethodDesc *pMeth = MscorlibBinder::GetMethod(METHOD__TPWAITORTIMER_HELPER__PERFORM_WAITORTIMER_CALLBACK);
+ MethodDesc *pMeth = CoreLibBinder::GetMethod(METHOD__TPWAITORTIMER_HELPER__PERFORM_WAITORTIMER_CALLBACK);
LogCall(pMeth,"RWSOCallback");
#endif
// we set processed to TRUE, now it's our responsibility to guarantee proper cleanup
#ifdef _DEBUG
- MethodDesc *pMeth = MscorlibBinder::GetMethod(METHOD__IOCB_HELPER__PERFORM_IOCOMPLETION_CALLBACK);
+ MethodDesc *pMeth = CoreLibBinder::GetMethod(METHOD__IOCB_HELPER__PERFORM_IOCOMPLETION_CALLBACK);
LogCall(pMeth,"IOCallback");
#endif
CONTRACTL_END;
#ifdef _DEBUG
- MethodDesc *pMeth = MscorlibBinder::GetMethod(METHOD__TIMER_QUEUE__APPDOMAIN_TIMER_CALLBACK);
+ MethodDesc *pMeth = CoreLibBinder::GetMethod(METHOD__TIMER_QUEUE__APPDOMAIN_TIMER_CALLBACK);
LogCall(pMeth,"AppDomainTimerCallback");
#endif
if (!classMT->IsZapped())
{
- // If mscorlib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
+ // If CoreLib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
// to detect match reliably
if (MethodTable::GetMethodDescForSlotAddress(actual) == MethodTable::GetMethodDescForSlotAddress(base))
{
return FALSE;
}
- MethodTable* valueTypeMT = MscorlibBinder::GetClass(CLASS__VALUE_TYPE);
- WORD slotEquals = MscorlibBinder::GetMethod(METHOD__VALUE_TYPE__EQUALS)->GetSlot();
- WORD slotGetHashCode = MscorlibBinder::GetMethod(METHOD__VALUE_TYPE__GET_HASH_CODE)->GetSlot();
+ MethodTable* valueTypeMT = CoreLibBinder::GetClass(CLASS__VALUE_TYPE);
+ WORD slotEquals = CoreLibBinder::GetMethod(METHOD__VALUE_TYPE__EQUALS)->GetSlot();
+ WORD slotGetHashCode = CoreLibBinder::GetMethod(METHOD__VALUE_TYPE__GET_HASH_CODE)->GetSlot();
// Check the input type.
if (HasOverriddenMethod(mt, valueTypeMT, slotEquals)
if (!g_pStreamMT->IsZapped())
{
- // If mscorlib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
+ // If CoreLib is JITed, the slots can be patched and thus we need to compare the actual MethodDescs
// to detect match reliably
if (MethodTable::GetMethodDescForSlotAddress(actual) == MethodTable::GetMethodDescForSlotAddress(base))
return false;
if (g_pStreamMT == NULL || g_slotBeginRead == 0 || g_slotEndRead == 0)
{
HELPER_METHOD_FRAME_BEGIN_RET_1(stream);
- g_pStreamMT = MscorlibBinder::GetClass(CLASS__STREAM);
- g_slotBeginRead = MscorlibBinder::GetMethod(METHOD__STREAM__BEGIN_READ)->GetSlot();
- g_slotEndRead = MscorlibBinder::GetMethod(METHOD__STREAM__END_READ)->GetSlot();
+ g_pStreamMT = CoreLibBinder::GetClass(CLASS__STREAM);
+ g_slotBeginRead = CoreLibBinder::GetMethod(METHOD__STREAM__BEGIN_READ)->GetSlot();
+ g_slotEndRead = CoreLibBinder::GetMethod(METHOD__STREAM__END_READ)->GetSlot();
HELPER_METHOD_FRAME_END();
}
if (g_pStreamMT == NULL || g_slotBeginWrite == 0 || g_slotEndWrite == 0)
{
HELPER_METHOD_FRAME_BEGIN_RET_1(stream);
- g_pStreamMT = MscorlibBinder::GetClass(CLASS__STREAM);
- g_slotBeginWrite = MscorlibBinder::GetMethod(METHOD__STREAM__BEGIN_WRITE)->GetSlot();
- g_slotEndWrite = MscorlibBinder::GetMethod(METHOD__STREAM__END_WRITE)->GetSlot();
+ g_pStreamMT = CoreLibBinder::GetClass(CLASS__STREAM);
+ g_slotBeginWrite = CoreLibBinder::GetMethod(METHOD__STREAM__BEGIN_WRITE)->GetSlot();
+ g_slotEndWrite = CoreLibBinder::GetMethod(METHOD__STREAM__END_WRITE)->GetSlot();
HELPER_METHOD_FRAME_END();
}
STANDARD_VM_CHECK;
PRECONDITION(CheckPointer(pResult));
PRECONDITION(CheckPointer(pAppDomain));
- PRECONDITION(IsMscorlib() == FALSE); // This should never be called for MSCORLIB (explicit loading)
+ PRECONDITION(IsCoreLib() == FALSE); // This should never be called for CoreLib (explicit loading)
}
CONTRACTL_END;
ReleaseHolder<ICLRPrivAssembly> pPrivAsm;
_ASSERTE(pBinder != NULL);
- if (m_wszCodeBase == NULL && IsMscorlibSatellite())
+ if (m_wszCodeBase == NULL && IsCoreLibSatellite())
{
StackSString sSystemDirectory(SystemDomain::System()->SystemDirectory());
StackSString tmpString;
BOOL Found();
PEImage* GetPEImage();
- BOOL IsMscorlib();
+ BOOL IsCoreLib();
void GetBindAssembly(ICLRPrivAssembly** ppAssembly);
#ifdef FEATURE_PREJIT
BOOL HasNativeImage();
return (m_pAssembly!=NULL);
};
-inline BOOL CoreBindResult::IsMscorlib()
+inline BOOL CoreBindResult::IsCoreLib()
{
CONTRACTL
{
BINDER_SPACE::Assembly* pAssembly = BINDER_SPACE::GetAssemblyFromPrivAssemblyFast(m_pAssembly);
#ifndef CROSSGEN_COMPILE
- return pAssembly->GetAssemblyName()->IsMscorlib();
+ return pAssembly->GetAssemblyName()->IsCoreLib();
#else
return (pAssembly->GetPath()).EndsWithCaseInsensitive(SString(CoreLibName_IL_W));
#endif
//
-// This file defines tables for references between VM and mscorlib.
+// This file defines tables for references between VM and corelib.
//
// When compiling crossgen, this file is compiled with the FEATURE_XXX define settings matching the target.
// It allows us to strip features (e.g. refection only load) from crossgen without stripping them from the target.
//
-#ifdef CROSSGEN_MSCORLIB
+#ifdef CROSSGEN_CORELIB
// Use minimal set of headers for crossgen
#include "windows.h"
#include "corinfo.h"
#else
#include "common.h"
#include "ecall.h"
-#endif // CROSSGEN_MSCORLIB
+#endif // CROSSGEN_CORELIB
#ifndef CROSSGEN_COMPILE
//
#include "tailcallhelp.h"
-#endif // CROSSGEN_MSCORLIB
+#endif // CROSSGEN_CORELIB
-#ifdef CROSSGEN_MSCORLIB
+#ifdef CROSSGEN_CORELIB
///////////////////////////////////////////////////////////////////////////////
//
FCFuncFlag_EndOfArray = 0x01,
FCFuncFlag_HasSignature = 0x02,
FCFuncFlag_Unreferenced = 0x04, // Suppress unused fcall check
- FCFuncFlag_QCall = 0x08, // QCall - mscorlib.dll to mscorwks.dll transition implemented as PInvoke
+ FCFuncFlag_QCall = 0x08, // QCall - CoreLib to VM transition implemented as PInvoke
};
struct ECClass
#undef TYPEINFO
#define DEFINE_CLASS(i,n,s) CLASS__ ## i,
-#include "mscorlib.h"
+#include "corelib.h"
- CLASS__MSCORLIB_COUNT,
+ CLASS__CORELIB_COUNT,
CLASS__VOID = CLASS__ELEMENT_TYPE_VOID,
CLASS__BOOLEAN = CLASS__ELEMENT_TYPE_BOOLEAN,
CLASS__OBJECT = CLASS__ELEMENT_TYPE_OBJECT
};
-struct MscorlibClassDescription
+struct CoreLibClassDescription
{
LPCSTR nameSpace;
LPCSTR name;
};
-struct MscorlibMethodDescription
+struct CoreLibMethodDescription
{
BinderClassID classID;
LPCSTR name;
const HardCodedMetaSig * sig;
};
-struct MscorlibFieldDescription
+struct CoreLibFieldDescription
{
BinderClassID classID;
LPCSTR name;
};
-#endif // CROSSGEN_MSCORLIB
+#endif // CROSSGEN_CORELIB
-#ifdef CROSSGEN_MSCORLIB
+#ifdef CROSSGEN_CORELIB
// When compiling crossgen this namespace creates the second version of the tables than matches the target
-namespace CrossGenMscorlib {
+namespace CrossGenCoreLib {
#endif
///////////////////////////////////////////////////////////////////////////////
//
-// Mscorlib binder
+// CoreLib binder
//
// Extern definitions so that binder.cpp can see these tables
-extern const MscorlibClassDescription c_rgMscorlibClassDescriptions[];
-extern const USHORT c_nMscorlibClassDescriptions;
+extern const CoreLibClassDescription c_rgCoreLibClassDescriptions[];
+extern const USHORT c_nCoreLibClassDescriptions;
-extern const MscorlibMethodDescription c_rgMscorlibMethodDescriptions[];
-extern const USHORT c_nMscorlibMethodDescriptions;
+extern const CoreLibMethodDescription c_rgCoreLibMethodDescriptions[];
+extern const USHORT c_nCoreLibMethodDescriptions;
-extern const MscorlibFieldDescription c_rgMscorlibFieldDescriptions[];
-extern const USHORT c_nMscorlibFieldDescriptions;
+extern const CoreLibFieldDescription c_rgCoreLibFieldDescriptions[];
+extern const USHORT c_nCoreLibFieldDescriptions;
-const MscorlibClassDescription c_rgMscorlibClassDescriptions[] =
+const CoreLibClassDescription c_rgCoreLibClassDescriptions[] =
{
#define TYPEINFO(e,ns,c,s,g,ia,ip,if,im,gv) { ns, c },
#include "cortypeinfo.h"
#define DEFINE_CLASS(i,n,s) { g_ ## n ## NS, # s },
#include "namespace.h"
- #include "mscorlib.h"
+ #include "corelib.h"
- // Include all exception types here that are defined in mscorlib. Omit exceptions defined elsewhere.
+ // Include all exception types here that are defined in corelib. Omit exceptions defined elsewhere.
#define DEFINE_EXCEPTION(ns, reKind, bHRformessage, ...) { ns , # reKind },
#include "rexcep.h"
};
-const USHORT c_nMscorlibClassDescriptions = NumItems(c_rgMscorlibClassDescriptions);
+const USHORT c_nCoreLibClassDescriptions = NumItems(c_rgCoreLibClassDescriptions);
#define gsig_NoSig (*(HardCodedMetaSig *)NULL)
-const MscorlibMethodDescription c_rgMscorlibMethodDescriptions[] =
+const CoreLibMethodDescription c_rgCoreLibMethodDescriptions[] =
{
#define DEFINE_METHOD(c,i,s,g) { CLASS__ ## c , # s, & gsig_ ## g },
- #include "mscorlib.h"
+ #include "corelib.h"
};
-const USHORT c_nMscorlibMethodDescriptions = NumItems(c_rgMscorlibMethodDescriptions) + 1;
+const USHORT c_nCoreLibMethodDescriptions = NumItems(c_rgCoreLibMethodDescriptions) + 1;
-const MscorlibFieldDescription c_rgMscorlibFieldDescriptions[] =
+const CoreLibFieldDescription c_rgCoreLibFieldDescriptions[] =
{
#define DEFINE_FIELD(c,i,s) { CLASS__ ## c , # s },
- #include "mscorlib.h"
+ #include "corelib.h"
};
-const USHORT c_nMscorlibFieldDescriptions = NumItems(c_rgMscorlibFieldDescriptions) + 1;
+const USHORT c_nCoreLibFieldDescriptions = NumItems(c_rgCoreLibFieldDescriptions) + 1;
///////////////////////////////////////////////////////////////////////////////
//
EXTERN_C const LPVOID gPalGlobalizationNative[];
// When compiling crossgen, we only need the target version of the ecall tables
-#if !defined(CROSSGEN_COMPILE) || defined(CROSSGEN_MSCORLIB)
+#if !defined(CROSSGEN_COMPILE) || defined(CROSSGEN_CORELIB)
#ifdef CROSSGEN_COMPILE
const int c_nECClasses = NumItems(c_rgECClasses);
-#endif // !CROSSGEN_COMPILE && CROSSGEN_MSCORLIB
+#endif // !CROSSGEN_COMPILE && CROSSGEN_CORELIB
-#ifdef CROSSGEN_MSCORLIB
-}; // namespace CrossGenMscorlib
+#ifdef CROSSGEN_CORELIB
+}; // namespace CrossGenCoreLib
#endif
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-// This file contains the classes, methods, and field used by the EE from mscorlib
+// This file contains the classes, methods, and field used by the EE from corelib
//
// To use this, define one of the following macros & include the file like so:
// #define DEFINE_CLASS(id, nameSpace, stringName) CLASS__ ## id,
// #define DEFINE_METHOD(classId, id, stringName, gSign)
// #define DEFINE_FIELD(classId, id, stringName)
-// #include "mscorlib.h"
+// #include "corelib.h"
//
// Note: To determine if the namespace you want to use in DEFINE_CLASS is supported or not,
// examine vm\namespace.h. If it is not present, define it there and then proceed to use it below.
../contractimpl.cpp
../coreassemblyspec.cpp
../corebindresult.cpp
+ ../corelib.cpp
../crossgencompile.cpp
../custommarshalerinfo.cpp
../dataimage.cpp
../methodtable.cpp
../methodtablebuilder.cpp
../mlinfo.cpp
- ../mscorlib.cpp
../nativeimage.cpp
../olevariant.cpp
../pefile.cpp
../comdelegate.h
../compile.h
../contractimpl.h
+ ../corelib.h
../custommarshalerinfo.h
../dataimage.h
../debuginfostore.h
../methodtablebuilder.h
../methodtablebuilder.inl
../mlinfo.h
- ../mscorlib.h
../olevariant.h
../pefile.h
../pefile.inl
set_target_properties(cee_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
target_precompile_header(TARGET cee_crossgen HEADER common.h)
if (MSVC)
- # mscorlib.cpp does not compile with precompiled header file
- set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
+ # corelib.cpp does not compile with precompiled header file
+ set_source_files_properties(../corelib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
endif()
-add_library_clr(mscorlib_crossgen ../mscorlib.cpp)
-add_dependencies(mscorlib_crossgen eventing_headers)
-target_compile_definitions(mscorlib_crossgen
+add_library_clr(corelib_crossgen ../corelib.cpp)
+add_dependencies(corelib_crossgen eventing_headers)
+target_compile_definitions(corelib_crossgen
PRIVATE
EnC_SUPPORTED
FEATURE_EVENT_TRACE
FEATURE_MULTICOREJIT
- CROSSGEN_MSCORLIB)
+ CROSSGEN_CORELIB)
-set_target_properties(mscorlib_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
+set_target_properties(corelib_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
LAHASHKEYTOTRACKERSREF hashKeyToTrackers;
OBJECTREF keyValueStore;
- if (hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)hashKeyEntry;
keyValueStore = hashKeyToTrackers->_laLocalKeyValueStore;
LAHASHKEYTOTRACKERSREF hashKeyToTrackers;
OBJECTREF keyValueStore;
- if (hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)hashKeyEntry;
keyValueStore = hashKeyToTrackers->_laLocalKeyValueStore;
if (pLoaderAllocatorOfValue != m_pLoaderAllocator)
{
- gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)AllocateObject(MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS));
+ gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)AllocateObject(CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS));
SetObjectReference(&gc.hashKeyToTrackers->_laLocalKeyValueStore, gc.keyValueStore);
gc.hashKeyEntry = gc.hashKeyToTrackers;
}
{
gc.keyToTrackersHash.GetElement(index, gc.hashKeyEntry);
- if (gc.hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (gc.hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)gc.hashKeyEntry;
gc.keyValueStore = gc.hashKeyToTrackers->_laLocalKeyValueStore;
if (gc.hashKeyToTrackers == NULL)
{
// Nothing has yet caused the trackers proxy object to be setup. Create it now, and update the keyToTrackersHash
- gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)AllocateObject(MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS));
+ gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)AllocateObject(CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS));
SetObjectReference(&gc.hashKeyToTrackers->_laLocalKeyValueStore, gc.keyValueStore);
gc.hashKeyEntry = gc.hashKeyToTrackers;
gc.keyToTrackersHash.SetElement(index, gc.hashKeyEntry);
{
gc.keyToTrackersHash.GetElement(index, gc.hashKeyEntry);
- if (gc.hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (gc.hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)gc.hashKeyEntry;
gc.keyValueStore = gc.hashKeyToTrackers->_laLocalKeyValueStore;
// We have an entry in the hashtable for the key/dependenthandle.
gc.keyToTrackersHash.GetElement(index, gc.hashKeyEntry);
- if (gc.hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (gc.hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)gc.hashKeyEntry;
gc.keyValueStore = gc.hashKeyToTrackers->_laLocalKeyValueStore;
{
// Is there a single dependenttracker here, or a set.
- if (gc.hashKeyToTrackers->_trackerOrTrackerSet->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER))
+ if (gc.hashKeyToTrackers->_trackerOrTrackerSet->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER))
{
gc.dependentTracker = (LAHASHDEPENDENTHASHTRACKERREF)gc.hashKeyToTrackers->_trackerOrTrackerSet;
result = VisitTracker(key, gc.dependentTracker, visitor);
// We have an entry in the hashtable for the key/dependenthandle.
gc.keyToTrackersHash.GetElement(index, gc.hashKeyEntry);
- if (gc.hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (gc.hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)gc.hashKeyEntry;
gc.keyValueStore = gc.hashKeyToTrackers->_laLocalKeyValueStore;
{
// Is there a single dependenttracker here, or a set.
- if (gc.hashKeyToTrackers->_trackerOrTrackerSet->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER))
+ if (gc.hashKeyToTrackers->_trackerOrTrackerSet->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER))
{
gc.dependentTracker = (LAHASHDEPENDENTHASHTRACKERREF)gc.hashKeyToTrackers->_trackerOrTrackerSet;
DeleteEntryTracker(key, gc.dependentTracker);
GCPROTECT_BEGIN(gc);
{
- if (gc.hashKeyEntry->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
+ if (gc.hashKeyEntry->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHKEYTOTRACKERS))
{
gc.hashKeyToTrackers = (LAHASHKEYTOTRACKERSREF)gc.hashKeyEntry;
gc.keyValueStore = gc.hashKeyToTrackers->_laLocalKeyValueStore;
{
STANDARD_VM_CONTRACT;
- // Force these types to be loaded, so that the hashtable logic can use MscorlibBinder::GetExistingClass
+ // Force these types to be loaded, so that the hashtable logic can use CoreLibBinder::GetExistingClass
// throughout and avoid lock ordering issues
- MscorlibBinder::GetClass(CLASS__LAHASHKEYTOTRACKERS);
- MscorlibBinder::GetClass(CLASS__LAHASHDEPENDENTHASHTRACKER);
- MscorlibBinder::GetClass(CLASS__GCHEAPHASH);
- TypeHandle elemType = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_I1));
+ CoreLibBinder::GetClass(CLASS__LAHASHKEYTOTRACKERS);
+ CoreLibBinder::GetClass(CLASS__LAHASHDEPENDENTHASHTRACKER);
+ CoreLibBinder::GetClass(CLASS__GCHEAPHASH);
+ TypeHandle elemType = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_I1));
TypeHandle typHnd = ClassLoader::LoadArrayTypeThrowing(elemType, ELEMENT_TYPE_SZARRAY, 0);
- elemType = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_OBJECT));
+ elemType = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_OBJECT));
typHnd = ClassLoader::LoadArrayTypeThrowing(elemType, ELEMENT_TYPE_SZARRAY, 0);
}
if (m_loaderAllocatorToDependentTrackerHash == NULL)
{
- OBJECTREF laToDependentHandleHashObject = AllocateObject(MscorlibBinder::GetExistingClass(CLASS__GCHEAPHASH));
+ OBJECTREF laToDependentHandleHashObject = AllocateObject(CoreLibBinder::GetExistingClass(CLASS__GCHEAPHASH));
m_loaderAllocatorToDependentTrackerHash = m_pLoaderAllocator->GetDomain()->CreateHandle(laToDependentHandleHashObject);
m_pLoaderAllocator->RegisterHandleForCleanup(m_loaderAllocatorToDependentTrackerHash);
}
if (m_keyToDependentTrackersHash == NULL)
{
- OBJECTREF m_keyToDependentTrackersHashObject = AllocateObject(MscorlibBinder::GetExistingClass(CLASS__GCHEAPHASH));
+ OBJECTREF m_keyToDependentTrackersHashObject = AllocateObject(CoreLibBinder::GetExistingClass(CLASS__GCHEAPHASH));
m_keyToDependentTrackersHash = m_pLoaderAllocator->GetDomain()->CreateHandle(m_keyToDependentTrackersHashObject);
m_pLoaderAllocator->RegisterHandleForCleanup(m_keyToDependentTrackersHash);
}
}
else
{
- gc.dependentTracker = (LAHASHDEPENDENTHASHTRACKERREF)AllocateObject(MscorlibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER));
- gc.GCHeapHashForKeyToValueStore = (GCHEAPHASHOBJECTREF)AllocateObject(MscorlibBinder::GetExistingClass(CLASS__GCHEAPHASH));
+ gc.dependentTracker = (LAHASHDEPENDENTHASHTRACKERREF)AllocateObject(CoreLibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER));
+ gc.GCHeapHashForKeyToValueStore = (GCHEAPHASHOBJECTREF)AllocateObject(CoreLibBinder::GetExistingClass(CLASS__GCHEAPHASH));
OBJECTREF exposedObject = pLoaderAllocator->GetExposedObject();
if (exposedObject == NULL)
if (m_globalDependentTrackerRootHandle == NULL)
{
// Global LoaderAllocator does not have an exposed object, so create a fake one
- exposedObject = AllocateObject(MscorlibBinder::GetExistingClass(CLASS__OBJECT));
+ exposedObject = AllocateObject(CoreLibBinder::GetExistingClass(CLASS__OBJECT));
m_globalDependentTrackerRootHandle = GetAppDomain()->CreateHandle(exposedObject);
m_pLoaderAllocator->RegisterHandleForCleanup(m_globalDependentTrackerRootHandle);
}
gc.dependentTracker = GetDependentTrackerForLoaderAllocator(pValueLoaderAllocator);
SetObjectReference(&gc.hashKeyToTrackers->_trackerOrTrackerSet, gc.dependentTracker);
}
- else if (gc.hashKeyToTrackers->_trackerOrTrackerSet->GetMethodTable() == MscorlibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER))
+ else if (gc.hashKeyToTrackers->_trackerOrTrackerSet->GetMethodTable() == CoreLibBinder::GetExistingClass(CLASS__LAHASHDEPENDENTHASHTRACKER))
{
gc.dependentTrackerMaybe = (LAHASHDEPENDENTHASHTRACKERREF)gc.hashKeyToTrackers->_trackerOrTrackerSet;
if (gc.dependentTrackerMaybe->IsTrackerFor(pValueLoaderAllocator))
{
// Allocate the dependent tracker hash
// Fill with the existing dependentTrackerMaybe, and gc.DependentTracker
- gc.dependentTrackerHash = GCHeapHashDependentHashTrackerHash(AllocateObject(MscorlibBinder::GetExistingClass(CLASS__GCHEAPHASH)));
+ gc.dependentTrackerHash = GCHeapHashDependentHashTrackerHash(AllocateObject(CoreLibBinder::GetExistingClass(CLASS__GCHEAPHASH)));
LoaderAllocator *pLoaderAllocatorKey = gc.dependentTracker->GetLoaderAllocatorUnsafe();
gc.dependentTrackerHash.Add(&pLoaderAllocatorKey, [&gc](PTRARRAYREF arr, INT32 index)
{
if (length != (ULONG)-1)
{
- gc.array = (CaValueArrayREF)AllocateSzArray(TypeHandle(MscorlibBinder::GetClass(CLASS__CUSTOM_ATTRIBUTE_ENCODED_ARGUMENT)).MakeSZArray(), length);
+ gc.array = (CaValueArrayREF)AllocateSzArray(TypeHandle(CoreLibBinder::GetClass(CLASS__CUSTOM_ATTRIBUTE_ENCODED_ARGUMENT)).MakeSZArray(), length);
CustomAttributeValue* pValues = gc.array->GetDirectPointerToNonObjectElements();
for (COUNT_T i = 0; i < length; i ++)
{
// load the proper type so that code in managed knows which property to load
if (fieldType == SERIALIZATION_TYPE_STRING)
- *pType = MscorlibBinder::GetElementType(ELEMENT_TYPE_STRING)->GetManagedClassObject();
+ *pType = CoreLibBinder::GetElementType(ELEMENT_TYPE_STRING)->GetManagedClassObject();
else if (fieldType == SERIALIZATION_TYPE_TYPE)
- *pType = MscorlibBinder::GetClass(CLASS__TYPE)->GetManagedClassObject();
+ *pType = CoreLibBinder::GetClass(CLASS__TYPE)->GetManagedClassObject();
}
break;
case SERIALIZATION_TYPE_SZARRAY:
{
_ASSERTE(!bObjectCreated);
if (arrayType == SERIALIZATION_TYPE_STRING)
- nullTH = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_STRING));
+ nullTH = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_STRING));
else if (arrayType == SERIALIZATION_TYPE_TYPE)
- nullTH = TypeHandle(MscorlibBinder::GetClass(CLASS__TYPE));
+ nullTH = TypeHandle(CoreLibBinder::GetClass(CLASS__TYPE));
else if (arrayType == SERIALIZATION_TYPE_TAGGED_OBJECT)
nullTH = TypeHandle(g_pObjectClass);
ReadArray(pCtorAssembly, arrayType, arraySize, nullTH, &pBlob, pBlobEnd, pModule, (BASEARRAYREF*)value);
switch (arrayType)
{
case SERIALIZATION_TYPE_STRING:
- arrayTH = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_STRING));
+ arrayTH = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_STRING));
break;
case SERIALIZATION_TYPE_TYPE:
- arrayTH = TypeHandle(MscorlibBinder::GetClass(CLASS__TYPE));
+ arrayTH = TypeHandle(CoreLibBinder::GetClass(CLASS__TYPE));
break;
case SERIALIZATION_TYPE_TAGGED_OBJECT:
arrayTH = TypeHandle(g_pObjectClass);
break;
default:
if (SERIALIZATION_TYPE_BOOLEAN <= arrayType && arrayType <= SERIALIZATION_TYPE_R8)
- arrayTH = TypeHandle(MscorlibBinder::GetElementType((CorElementType)arrayType));
+ arrayTH = TypeHandle(CoreLibBinder::GetElementType((CorElementType)arrayType));
}
if (!arrayTH.IsNull())
{
}
default:
if (SERIALIZATION_TYPE_BOOLEAN <= fieldType && fieldType <= SERIALIZATION_TYPE_R8)
- pMTValue = MscorlibBinder::GetElementType((CorElementType)fieldType);
+ pMTValue = CoreLibBinder::GetElementType((CorElementType)fieldType);
else if(fieldType == SERIALIZATION_TYPE_ENUM)
fieldType = (CorSerializationType)pMTValue->GetInternalCorElementType();
else
case SERIALIZATION_TYPE_U8:
case SERIALIZATION_TYPE_R8:
case SERIALIZATION_TYPE_STRING:
- pMTType = MscorlibBinder::GetElementType((CorElementType)objType);
+ pMTType = CoreLibBinder::GetElementType((CorElementType)objType);
RtnTypeHnd = TypeHandle(pMTType);
break;
case ELEMENT_TYPE_CLASS:
- pMTType = MscorlibBinder::GetClass(CLASS__TYPE);
+ pMTType = CoreLibBinder::GetClass(CLASS__TYPE);
RtnTypeHnd = TypeHandle(pMTType);
break;
goto stringType;
else if (pMT == g_pObjectClass)
goto typeObject;
- else if (MscorlibBinder::IsClass(pMT, CLASS__TYPE))
+ else if (CoreLibBinder::IsClass(pMT, CLASS__TYPE))
goto typeType;
}
// Make sure the custom marshaller implements ICustomMarshaler.
- if (!hndCustomMarshalerType.GetMethodTable()->CanCastToInterface(MscorlibBinder::GetClass(CLASS__ICUSTOM_MARSHALER)))
+ if (!hndCustomMarshalerType.GetMethodTable()->CanCastToInterface(CoreLibBinder::GetClass(CLASS__ICUSTOM_MARSHALER)))
{
DefineFullyQualifiedNameForClassW()
COMPlusThrow(kApplicationException,
MethodTable *pMT = hndCustomMarshalertype.AsMethodTable();
- _ASSERTE(pMT->CanCastToInterface(MscorlibBinder::GetClass(CLASS__ICUSTOM_MARSHALER)));
+ _ASSERTE(pMT->CanCastToInterface(CoreLibBinder::GetClass(CLASS__ICUSTOM_MARSHALER)));
MethodDesc *pMD = NULL;
{
case CustomMarshalerMethods_MarshalNativeToManaged:
pMD = pMT->GetMethodDescForInterfaceMethod(
- MscorlibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__MARSHAL_NATIVE_TO_MANAGED),
+ CoreLibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__MARSHAL_NATIVE_TO_MANAGED),
TRUE /* throwOnConflict */);
break;
case CustomMarshalerMethods_MarshalManagedToNative:
pMD = pMT->GetMethodDescForInterfaceMethod(
- MscorlibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__MARSHAL_MANAGED_TO_NATIVE),
+ CoreLibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__MARSHAL_MANAGED_TO_NATIVE),
TRUE /* throwOnConflict */);
break;
case CustomMarshalerMethods_CleanUpNativeData:
pMD = pMT->GetMethodDescForInterfaceMethod(
- MscorlibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__CLEANUP_NATIVE_DATA),
+ CoreLibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__CLEANUP_NATIVE_DATA),
TRUE /* throwOnConflict */);
break;
case CustomMarshalerMethods_CleanUpManagedData:
pMD = pMT->GetMethodDescForInterfaceMethod(
- MscorlibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__CLEANUP_MANAGED_DATA),
+ CoreLibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__CLEANUP_MANAGED_DATA),
TRUE /* throwOnConflict */);
break;
case CustomMarshalerMethods_GetNativeDataSize:
pMD = pMT->GetMethodDescForInterfaceMethod(
- MscorlibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__GET_NATIVE_DATA_SIZE),
+ CoreLibBinder::GetMethod(METHOD__ICUSTOM_MARSHALER__GET_NATIVE_DATA_SIZE),
TRUE /* throwOnConflict */);
break;
case CustomMarshalerMethods_GetInstance:
// internal BCL helpful function doing permission check. From bucketing perspetive it is
// more preferable to report the user managed code that invokes Debugger.Break instead.
//
-// User managed code is managed code in non-system assembly. Currently, only mscorlib.dll
+// User managed code is managed code in non-system assembly. Currently, only CoreLib
// is marked as system assembly.
//
//----------------------------------------------------------------------------
if (pISymUnmanagedReader != NULL)
{
// Found a ISymUnmanagedReader for the regular PDB so don't attempt to
- // read it as a portable PDB in mscorlib's StackFrameHelper.
+ // read it as a portable PDB in CoreLib's StackFrameHelper.
fPortablePDB = FALSE;
ReleaseHolder<ISymUnmanagedMethod> pISymUnmanagedMethod;
GCPROTECT_BEGIN(MemberInfoObj);
{
MethodTable *pMemberInfoClass = MemberInfoObj->GetMethodTable();
- if (MscorlibBinder::IsClass(pMemberInfoClass, CLASS__METHOD))
+ if (CoreLibBinder::IsClass(pMemberInfoClass, CLASS__METHOD))
{
// Retrieve the MethodDesc from the MethodInfo.
MethodDescCallSite getMethodHandle(METHOD__METHOD_BASE__GET_METHODDESC, &MemberInfoObj);
if (pMeth)
pMemberProps = pMemberMap->GetMethodProps(pMeth->GetMemberDef(), pMeth->GetModule());
}
- else if (MscorlibBinder::IsClass(pMemberInfoClass, CLASS__RT_FIELD_INFO))
+ else if (CoreLibBinder::IsClass(pMemberInfoClass, CLASS__RT_FIELD_INFO))
{
MethodDescCallSite getFieldHandle(METHOD__RTFIELD__GET_FIELDHANDLE, &MemberInfoObj);
ARG_SLOT arg = ObjToArgSlot(MemberInfoObj);
if (pFld)
pMemberProps = pMemberMap->GetMethodProps(pFld->GetMemberDef(), pFld->GetModule());
}
- else if (MscorlibBinder::IsClass(pMemberInfoClass, CLASS__PROPERTY))
+ else if (CoreLibBinder::IsClass(pMemberInfoClass, CLASS__PROPERTY))
{
MethodDescCallSite getToken(METHOD__PROPERTY__GET_TOKEN, &MemberInfoObj);
ARG_SLOT arg = ObjToArgSlot(MemberInfoObj);
CONTRACTL_END;
// Load the LCIDConversionAttribute type.
- MethodTable * pLcIdConvAttrClass = MscorlibBinder::GetClass(CLASS__LCID_CONVERSION_TYPE);
+ MethodTable * pLcIdConvAttrClass = CoreLibBinder::GetClass(CLASS__LCID_CONVERSION_TYPE);
// Check to see if the attribute is set.
OBJECTREF MemberInfoObj = GetMemberInfoObject();
{
MethodTable *pMemberInfoMT = MemberInfoObj->GetMethodTable();
- if (MscorlibBinder::IsClass(pMemberInfoMT, CLASS__METHOD))
+ if (CoreLibBinder::IsClass(pMemberInfoMT, CLASS__METHOD))
{
MethodDescCallSite getMethodHandle(METHOD__METHOD_BASE__GET_METHODDESC, &MemberInfoObj);
ARG_SLOT arg = ObjToArgSlot(MemberInfoObj);
if (pMeth)
SetUpMethodMarshalerInfo(pMeth, FALSE);
}
- else if (MscorlibBinder::IsClass(pMemberInfoMT, CLASS__FIELD))
+ else if (CoreLibBinder::IsClass(pMemberInfoMT, CLASS__FIELD))
{
// We don't support non-default marshalling behavior for field getter/setter stubs invoked via IDispatch.
}
- else if (MscorlibBinder::IsClass(pMemberInfoMT, CLASS__PROPERTY))
+ else if (CoreLibBinder::IsClass(pMemberInfoMT, CLASS__PROPERTY))
{
BOOL isGetter = FALSE;
MethodDescCallSite getSetter(METHOD__PROPERTY__GET_SETTER, &MemberInfoObj);
MethodTable *pMemberInfoClass = (*pMemberInfo)->GetMethodTable();
- if (MscorlibBinder::IsClass(pMemberInfoClass, CLASS__PROPERTY))
+ if (CoreLibBinder::IsClass(pMemberInfoClass, CLASS__PROPERTY))
{
// Get the property's MethodDesc
MethodDesc* pMDForProperty = NULL;
MethodDesc *pMD;
// If the current class is the standard implementation then return the cached method desc
- if (MscorlibBinder::IsClass(hndFieldInfoType.GetMethodTable(), CLASS__FIELD))
+ if (CoreLibBinder::IsClass(hndFieldInfoType.GetMethodTable(), CLASS__FIELD))
{
- pMD = MscorlibBinder::GetMethod(Method);
+ pMD = CoreLibBinder::GetMethod(Method);
}
else
{
pMD = MemberLoader::FindMethod(hndFieldInfoType.GetMethodTable(),
- MscorlibBinder::GetMethodName(Method), MscorlibBinder::GetMethodSig(Method));
+ CoreLibBinder::GetMethodName(Method), CoreLibBinder::GetMethodSig(Method));
}
_ASSERTE(pMD && "Unable to find specified FieldInfo method");
MethodDesc *pMD;
// If the current class is the standard implementation then return the cached method desc if present.
- if (MscorlibBinder::IsClass(hndPropInfoType.GetMethodTable(), CLASS__PROPERTY))
+ if (CoreLibBinder::IsClass(hndPropInfoType.GetMethodTable(), CLASS__PROPERTY))
{
- pMD = MscorlibBinder::GetMethod(Method);
+ pMD = CoreLibBinder::GetMethod(Method);
}
else
{
pMD = MemberLoader::FindMethod(hndPropInfoType.GetMethodTable(),
- MscorlibBinder::GetMethodName(Method), MscorlibBinder::GetMethodSig(Method));
+ CoreLibBinder::GetMethodName(Method), CoreLibBinder::GetMethodSig(Method));
}
_ASSERTE(pMD && "Unable to find specified PropertyInfo method");
MethodDesc *pMD;
// If the current class is the standard implementation then return the cached method desc.
- if (MscorlibBinder::IsClass(hndMethodInfoType.GetMethodTable(), CLASS__METHOD))
+ if (CoreLibBinder::IsClass(hndMethodInfoType.GetMethodTable(), CLASS__METHOD))
{
- pMD = MscorlibBinder::GetMethod(Method);
+ pMD = CoreLibBinder::GetMethod(Method);
}
else
{
pMD = MemberLoader::FindMethod(hndMethodInfoType.GetMethodTable(),
- MscorlibBinder::GetMethodName(Method), MscorlibBinder::GetMethodSig(Method));
+ CoreLibBinder::GetMethodName(Method), CoreLibBinder::GetMethodSig(Method));
}
_ASSERTE(pMD && "Unable to find specified MethodInfo method");
CONTRACT_END;
MethodTable *pMT = hndCustomAttrProvider.AsMethodTable();
- MethodDesc *pMD = pMT->GetMethodDescForInterfaceMethod(MscorlibBinder::GetMethod(METHOD__ICUSTOM_ATTR_PROVIDER__GET_CUSTOM_ATTRIBUTES), TRUE /* throwOnConflict */);
+ MethodDesc *pMD = pMT->GetMethodDescForInterfaceMethod(CoreLibBinder::GetMethod(METHOD__ICUSTOM_ATTR_PROVIDER__GET_CUSTOM_ATTRIBUTES), TRUE /* throwOnConflict */);
// Return the specified method desc.
RETURN pMD;
if (m_hndOleAutBinder)
return ObjectFromHandle(m_hndOleAutBinder);
- MethodTable *pOleAutBinderClass = MscorlibBinder::GetClass(CLASS__OLE_AUT_BINDER);
+ MethodTable *pOleAutBinderClass = CoreLibBinder::GetClass(CLASS__OLE_AUT_BINDER);
// Allocate an instance of the OleAutBinder class.
OBJECTREF OleAutBinder = AllocateObject(pOleAutBinderClass);
}
CONTRACT_END;
- RETURN MscorlibBinder::GetMethod(METHOD__CLASS__INVOKE_MEMBER);
+ RETURN CoreLibBinder::GetMethod(METHOD__CLASS__INVOKE_MEMBER);
}
// Virtual method to retrieve the object associated with this DispatchInfo that
CONTRACT_END;
MethodTable *pMT = m_pSimpleWrapperOwner->GetMethodTable();
- MethodDesc *pMD = pMT->GetMethodDescForInterfaceMethod(MscorlibBinder::GetMethod(Method), TRUE /* throwOnConflict */);
+ MethodDesc *pMD = pMT->GetMethodDescForInterfaceMethod(CoreLibBinder::GetMethod(Method), TRUE /* throwOnConflict */);
// Return the specified method desc.
RETURN pMD;
CONTRACT_END;
MethodTable *pMT = m_pSimpleWrapperOwner->GetMethodTable();
- MethodDesc *pMD = pMT->GetMethodDescForInterfaceMethod(MscorlibBinder::GetMethod(Method), TRUE /* throwOnConflict */);
+ MethodDesc *pMD = pMT->GetMethodDescForInterfaceMethod(CoreLibBinder::GetMethod(Method), TRUE /* throwOnConflict */);
// Return the specified method desc.
RETURN pMD;
pcs->EmitCALL(METHOD__CULTURE_INFO__GET_CURRENT_CULTURE, 0, 1);
// save the current culture
- LocalDesc locDescCulture(MscorlibBinder::GetClass(CLASS__CULTURE_INFO));
+ LocalDesc locDescCulture(CoreLibBinder::GetClass(CLASS__CULTURE_INFO));
DWORD dwCultureLocalNum = pcs->NewLocal(locDescCulture);
pcs->EmitSTLOC(dwCultureLocalNum);
MetaSig nsig(
GetStubTargetMethodSig(),
GetStubTargetMethodSigLength(),
- MscorlibBinder::GetModule(),
+ CoreLibBinder::GetModule(),
&typeContext);
CorElementType type;
PCCOR_SIGNATURE pManagedSig;
ULONG cManagedSig;
- IMDInternalImport* pIMDI = MscorlibBinder::GetModule()->GetMDImport();
+ IMDInternalImport* pIMDI = CoreLibBinder::GetModule()->GetMDImport();
pStubMD->GetSig(&pManagedSig, &cManagedSig);
pCleanupStartLabel = pcsSetup->NewCodeLabel();
pReturnLabel = pcsSetup->NewCodeLabel();
- dwExceptionDispatchInfoLocal = pcsSetup->NewLocal(MscorlibBinder::GetClass(CLASS__EXCEPTION_DISPATCH_INFO));
+ dwExceptionDispatchInfoLocal = pcsSetup->NewLocal(CoreLibBinder::GetClass(CLASS__EXCEPTION_DISPATCH_INFO));
pcsSetup->EmitLDNULL();
pcsSetup->EmitSTLOC(dwExceptionDispatchInfoLocal);
SetCleanupNeeded();
// we setup a new local that will hold the cleanup work list
- LocalDesc desc(MscorlibBinder::GetClass(CLASS__CLEANUP_WORK_LIST_ELEMENT));
+ LocalDesc desc(CoreLibBinder::GetClass(CLASS__CLEANUP_WORK_LIST_ELEMENT));
m_dwCleanupWorkListLocalNum = NewLocal(desc);
}
}
m_pcsDispatch->EmitADD();
m_pcsDispatch->EmitLDIND_I(); // get OBJECTHANDLE
m_pcsDispatch->EmitLDIND_REF(); // get Delegate object
- m_pcsDispatch->EmitLDFLD(GetToken(MscorlibBinder::GetField(FIELD__DELEGATE__TARGET)));
+ m_pcsDispatch->EmitLDFLD(GetToken(CoreLibBinder::GetField(FIELD__DELEGATE__TARGET)));
}
}
{
if (SF_IsDelegateStub(dwStubFlags)) // reverse P/Invoke via delegate
{
- int tokDelegate_methodPtr = pcsEmit->GetToken(MscorlibBinder::GetField(FIELD__DELEGATE__METHOD_PTR));
+ int tokDelegate_methodPtr = pcsEmit->GetToken(CoreLibBinder::GetField(FIELD__DELEGATE__METHOD_PTR));
EmitLoadStubContext(pcsEmit, dwStubFlags);
pcsEmit->EmitLDC(offsetof(UMEntryThunk, m_pObjectHandle));
// so we have to special-case it here.
// If a type doesn't have a native representation, we won't set this flag.
// We'll throw an exception later when setting up the marshalling.
- if (pRetMT != MscorlibBinder::GetClass(CLASS__DATE_TIME) && pRetMT->HasLayout() && IsUnmanagedValueTypeReturnedByRef(pRetMT->GetNativeSize()))
+ if (pRetMT != CoreLibBinder::GetClass(CLASS__DATE_TIME) && pRetMT->HasLayout() && IsUnmanagedValueTypeReturnedByRef(pRetMT->GetNativeSize()))
{
ndirectflags |= NDirectMethodDesc::kStdCallWithRetBuf;
}
LocalDesc i4(ELEMENT_TYPE_I4);
sigBuilder.NewArg(&i4);
- LocalDesc cleanupWorkList(MscorlibBinder::GetClass(CLASS__CLEANUP_WORK_LIST_ELEMENT));
+ LocalDesc cleanupWorkList(CoreLibBinder::GetClass(CLASS__CLEANUP_WORK_LIST_ELEMENT));
cleanupWorkList.MakeByRef();
sigBuilder.NewArg(&cleanupWorkList);
if (IsLoaded())
CHECK_OK;
- // Mscorlib is allowed to run managed code much earlier than other
+ // CoreLib is allowed to run managed code much earlier than other
// assemblies for bootstrapping purposes. This is because it has no
// dependencies, security checks, and doesn't rely on loader notifications.
if (IsActive())
CHECK_OK;
- // Mscorlib is allowed to run managed code much earlier than other
+ // CoreLib is allowed to run managed code much earlier than other
// assemblies for bootstrapping purposes. This is because it has no
// dependencies, security checks, and doesn't rely on loader notifications.
if (GetFile()->IsDynamic())
{
- refClass = (REFLECTMODULEBASEREF) AllocateObject(MscorlibBinder::GetClass(CLASS__MODULE_BUILDER));
+ refClass = (REFLECTMODULEBASEREF) AllocateObject(CoreLibBinder::GetClass(CLASS__MODULE_BUILDER));
}
else
{
- refClass = (REFLECTMODULEBASEREF) AllocateObject(MscorlibBinder::GetClass(CLASS__MODULE));
+ refClass = (REFLECTMODULEBASEREF) AllocateObject(CoreLibBinder::GetClass(CLASS__MODULE));
}
refClass->SetModule(m_pModule);
//
- // CoreCLR hard binds to mscorlib.dll only. Avoid going through the full load.
+ // CoreCLR hard binds to CoreLib only. Avoid going through the full load.
//
#ifdef _DEBUG
name.InitializeSpec(pDependency->dwAssemblyRef,
((pManifestNativeImage != NULL) ? pManifestNativeImage : pNativeImage)->GetNativeMDImport(),
GetDomainAssembly());
- _ASSERTE(name.IsMscorlib());
+ _ASSERTE(name.IsCoreLib());
#endif
PEAssembly * pDependencyFile = SystemDomain::SystemFile();
}
else if (IsSystem())
{
- // mscorlib gets loaded before the CompilationDomain gets created.
- // However, we may be ngening mscorlib itself
+ // CoreLib gets loaded before the CompilationDomain gets created.
+ // However, we may be ngening CoreLib itself
fileIsBeingNGened = true;
}
// This is unnecessary because the managed InternalAssemblyBuilder object
// should have already been created at the time of DefineDynamicAssembly
OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED);
- pMT = MscorlibBinder::GetClass(CLASS__INTERNAL_ASSEMBLY_BUILDER);
+ pMT = CoreLibBinder::GetClass(CLASS__INTERNAL_ASSEMBLY_BUILDER);
}
else
{
OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED);
- pMT = MscorlibBinder::GetClass(CLASS__ASSEMBLY);
+ pMT = CoreLibBinder::GetClass(CLASS__ASSEMBLY);
}
// Will be TRUE only if LoaderAllocator managed object was already collected and therefore we should
spec.InitializeSpec(this->GetFile());
// The assembly spec should have the binding context associated with it
- _ASSERTE(spec.GetBindingContext() || spec.IsAssemblySpecForMscorlib());
+ _ASSERTE(spec.GetBindingContext() || spec.IsAssemblySpecForCoreLib());
CORCOMPILE_VERSION_INFO *pVersionInfo = pNativeImage->GetLoadedLayout()->GetNativeVersionInfo();
AssemblySpec name;
name.InitializeSpec(pDependencies->dwAssemblyDef, pNativeImage->GetNativeMDImport(), this);
- if (!name.IsAssemblySpecForMscorlib())
+ if (!name.IsAssemblySpecForCoreLib())
{
// We just initialized the assembly spec for the NI dependency. This will not have binding context
// associated with it, so set it from that of the parent.
{
ReasonForRejectingNativeImage_NoNiForManifestModule = 0x101,
ReasonForRejectingNativeImage_DependencyNotNative = 0x102,
- ReasonForRejectingNativeImage_MscorlibNotNative = 0x103,
+ ReasonForRejectingNativeImage_CoreLibNotNative = 0x103,
ReasonForRejectingNativeImage_FailedSecurityCheck = 0x104,
ReasonForRejectingNativeImage_DependencyIdentityMismatch = 0x105,
ReasonForRejectingNativeImage_CannotShareNiAssemblyNotDomainNeutral = 0x106,
PTR_MethodTable pMT = obj->GetMethodTable();
- if (MscorlibBinder::IsException(pMT, kContractException))
+ if (CoreLibBinder::IsException(pMT, kContractException))
return CONTRACTEXCEPTIONREF(obj)->GetContractFailureKind();
// there are cases where the code contracts rewriter will use a ContractException
ContractFailureKind result = CONTRACT_FAILURE_INVARIANT;
// first compare the exception name.
- PTR_MethodTable pContractExceptionMT = MscorlibBinder::GetClassIfExist(CLASS__CONTRACTEXCEPTION);
+ PTR_MethodTable pContractExceptionMT = CoreLibBinder::GetClassIfExist(CLASS__CONTRACTEXCEPTION);
_ASSERTE(pContractExceptionMT);
if (pContractExceptionMT)
#ifndef DACCESS_COMPILE
#ifdef CROSSGEN_COMPILE
-namespace CrossGenMscorlib
+namespace CrossGenCoreLib
{
extern const ECClass c_rgECClasses[];
extern const int c_nECClasses;
};
-using namespace CrossGenMscorlib;
+using namespace CrossGenCoreLib;
#else // CROSSGEN_COMPILE
extern const ECClass c_rgECClasses[];
extern const int c_nECClasses;
add any void-returning metasig declarations if they haven't already been defined elsewhere.
search "String_RetUtf8Str" for an example of how to do this.
-- src/vm/mscorlib.h, search "DEFINE_CLASS(UTF8_STRING" and add the new DEFINE_METHOD
+- src/vm/corelib.h, search "DEFINE_CLASS(UTF8_STRING" and add the new DEFINE_METHOD
declarations for the Utf8String-returning Ctor methods, referencing the new metasig declarations.
**********/
_ASSERTE(g_pStringClass != NULL);
for (int i = 0; i < NumberOfStringConstructors; i++)
{
- MethodDesc* pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__STRING__CTORF_FIRST + i));
+ MethodDesc* pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__STRING__CTORF_FIRST + i));
_ASSERTE(pMD != NULL);
PCODE pDest = pMD->GetMultiCallableAddrOfCode();
_ASSERTE(g_pUtf8StringClass != NULL);
for (int i = 0; i < NumberOfUtf8StringConstructors; i++)
{
- MethodDesc* pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__UTF8STRING__CTORF_FIRST + i));
+ MethodDesc* pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__UTF8STRING__CTORF_FIRST + i));
_ASSERTE(pMD != NULL);
PCODE pDest = pMD->GetMultiCallableAddrOfCode();
STANDARD_VM_CONTRACT;
- MethodDesc* pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFANY));
+ MethodDesc* pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFANY));
PCODE pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFANY, pDest);
// array cast uses the "ANY" helper
// When interface table uses indirect references, just set interface casts to "ANY" helper
SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFINTERFACE, pDest);
#else
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFINTERFACE));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFINTERFACE));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFINTERFACE, pDest);
#endif
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFCLASS));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__ISINSTANCEOFCLASS));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_ISINSTANCEOFCLASS, pDest);
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTANY));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTANY));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_CHKCASTANY, pDest);
// array cast uses the "ANY" helper
// When interface table uses indirect references, just set interface casts to "ANY" handler
SetJitHelperFunction(CORINFO_HELP_CHKCASTINTERFACE, pDest);
#else
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTINTERFACE));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTINTERFACE));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_CHKCASTINTERFACE, pDest);
#endif
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTCLASS));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTCLASS));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_CHKCASTCLASS, pDest);
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTCLASSSPECIAL));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__CHKCASTCLASSSPECIAL));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_CHKCASTCLASS_SPECIAL, pDest);
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__UNBOX));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__UNBOX));
pDest = pMD->GetMultiCallableAddrOfCode();
SetJitHelperFunction(CORINFO_HELP_UNBOX, pDest);
//TODO: revise if this specialcasing is still needed when crossgen supports tailcall optimizations
// see: https://github.com/dotnet/runtime/issues/5857
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__STELEMREF));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__STELEMREF));
pMD->DoPrestub(NULL);
// This helper is marked AggressiveOptimization and its native code is in its final form.
// Get the code directly to avoid PreStub indirection.
pDest = pMD->GetNativeCode();
SetJitHelperFunction(CORINFO_HELP_ARRADDR_ST, pDest);
- pMD = MscorlibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__LDELEMAREF));
+ pMD = CoreLibBinder::GetMethod((BinderMethodID)(METHOD__CASTHELPERS__LDELEMAREF));
pMD->DoPrestub(NULL);
// This helper is marked AggressiveOptimization and its native code is in its final form.
// Get the code directly to avoid PreStub indirection.
if (cur->HasSignature())
{
- Signature sig = MscorlibBinder::GetTargetSignature(cur->m_pMethodSig);
+ Signature sig = CoreLibBinder::GetTargetSignature(cur->m_pMethodSig);
//@GENERICS: none of these methods belong to generic classes so there is no instantiation info to pass in
if (!MetaSig::CompareMethodSigs(pMethodSig, cbMethodSigLen, pModule, NULL,
- sig.GetRawSig(), sig.GetRawSigLen(), MscorlibBinder::GetModule(), NULL, FALSE))
+ sig.GetRawSig(), sig.GetRawSigLen(), CoreLibBinder::GetModule(), NULL, FALSE))
{
continue;
}
// We need to set up the ECFunc properly. We don't want to use the pMD passed in,
// since it may disappear. Instead, use the stable one on Delegate. Remember
// that this is 1:M between the FCall and the pMDs.
- return GetFCallImpl(MscorlibBinder::GetMethod(METHOD__DELEGATE__CONSTRUCT_DELEGATE));
+ return GetFCallImpl(CoreLibBinder::GetMethod(METHOD__DELEGATE__CONSTRUCT_DELEGATE));
}
// COM imported classes have special constructors
//
// You'll see this assert in several situations, almost all being the fault of whomever
// last touched a particular ecall or fcall method, either here or in the classlibs.
- // However, you must also ensure you don't have stray copies of mscorlib.dll on your machine.
+ // However, you must also ensure you don't have stray copies of System.Private.CoreLib.dll on your machine.
// 1) You forgot to add your class to c_rgECClasses, the list of classes w/ ecall & fcall methods.
// 2) You forgot to add your particular method to the ECFunc array for your class.
// 3) You misspelled the name of your function and/or classname.
// 4) The signature of the managed function doesn't match the hardcoded metadata signature
// listed in your ECFunc array. The hardcoded metadata sig is only necessary to disambiguate
// overloaded ecall functions - usually you can leave it set to NULL.
- // 5) Your copy of mscorlib.dll & mscoree.dll are out of sync - rebuild both.
- // 6) You've loaded the wrong copy of mscorlib.dll. In msdev's debug menu,
- // select the "Modules..." dialog. Verify the path for mscorlib is right.
+ // 5) Your copy of System.Private.CoreLib.dll & coreclr.dll are out of sync - rebuild both.
+ // 6) You've loaded the wrong copy of System.Private.CoreLib.dll. In Visual Studio's debug menu,
+ // select the "Modules..." dialog. Verify the path for System.Private.CoreLib is right.
// 7) Someone mucked around with how the signatures in metasig.h are parsed, changing the
// interpretation of a part of the signature (this is very rare & extremely unlikely,
// but has happened at least once).
if (!usedIDs.Contains(id))
{
- printf("CheckMscorlibExtended: Unused ecall found: %s.%s::%s\n", pECClass->m_szNameSpace, c_rgECClasses[ImplsIndex].m_szClassName, ptr->m_szMethodName);
+ printf("CheckCoreLibExtended: Unused ecall found: %s.%s::%s\n", pECClass->m_szNameSpace, c_rgECClasses[ImplsIndex].m_szClassName, ptr->m_szMethodName);
fUnusedFCallsFound = TRUE;
continue;
}
if (fUnreferencedType)
{
- printf("CheckMscorlibExtended: Unused type found: %s.%s\n", c_rgECClasses[ImplsIndex].m_szNameSpace, c_rgECClasses[ImplsIndex].m_szClassName);
+ printf("CheckCoreLibExtended: Unused type found: %s.%s\n", c_rgECClasses[ImplsIndex].m_szNameSpace, c_rgECClasses[ImplsIndex].m_szClassName);
fUnusedFCallsFound = TRUE;
continue;
}
return(CORINFO_INTRINSIC_Illegal);
}
- // All intrinsic live in mscorlib.dll (FindECFuncForMethod does not work for non-mscorlib intrinsics)
+ // All intrinsic live in CoreLib (FindECFuncForMethod does not work for non-CoreLib intrinsics)
if (!pMD->GetModule()->IsSystem())
{
return(CORINFO_INTRINSIC_Illegal);
FCFuncFlag_EndOfArray = 0x01,
FCFuncFlag_HasSignature = 0x02,
FCFuncFlag_Unreferenced = 0x04, // Suppress unused fcall check
- FCFuncFlag_QCall = 0x08, // QCall - mscorlib.dll to mscorwks.dll transition implemented as PInvoke
+ FCFuncFlag_QCall = 0x08, // QCall - CoreLib to VM transition implemented as PInvoke
};
struct ECFunc {
FCFuncEnd()
FCFuncStart(gCompatibilitySwitchFuncs)
- FCFuncElement("GetValueInternalCall", CompatibilitySwitch::GetValue)
+ FCFuncElement("GetValueInternal", CompatibilitySwitch::GetValue)
FCFuncEnd()
FCFuncStart(gMdUtf8String)
// Lookup operations run the class loader in non-load mode.
ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE();
- MethodTable *m = MscorlibBinder::GetElementType(et);
+ MethodTable *m = CoreLibBinder::GetElementType(et);
return TypeHandle(m);
}
}
CONTRACTL_END;
- MethodTable *m = MscorlibBinder::GetElementType(et);
+ MethodTable *m = CoreLibBinder::GetElementType(et);
if (m == NULL)
{
// the OBJECTREF address so we need to hand out something else that is hooked up to the handle.
GCPROTECT_BEGIN(thisPointer);
- MethodTable *pHelperMT = MscorlibBinder::GetClass(CLASS__ENC_HELPER);
+ MethodTable *pHelperMT = CoreLibBinder::GetClass(CLASS__ENC_HELPER);
pEntry->m_FieldData = pDomain->CreateDependentHandle(thisPointer, AllocateObject(pHelperMT));
GCPROTECT_END();
GCPROTECT_BEGIN (obj);
// Get a FieldDesc for the object reference field in the EnC helper object (warning: triggers)
- FieldDesc *pHelperField = MscorlibBinder::GetField(FIELD__ENC_HELPER__OBJECT_REFERENCE);
+ FieldDesc *pHelperField = CoreLibBinder::GetField(FIELD__ENC_HELPER__OBJECT_REFERENCE);
// store the empty boxed object into the helper object
IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager();
// We _HAVE_ to call GetExistingField b/c (a) we can't throw exceptions, and
// (b) we _DON'T_ want to run class init code, either.
- pHelperFieldDesc = MscorlibBinder::GetExistingField(FIELD__ENC_HELPER__OBJECT_REFERENCE);
+ pHelperFieldDesc = CoreLibBinder::GetExistingField(FIELD__ENC_HELPER__OBJECT_REFERENCE);
if (pHelperFieldDesc == NULL)
{
return NULL;
FieldDesc * pHelperField = NULL;
GCPROTECT_BEGIN (pHelper);
- pHelperField = MscorlibBinder::GetField(FIELD__ENC_HELPER__OBJECT_REFERENCE);
+ pHelperField = CoreLibBinder::GetField(FIELD__ENC_HELPER__OBJECT_REFERENCE);
GCPROTECT_END ();
return GetEnCFieldAddrFromHelperFieldDesc(pHelperField, pHelper, pFD);
BYTE *minmumMetadata = new BYTE[MinimumMetadataLength];
BYTE *currentPtr = minmumMetadata;
- // the order of fields is defined in coreclr\src\mscorlib\shared\System\Diagnostics\Tracing\EventSource.cs DefineEventPipeEvents method
+ // the order of fields is defined in EventSource.cs DefineEventPipeEvents method
memcpy(currentPtr, &m_eventID, sizeof(m_eventID));
currentPtr += sizeof(m_eventID);
_ASSERTE(pExInfo != NULL);
bIsNestedException = (pExInfo->GetPreviousExceptionTracker() != NULL);
bIsCLSCompliant = IsException((gc.exceptionObj)->GetMethodTable()) &&
- ((gc.exceptionObj)->GetMethodTable() != MscorlibBinder::GetException(kRuntimeWrappedException));
+ ((gc.exceptionObj)->GetMethodTable() != CoreLibBinder::GetException(kRuntimeWrappedException));
// A rethrown exception is also a nested exception
// but since we have a separate flag for it, lets unset the nested flag
GCPROTECT_BEGIN(throwable)
{
// This should only be called for AccessViolationException
- _ASSERTE(MscorlibBinder::GetException(kAccessViolationException) == throwable->GetMethodTable());
+ _ASSERTE(CoreLibBinder::GetException(kAccessViolationException) == throwable->GetMethodTable());
- FieldDesc *pFD_ip = MscorlibBinder::GetField(FIELD__ACCESS_VIOLATION_EXCEPTION__IP);
- FieldDesc *pFD_target = MscorlibBinder::GetField(FIELD__ACCESS_VIOLATION_EXCEPTION__TARGET);
- FieldDesc *pFD_access = MscorlibBinder::GetField(FIELD__ACCESS_VIOLATION_EXCEPTION__ACCESSTYPE);
+ FieldDesc *pFD_ip = CoreLibBinder::GetField(FIELD__ACCESS_VIOLATION_EXCEPTION__IP);
+ FieldDesc *pFD_target = CoreLibBinder::GetField(FIELD__ACCESS_VIOLATION_EXCEPTION__TARGET);
+ FieldDesc *pFD_access = CoreLibBinder::GetField(FIELD__ACCESS_VIOLATION_EXCEPTION__ACCESSTYPE);
_ASSERTE(pFD_ip->GetFieldType() == ELEMENT_TYPE_I);
_ASSERTE(pFD_target->GetFieldType() == ELEMENT_TYPE_I);
{
// idempotent operations, so the race condition is okay.
if (pMT_RuntimeWrappedException == NULL)
- pMT_RuntimeWrappedException = MscorlibBinder::GetException(kRuntimeWrappedException);
+ pMT_RuntimeWrappedException = CoreLibBinder::GetException(kRuntimeWrappedException);
if (pFD_WrappedException == NULL)
- pFD_WrappedException = MscorlibBinder::GetField(FIELD__RUNTIME_WRAPPED_EXCEPTION__WRAPPED_EXCEPTION);
+ pFD_WrappedException = CoreLibBinder::GetField(FIELD__RUNTIME_WRAPPED_EXCEPTION__WRAPPED_EXCEPTION);
- OBJECTREF orWrapper = AllocateObject(MscorlibBinder::GetException(kRuntimeWrappedException));
+ OBJECTREF orWrapper = AllocateObject(CoreLibBinder::GetException(kRuntimeWrappedException));
GCPROTECT_BEGIN(orWrapper);
// in the code that follows.
if (!isAlreadyCreating.GetValue()) {
pThread->SetIsCreatingTypeInitException();
- pMT = MscorlibBinder::GetException(kTypeInitializationException);
+ pMT = CoreLibBinder::GetException(kTypeInitializationException);
methodID = METHOD__TYPE_INIT_EXCEPTION__STR_EX_CTOR;
}
else {
MethodTable *pThrowableMT = (*pThrowable)->GetMethodTable();
- // IsExceptionOfType is supported for mscorlib exception types only
- _ASSERTE(reKind <= kLastExceptionInMscorlib);
- return MscorlibBinder::IsException(pThrowableMT, reKind);
+ return CoreLibBinder::IsException(pThrowableMT, reKind);
}
BOOL IsAsyncThreadException(OBJECTREF *pThrowable) {
switch (dwExceptionCode)
{
case STATUS_ACCESS_VIOLATION:
- if (throwable != NULL && MscorlibBinder::IsException(throwable->GetMethodTable(), kNullReferenceException))
+ if (throwable != NULL && CoreLibBinder::IsException(throwable->GetMethodTable(), kNullReferenceException))
return FALSE;
break;
case STATUS_STACK_OVERFLOW:
switch(notificationType)
{
case FirstChanceExceptionHandler:
- pMTEventArgs = MscorlibBinder::GetClass(CLASS__FIRSTCHANCE_EVENTARGS);
+ pMTEventArgs = CoreLibBinder::GetClass(CLASS__FIRSTCHANCE_EVENTARGS);
idEventArgsCtor = METHOD__FIRSTCHANCE_EVENTARGS__CTOR;
break;
default:
// Do we have handler(s) of the specific type wired up?
if (notificationType == FirstChanceExceptionHandler)
{
- return MscorlibBinder::GetField(FIELD__APPCONTEXT__FIRST_CHANCE_EXCEPTION)->GetStaticOBJECTREF() != NULL;
+ return CoreLibBinder::GetField(FIELD__APPCONTEXT__FIRST_CHANCE_EXCEPTION)->GetStaticOBJECTREF() != NULL;
}
else
{
// Get the reference to the delegate based upon the type of notification
if (notificationType == FirstChanceExceptionHandler)
{
- gc.oNotificationDelegate = MscorlibBinder::GetField(FIELD__APPCONTEXT__FIRST_CHANCE_EXCEPTION)->GetStaticOBJECTREF();
+ gc.oNotificationDelegate = CoreLibBinder::GetField(FIELD__APPCONTEXT__FIRST_CHANCE_EXCEPTION)->GetStaticOBJECTREF();
}
else
{
CONTRACTL_END;
REFLECTFIELDREF retVal;
- REFLECTFIELDREF fieldRef = (REFLECTFIELDREF)AllocateObject(MscorlibBinder::GetClass(CLASS__STUBFIELDINFO));
+ REFLECTFIELDREF fieldRef = (REFLECTFIELDREF)AllocateObject(CoreLibBinder::GetClass(CLASS__STUBFIELDINFO));
GCPROTECT_BEGIN(fieldRef);
fieldRef->SetField(this);
#endif
break;
case MarshalInfo::MARSHAL_TYPE_CURRENCY:
- *pNFD = NativeFieldDescriptor(pFD, MscorlibBinder::GetClass(CLASS__CURRENCY));
+ *pNFD = NativeFieldDescriptor(pFD, CoreLibBinder::GetClass(CLASS__CURRENCY));
break;
case MarshalInfo::MARSHAL_TYPE_DECIMAL:
// The decimal type can't be blittable since the managed and native alignment requirements differ.
// Native needs 8-byte alignment since one field is a 64-bit integer, but managed only needs 4-byte alignment since all fields are ints.
- *pNFD = NativeFieldDescriptor(pFD, MscorlibBinder::GetClass(CLASS__NATIVEDECIMAL));
+ *pNFD = NativeFieldDescriptor(pFD, CoreLibBinder::GetClass(CLASS__NATIVEDECIMAL));
break;
case MarshalInfo::MARSHAL_TYPE_GUID:
- *pNFD = NativeFieldDescriptor(pFD, MscorlibBinder::GetClass(CLASS__GUID));
+ *pNFD = NativeFieldDescriptor(pFD, CoreLibBinder::GetClass(CLASS__GUID));
break;
case MarshalInfo::MARSHAL_TYPE_DATE:
*pNFD = NativeFieldDescriptor(pFD, NativeFieldCategory::FLOAT, sizeof(double), sizeof(double));
break;
#ifdef FEATURE_COMINTEROP
case MarshalInfo::MARSHAL_TYPE_OBJECT:
- *pNFD = NativeFieldDescriptor(pFD, MscorlibBinder::GetClass(CLASS__NATIVEVARIANT));
+ *pNFD = NativeFieldDescriptor(pFD, CoreLibBinder::GetClass(CLASS__NATIVEVARIANT));
break;
#endif
case MarshalInfo::MARSHAL_TYPE_SAFEHANDLE:
if (pMT->IsEnum())
{
- pMT = MscorlibBinder::GetElementType(pMT->GetInternalCorElementType());
+ pMT = CoreLibBinder::GetElementType(pMT->GetInternalCorElementType());
}
*pNFD = NativeFieldDescriptor(pFD, OleVariant::GetNativeMethodTableForVarType(mops.elementType, pMT), mops.additive);
break;
}
case MarshalInfo::MARSHAL_TYPE_FIXED_CSTR:
- *pNFD = NativeFieldDescriptor(pFD, MscorlibBinder::GetClass(CLASS__BYTE), pargs->fs.fixedStringLength);
+ *pNFD = NativeFieldDescriptor(pFD, CoreLibBinder::GetClass(CLASS__BYTE), pargs->fs.fixedStringLength);
break;
case MarshalInfo::MARSHAL_TYPE_FIXED_WSTR:
- *pNFD = NativeFieldDescriptor(pFD, MscorlibBinder::GetClass(CLASS__UINT16), pargs->fs.fixedStringLength);
+ *pNFD = NativeFieldDescriptor(pFD, CoreLibBinder::GetClass(CLASS__UINT16), pargs->fs.fixedStringLength);
break;
case MarshalInfo::MARSHAL_TYPE_UNKNOWN:
default:
{
isBlittable = false;
}
- else if (valueTypeHandle.GetMethodTable() == MscorlibBinder::GetClass(CLASS__DECIMAL))
+ else if (valueTypeHandle.GetMethodTable() == CoreLibBinder::GetClass(CLASS__DECIMAL))
{
// The alignment requirements of the managed System.Decimal type do not match the native DECIMAL type.
// As a result, a field of type System.Decimal can't be blittable.
// Fetch the proper array type
if (g_pPredefinedArrayTypes[type] == NULL)
{
- TypeHandle elemType = TypeHandle(MscorlibBinder::GetElementType(type));
+ TypeHandle elemType = TypeHandle(CoreLibBinder::GetElementType(type));
TypeHandle typHnd = ClassLoader::LoadArrayTypeThrowing(elemType, ELEMENT_TYPE_SZARRAY, 0);
g_pPredefinedArrayTypes[type] = typHnd;
}
refTypeInfo.SuppressRelease();
TypeInfoBase* lengthTypeInfo = GetTypeInfoFromTypeHandle(
- TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_I4)), pTypeMap, method);
+ TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_I4)), pTypeMap, method);
TypeInfoBase* valTypeInfo = GetTypeInfoFromTypeHandle(typeHandle.GetArrayElementTypeHandle(), pTypeMap, method);
info->m_array_type = new ArrayTypeInfo(typeHandle, 1, valTypeInfo);
if (pMT->GetRank() != 1)
{
- TypeHandle dwordArray(MscorlibBinder::GetElementType(ELEMENT_TYPE_I4));
+ TypeHandle dwordArray(CoreLibBinder::GetElementType(ELEMENT_TYPE_I4));
info->m_array_bounds_type = new ArrayTypeInfo(dwordArray.MakeSZArray(), pMT->GetRank(), lengthTypeInfo);
info->members[2].m_member_name = new char[9];
strcpy(info->members[2].m_member_name, "m_Bounds");
Module * pContainingZapModule = ExecutionManager::FindZapModule(dac_cast<TADDR>(signature));
- zapSigContext = ZapSig::Context(MscorlibBinder::GetModule(), (void *)pContainingZapModule, ZapSig::NormalTokens);
+ zapSigContext = ZapSig::Context(CoreLibBinder::GetModule(), (void *)pContainingZapModule, ZapSig::NormalTokens);
pZapSigContext = (pContainingZapModule != NULL) ? &zapSigContext : NULL;
}
- Module * pLookupModule = (isReadyToRunModule) ? pZapSigContext->pInfoModule : MscorlibBinder::GetModule();
+ Module * pLookupModule = (isReadyToRunModule) ? pZapSigContext->pInfoModule : CoreLibBinder::GetModule();
if (pMT != NULL)
{
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(GetManagedTypeBinderID()));
+ return LocalDesc(CoreLibBinder::GetClass(GetManagedTypeBinderID()));
}
LocalDesc ILReflectionObjectMarshaler::GetNativeType()
{
STANDARD_VM_CONTRACT;
- int tokObject__m_handle = pslILEmit->GetToken(MscorlibBinder::GetField(GetObjectFieldID()));
+ int tokObject__m_handle = pslILEmit->GetToken(CoreLibBinder::GetField(GetObjectFieldID()));
int tokStruct__m_object = 0;
BinderFieldID structField = GetStructureFieldID();
// marshaling a struct referring to an object containing a handle.
if (structField != 0)
{
- tokStruct__m_object = pslILEmit->GetToken(MscorlibBinder::GetField(structField));
+ tokStruct__m_object = pslILEmit->GetToken(CoreLibBinder::GetField(structField));
}
ILCodeLabel* pNullLabel = pslILEmit->NewCodeLabel();
LocalDesc locDesc = GetManagedType();
locDesc.MakePinned();
DWORD dwPinnedLocal = pslILEmit->NewLocal(locDesc);
- int fieldDef = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__STRING__M_FIRST_CHAR));
+ int fieldDef = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__STRING__M_FIRST_CHAR));
ILCodeLabel* pNullRefLabel = pslILEmit->NewCodeLabel();
pslILEmit->EmitLoadNullPtr();
LocalDesc ILUTF8BufferMarshaler::GetManagedType()
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__STRING_BUILDER));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__STRING_BUILDER));
}
void ILUTF8BufferMarshaler::EmitConvertSpaceCLRToNative(ILCodeStream* pslILEmit)
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__STRING_BUILDER));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__STRING_BUILDER));
}
void ILWSTRBufferMarshaler::EmitConvertSpaceCLRToNative(ILCodeStream* pslILEmit)
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__STRING_BUILDER));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__STRING_BUILDER));
}
void ILCSTRBufferMarshaler::EmitConvertSpaceCLRToNative(ILCodeStream* pslILEmit)
// stack: capacity
- pslILEmit->EmitLDSFLD(pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__MARSHAL__SYSTEM_MAX_DBCS_CHAR_SIZE)));
+ pslILEmit->EmitLDSFLD(pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__MARSHAL__SYSTEM_MAX_DBCS_CHAR_SIZE)));
pslILEmit->EmitMUL_OVF();
// stack: capacity_in_bytes
{
STANDARD_VM_CONTRACT;
- return LocalDesc(TypeHandle(MscorlibBinder::GetClass(CLASS__NATIVEVARIANT)));
+ return LocalDesc(TypeHandle(CoreLibBinder::GetClass(CLASS__NATIVEVARIANT)));
}
LocalDesc ILObjectMarshaler::GetManagedType()
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__DATE_TIME));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__DATE_TIME));
}
void ILDateMarshaler::EmitConvertContentsCLRToNative(ILCodeStream* pslILEmit)
{
STANDARD_VM_CONTRACT;
- return LocalDesc(TypeHandle(MscorlibBinder::GetClass(CLASS__CURRENCY)));
+ return LocalDesc(TypeHandle(CoreLibBinder::GetClass(CLASS__CURRENCY)));
}
LocalDesc ILCurrencyMarshaler::GetManagedType()
{
STANDARD_VM_CONTRACT;
- return LocalDesc(TypeHandle(MscorlibBinder::GetClass(CLASS__DECIMAL)));
+ return LocalDesc(TypeHandle(CoreLibBinder::GetClass(CLASS__DECIMAL)));
}
STANDARD_VM_CONTRACT;
EmitLoadNativeHomeAddr(pslILEmit);
- pslILEmit->EmitINITOBJ(pslILEmit->GetToken(TypeHandle(MscorlibBinder::GetClass(CLASS__CURRENCY))));
+ pslILEmit->EmitINITOBJ(pslILEmit->GetToken(TypeHandle(CoreLibBinder::GetClass(CLASS__CURRENCY))));
}
void ILCurrencyMarshaler::EmitConvertContentsCLRToNative(ILCodeStream* pslILEmit)
pslILEmit->EmitADD();
// (String.Length + 2) * GetMaxDBCSCharByteSize()
- pslILEmit->EmitLDSFLD(pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__MARSHAL__SYSTEM_MAX_DBCS_CHAR_SIZE)));
+ pslILEmit->EmitLDSFLD(pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__MARSHAL__SYSTEM_MAX_DBCS_CHAR_SIZE)));
pslILEmit->EmitMUL_OVF();
// BufSize = (String.Length + 2) * GetMaxDBCSCharByteSize()
ILCodeLabel* pNullRefLabel = pslILEmit->NewCodeLabel();
UINT uNativeSize = m_pargs->m_pMT->GetNativeSize();
- int fieldDef = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__RAW_DATA__DATA));
+ int fieldDef = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__RAW_DATA__DATA));
EmitLoadNativeValue(pslILEmit);
pslILEmit->EmitBRFALSE(pNullRefLabel);
ILCodeLabel* pNullRefLabel = pslILEmit->NewCodeLabel();
UINT uNativeSize = m_pargs->m_pMT->GetNativeSize();
- int fieldDef = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__RAW_DATA__DATA));
+ int fieldDef = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__RAW_DATA__DATA));
EmitLoadManagedValue(pslILEmit);
pslILEmit->EmitBRFALSE(pNullRefLabel);
ILCodeLabel* pNullRefLabel = pslILEmit->NewCodeLabel();
UINT uNativeSize = m_pargs->m_pMT->GetNativeSize();
- int fieldDef = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__RAW_DATA__DATA));
+ int fieldDef = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__RAW_DATA__DATA));
EmitLoadNativeHomeAddr(pslILEmit);
pslILEmit->EmitLDC(0);
STANDARD_VM_CONTRACT;
UINT uNativeSize = m_pargs->m_pMT->GetNativeSize();
- int fieldDef = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__RAW_DATA__DATA));
+ int fieldDef = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__RAW_DATA__DATA));
pslILEmit->EmitLDTOKEN(pslILEmit->GetToken(m_pargs->m_pMT));
pslILEmit->EmitCALL(METHOD__TYPE__GET_TYPE_FROM_HANDLE, 1, 1);
// HandleRefs are valuetypes, so pinning is not needed.
// The argument address is on the stack and will not move.
- mdFieldDef handleField = pcsDispatch->GetToken(MscorlibBinder::GetField(FIELD__HANDLE_REF__HANDLE));
+ mdFieldDef handleField = pcsDispatch->GetToken(CoreLibBinder::GetField(FIELD__HANDLE_REF__HANDLE));
pcsDispatch->EmitLDARG(argidx);
pcsDispatch->EmitLDFLD(handleField);
- mdFieldDef wrapperField = pcsUnmarshal->GetToken(MscorlibBinder::GetField(FIELD__HANDLE_REF__WRAPPER));
+ mdFieldDef wrapperField = pcsUnmarshal->GetToken(CoreLibBinder::GetField(FIELD__HANDLE_REF__WRAPPER));
pcsUnmarshal->EmitLDARG(argidx);
pcsUnmarshal->EmitLDFLD(wrapperField);
pcsUnmarshal->EmitCALL(METHOD__GC__KEEP_ALIVE, 1, 0);
EmitLoadManagedValue(pslILEmit);
pslILEmit->EmitBRFALSE(failureLabel);
EmitLoadManagedValue(pslILEmit);
- pslILEmit->EmitLDFLD(pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__SAFE_HANDLE__HANDLE)));
+ pslILEmit->EmitLDFLD(pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__SAFE_HANDLE__HANDLE)));
EmitLoadNativeValue(pslILEmit);
pslILEmit->EmitBEQ(successLabel);
pslILEmit->EmitLabel(failureLabel);
// Grab the token for the native handle field embedded inside the SafeHandle. We'll be using it to direct access the
// native handle later.
- mdToken tkNativeHandleField = pslIL->GetToken(MscorlibBinder::GetField(FIELD__SAFE_HANDLE__HANDLE));
+ mdToken tkNativeHandleField = pslIL->GetToken(CoreLibBinder::GetField(FIELD__SAFE_HANDLE__HANDLE));
// The high level logic (note that the parameter may be in, out or both):
// 1) If this is an input parameter we need to AddRef the SafeHandle and schedule a Release cleanup item.
pslIL->EmitNEWOBJ(pslIL->GetToken(pMDCtor), 0);
pslIL->EmitSTLOC(dwReturnHandleLocal);
- mdToken tkNativeHandleField = pslPostIL->GetToken(MscorlibBinder::GetField(FIELD__SAFE_HANDLE__HANDLE));
+ mdToken tkNativeHandleField = pslPostIL->GetToken(CoreLibBinder::GetField(FIELD__SAFE_HANDLE__HANDLE));
// 3) create local to hold returned handle
DWORD dwReturnNativeHandleLocal = pslIL->NewLocal(ELEMENT_TYPE_I);
_ASSERTE(IsFieldMarshal(m_dwMarshalFlags));
EmitLoadManagedValue(pslILEmit);
- pslILEmit->EmitLDFLD(pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE)));
+ pslILEmit->EmitLDFLD(pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE)));
EmitStoreNativeValue(pslILEmit);
}
EmitLoadManagedValue(pslILEmit);
pslILEmit->EmitBRFALSE(failureLabel);
EmitLoadManagedValue(pslILEmit);
- pslILEmit->EmitLDFLD(pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE)));
+ pslILEmit->EmitLDFLD(pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE)));
EmitLoadNativeValue(pslILEmit);
pslILEmit->EmitBEQ(successLabel);
pslILEmit->EmitLabel(failureLabel);
// Grab the token for the native handle field embedded inside the CriticalHandle. We'll be using it to direct access
// the native handle later.
- mdToken tkNativeHandleField = pslIL->GetToken(MscorlibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE));
+ mdToken tkNativeHandleField = pslIL->GetToken(CoreLibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE));
if (byref)
{
pslIL->EmitNEWOBJ(pslIL->GetToken(pMDCtor), 0);
pslIL->EmitSTLOC(dwReturnHandleLocal);
- mdToken tkNativeHandleField = pslPostIL->GetToken(MscorlibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE));
+ mdToken tkNativeHandleField = pslPostIL->GetToken(CoreLibBinder::GetField(FIELD__CRITICAL_HANDLE__HANDLE));
// 3) create local to hold returned handle
DWORD dwReturnNativeHandleLocal = pslIL->NewLocal(ELEMENT_TYPE_I);
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__ARG_ITERATOR));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__ARG_ITERATOR));
}
bool ILArgIteratorMarshaler::SupportsArgumentMarshal(DWORD dwMarshalFlags, UINT* pErrorResID)
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__ARRAY_WITH_OFFSET));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__ARRAY_WITH_OFFSET));
}
bool ILArrayWithOffsetMarshaler::SupportsArgumentMarshal(DWORD dwMarshalFlags, UINT* pErrorResID)
}
CONTRACTL_END;
- int tokArrayWithOffset_m_array = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_ARRAY));
- int tokArrayWithOffset_m_count = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_COUNT));
+ int tokArrayWithOffset_m_array = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_ARRAY));
+ int tokArrayWithOffset_m_count = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_COUNT));
ILCodeLabel* pNonNullLabel = pslILEmit->NewCodeLabel();
ILCodeLabel* pSlowAllocPathLabel = pslILEmit->NewCodeLabel();
// Convert the contents
//
- int tokArrayWithOffset_m_offset = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_OFFSET));
+ int tokArrayWithOffset_m_offset = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_OFFSET));
ILCodeLabel* pNullRefLabel = pslILEmit->NewCodeLabel();
}
CONTRACTL_END;
- int tokArrayWithOffset_m_array = pslILEmit->GetToken(MscorlibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_ARRAY));
+ int tokArrayWithOffset_m_array = pslILEmit->GetToken(CoreLibBinder::GetField(FIELD__ARRAY_WITH_OFFSET__M_ARRAY));
ILCodeLabel* pNullRefLabel = pslILEmit->NewCodeLabel();
}
CONTRACTL_END;
- LocalDesc marshalerType(MscorlibBinder::GetClass(CLASS__ASANY_MARSHALER));
+ LocalDesc marshalerType(CoreLibBinder::GetClass(CLASS__ASANY_MARSHALER));
m_dwMngdMarshalerLocalNum = pslILEmit->NewLocal(marshalerType);
DWORD dwTmpLocalNum = pslILEmit->NewLocal(ELEMENT_TYPE_I);
STANDARD_VM_CONTRACT;
EmitLoadNativeHomeAddr(pslILEmit);
- pslILEmit->EmitINITOBJ(pslILEmit->GetToken(MscorlibBinder::GetClass(CLASS__ID)));
+ pslILEmit->EmitINITOBJ(pslILEmit->GetToken(CoreLibBinder::GetClass(CLASS__ID)));
}
virtual LocalDesc GetNativeType()
{
STANDARD_VM_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__ID));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__ID));
}
};
// marshaling a struct referring to an object containing a handle.
if (structField != 0)
{
- int tokStruct__m_object = pslILEmit->GetToken(MscorlibBinder::GetField(structField));
+ int tokStruct__m_object = pslILEmit->GetToken(CoreLibBinder::GetField(structField));
EmitLoadManagedHomeAddr(pslILEmit);
pslILEmit->EmitLDFLD(tokStruct__m_object);
}
LocalDesc GetManagedType() override
{
LIMITED_METHOD_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__SAFE_HANDLE));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__SAFE_HANDLE));
}
LocalDesc GetNativeType() override
LocalDesc GetManagedType() override
{
LIMITED_METHOD_CONTRACT;
- return LocalDesc(MscorlibBinder::GetClass(CLASS__CRITICAL_HANDLE));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__CRITICAL_HANDLE));
}
LocalDesc GetNativeType() override
//
// value class
//
- return LocalDesc(MscorlibBinder::GetClass(CLASS__ID));
+ return LocalDesc(CoreLibBinder::GetClass(CLASS__ID));
}
bool NeedsClearNative() override
{
EmitLoadNativeValue(pslILEmit); // dest
EmitLoadManagedHomeAddr(pslILEmit); // src
- pslILEmit->EmitCPOBJ(pslILEmit->GetToken(MscorlibBinder::GetClass(CLASS__ID)));
+ pslILEmit->EmitCPOBJ(pslILEmit->GetToken(CoreLibBinder::GetClass(CLASS__ID)));
}
else
{
{
STANDARD_VM_CONTRACT;
- int tokType = pslILEmit->GetToken(MscorlibBinder::GetClass(CLASS__ID));
+ int tokType = pslILEmit->GetToken(CoreLibBinder::GetClass(CLASS__ID));
ILCodeLabel *pNullLabel = pslILEmit->NewCodeLabel();
ILCodeLabel *pJoinLabel = pslILEmit->NewCodeLabel();
EmitCallMngdMarshalerMethod(pslILEmit, GetClearManagedMethod());
}
- virtual MethodDesc *GetConvertSpaceToManagedMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertSpaceToManaged == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idConvertSpaceToManaged)); }
- virtual MethodDesc *GetConvertContentsToManagedMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertContentsToManaged == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idConvertContentsToManaged)); }
- virtual MethodDesc *GetConvertSpaceToNativeMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertSpaceToNative == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idConvertSpaceToNative)); }
- virtual MethodDesc *GetConvertContentsToNativeMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertContentsToNative == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idConvertContentsToNative)); }
- virtual MethodDesc *GetClearNativeMethod() { WRAPPER_NO_CONTRACT; return (m_idClearNative == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idClearNative)); }
- virtual MethodDesc *GetClearNativeContentsMethod() { WRAPPER_NO_CONTRACT; return (m_idClearNativeContents == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idClearNativeContents)); }
- virtual MethodDesc *GetClearManagedMethod() { WRAPPER_NO_CONTRACT; return (m_idClearManaged == METHOD__NIL ? NULL : MscorlibBinder::GetMethod(m_idClearManaged)); }
+ virtual MethodDesc *GetConvertSpaceToManagedMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertSpaceToManaged == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idConvertSpaceToManaged)); }
+ virtual MethodDesc *GetConvertContentsToManagedMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertContentsToManaged == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idConvertContentsToManaged)); }
+ virtual MethodDesc *GetConvertSpaceToNativeMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertSpaceToNative == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idConvertSpaceToNative)); }
+ virtual MethodDesc *GetConvertContentsToNativeMethod() { WRAPPER_NO_CONTRACT; return (m_idConvertContentsToNative == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idConvertContentsToNative)); }
+ virtual MethodDesc *GetClearNativeMethod() { WRAPPER_NO_CONTRACT; return (m_idClearNative == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idClearNative)); }
+ virtual MethodDesc *GetClearNativeContentsMethod() { WRAPPER_NO_CONTRACT; return (m_idClearNativeContents == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idClearNativeContents)); }
+ virtual MethodDesc *GetClearManagedMethod() { WRAPPER_NO_CONTRACT; return (m_idClearManaged == METHOD__NIL ? NULL : CoreLibBinder::GetMethod(m_idClearManaged)); }
const BinderMethodID m_idConvertSpaceToManaged;
const BinderMethodID m_idConvertContentsToManaged;
//
// We're relying on the fact that a VASigCookie may only mention types within the
// corresponding module used to qualify the signature and the fact that interop
-// stubs may only reference mscorlib code or code related to a type mentioned in
+// stubs may only reference CoreLib code or code related to a type mentioned in
// the signature. Both of these are true unless the sig is allowed to contain
// ELEMENT_TYPE_INTERNAL, which may refer to any type.
//
GCPROTECT_BEGIN(CultureObj)
{
// Allocate a CultureInfo with the specified LCID.
- CultureObj = AllocateObject(MscorlibBinder::GetClass(CLASS__CULTURE_INFO));
+ CultureObj = AllocateObject(CoreLibBinder::GetClass(CLASS__CULTURE_INFO));
MethodDescCallSite cultureInfoCtor(METHOD__CULTURE_INFO__INT_CTOR, &CultureObj);
V_VT(pDestVar) = VT_VARIANT | VT_BYREF;
pDestVar->pvarVal = &pByrefArgInfo->m_Val;
}
- else if (MscorlibBinder::IsClass((*pSrcObj)->GetMethodTable(), CLASS__VARIANT_WRAPPER))
+ else if (CoreLibBinder::IsClass((*pSrcObj)->GetMethodTable(), CLASS__VARIANT_WRAPPER))
{
OBJECTREF WrappedObj = (*((VARIANTWRAPPEROBJECTREF*)pSrcObj))->GetWrappedObject();
GCPROTECT_BEGIN(WrappedObj)
}
// Plus some other calls that we're going to treat "like" intrinsics...
- if (methToCall == MscorlibBinder::GetMethod(METHOD__STUBHELPERS__SET_LAST_ERROR))
+ if (methToCall == CoreLibBinder::GetMethod(METHOD__STUBHELPERS__SET_LAST_ERROR))
{
// If we're interpreting a method that calls "SetLastError", it's very likely that the call(i) whose
// error we're trying to capture was performed with MethodDescCallSite machinery that itself trashes
}
else
{
- pMD = MscorlibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_OBJECT); // A random static method.
+ pMD = CoreLibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_OBJECT); // A random static method.
}
MethodDescCallSite mdcs(pMD, &mSig, ftnPtr);
#if 0
if (!th.IsPointer())
return FALSE;
- return th.AsTypeDesc()->GetTypeParam() == MscorlibBinder::GetElementType(ELEMENT_TYPE_VOID);
+ return th.AsTypeDesc()->GetTypeParam() == CoreLibBinder::GetElementType(ELEMENT_TYPE_VOID);
}
OBJECTREF InvokeUtil::CreatePointer(TypeHandle th, void * p)
OBJECTREF refObj = NULL;
GCPROTECT_BEGIN(refObj);
- refObj = AllocateObject(MscorlibBinder::GetClass(CLASS__POINTER));
+ refObj = AllocateObject(CoreLibBinder::GetClass(CLASS__POINTER));
((ReflectionPointer *)OBJECTREFToObject(refObj))->_ptr = p;
*(PVOID *)pArgDst = 0;
}
else {
- if (rObj->GetMethodTable() == MscorlibBinder::GetClassIfExist(CLASS__POINTER) && type == ELEMENT_TYPE_PTR)
+ if (rObj->GetMethodTable() == CoreLibBinder::GetClassIfExist(CLASS__POINTER) && type == ELEMENT_TYPE_PTR)
*(PVOID *)pArgDst = GetPointerValue(rObj);
- else if (rObj->GetTypeHandle().AsMethodTable() == MscorlibBinder::GetElementType(ELEMENT_TYPE_I))
+ else if (rObj->GetTypeHandle().AsMethodTable() == CoreLibBinder::GetElementType(ELEMENT_TYPE_I))
{
ARG_SLOT slot;
CreatePrimitiveValue(oType, oType, rObj, &slot);
// handle pointers
if (type == ELEMENT_TYPE_PTR || type == ELEMENT_TYPE_FNPTR) {
- if (MscorlibBinder::IsClass((*value)->GetMethodTable(), CLASS__POINTER) && type == ELEMENT_TYPE_PTR) {
+ if (CoreLibBinder::IsClass((*value)->GetMethodTable(), CLASS__POINTER) && type == ELEMENT_TYPE_PTR) {
TypeHandle srcTH = GetPointerType(*value);
if (!IsVoidPtr(th)) {
}
return;
}
- else if (MscorlibBinder::IsClass((*value)->GetMethodTable(), CLASS__INTPTR)) {
+ else if (CoreLibBinder::IsClass((*value)->GetMethodTable(), CLASS__INTPTR)) {
return;
}
{
LPVOID capturedValue = *(LPVOID*)pValue;
INDEBUG(pValue = (LPVOID)(size_t)0xcccccccc); // We're about to allocate a GC object - can no longer trust pValue
- obj = AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I));
+ obj = AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I));
*(LPVOID*)(obj->UnBox()) = capturedValue;
}
break;
} gc;
ZeroMemory(&gc, sizeof(gc));
- MethodTable *pVMClassLoadExcept = MscorlibBinder::GetException(kReflectionTypeLoadException);
+ MethodTable *pVMClassLoadExcept = CoreLibBinder::GetException(kReflectionTypeLoadException);
gc.o = AllocateObject(pVMClassLoadExcept);
GCPROTECT_BEGIN(gc);
ARG_SLOT args[4];
OBJECTREF o;
OBJECTREF oRet = 0;
- MethodTable *pVMTargetExcept = MscorlibBinder::GetException(kTargetInvocationException);
+ MethodTable *pVMTargetExcept = CoreLibBinder::GetException(kTargetInvocationException);
o = AllocateObject(pVMTargetExcept);
GCPROTECT_BEGIN(o);
ARG_SLOT args[2];
break;
case ELEMENT_TYPE_PTR: // pointers
- if (*valueObj != 0 && MscorlibBinder::IsClass((*valueObj)->GetMethodTable(), CLASS__POINTER)) {
+ if (*valueObj != 0 && CoreLibBinder::IsClass((*valueObj)->GetMethodTable(), CLASS__POINTER)) {
valueptr = GetPointerValue(*valueObj);
if (pField->IsStatic())
pField->SetStaticValuePtr(valueptr);
else
value = pField->GetValuePtr(*target);
- MethodTable *pIntPtrMT = MscorlibBinder::GetClass(CLASS__INTPTR);
+ MethodTable *pIntPtrMT = CoreLibBinder::GetClass(CLASS__INTPTR);
obj = AllocateObject(pIntPtrMT);
CopyValueClass(obj->UnBox(), &value, pIntPtrMT);
break;
classID = CLASS__FIELD_HANDLE;
}
- tokenType = CORINFO_CLASS_HANDLE(MscorlibBinder::GetClass(classID));
+ tokenType = CORINFO_CLASS_HANDLE(CoreLibBinder::GetClass(classID));
EE_TO_JIT_TRANSITION();
}
/*********************************************************************/
-// We have a few frequently used constants in mscorlib that are defined as
+// We have a few frequently used constants in CoreLib that are defined as
// readonly static fields for historic reasons. Check for them here and
// allow them to be treated as actual constants by the JIT.
static CORINFO_FIELD_ACCESSOR getFieldIntrinsic(FieldDesc * field)
{
STANDARD_VM_CONTRACT;
- if (MscorlibBinder::GetField(FIELD__STRING__EMPTY) == field)
+ if (CoreLibBinder::GetField(FIELD__STRING__EMPTY) == field)
{
return CORINFO_FIELD_INTRINSIC_EMPTY_STRING;
}
else
- if ((MscorlibBinder::GetField(FIELD__INTPTR__ZERO) == field) ||
- (MscorlibBinder::GetField(FIELD__UINTPTR__ZERO) == field))
+ if ((CoreLibBinder::GetField(FIELD__INTPTR__ZERO) == field) ||
+ (CoreLibBinder::GetField(FIELD__UINTPTR__ZERO) == field))
{
return CORINFO_FIELD_INTRINSIC_ZERO;
}
else
- if (MscorlibBinder::GetField(FIELD__BITCONVERTER__ISLITTLEENDIAN) == field)
+ if (CoreLibBinder::GetField(FIELD__BITCONVERTER__ISLITTLEENDIAN) == field)
{
return CORINFO_FIELD_INTRINSIC_ISLITTLEENDIAN;
}
result = CORINFO_CLASS_HANDLE(g_TypedReferenceMT);
break;
case CLASSID_TYPE_HANDLE:
- result = CORINFO_CLASS_HANDLE(MscorlibBinder::GetClass(CLASS__TYPE_HANDLE));
+ result = CORINFO_CLASS_HANDLE(CoreLibBinder::GetClass(CLASS__TYPE_HANDLE));
break;
case CLASSID_FIELD_HANDLE:
- result = CORINFO_CLASS_HANDLE(MscorlibBinder::GetClass(CLASS__FIELD_HANDLE));
+ result = CORINFO_CLASS_HANDLE(CoreLibBinder::GetClass(CLASS__FIELD_HANDLE));
break;
case CLASSID_METHOD_HANDLE:
- result = CORINFO_CLASS_HANDLE(MscorlibBinder::GetClass(CLASS__METHOD_HANDLE));
+ result = CORINFO_CLASS_HANDLE(CoreLibBinder::GetClass(CLASS__METHOD_HANDLE));
break;
case CLASSID_ARGUMENT_HANDLE:
- result = CORINFO_CLASS_HANDLE(MscorlibBinder::GetClass(CLASS__ARGUMENT_HANDLE));
+ result = CORINFO_CLASS_HANDLE(CoreLibBinder::GetClass(CLASS__ARGUMENT_HANDLE));
break;
case CLASSID_STRING:
result = CORINFO_CLASS_HANDLE(g_pStringClass);
// null since the virtual method resolves to System.Enum's implementation and that's a reference type.
// We can't do this for any other method since ToString and Equals have different semantics for enums
// and their underlying type.
- if (pMD->GetSlot() == MscorlibBinder::GetMethod(METHOD__OBJECT__GET_HASH_CODE)->GetSlot())
+ if (pMD->GetSlot() == CoreLibBinder::GetMethod(METHOD__OBJECT__GET_HASH_CODE)->GetSlot())
{
// Pretend this was a "constrained. UnderlyingType" instruction prefix
- constrainedType = TypeHandle(MscorlibBinder::GetElementType(constrainedType.GetVerifierCorElementType()));
+ constrainedType = TypeHandle(CoreLibBinder::GetElementType(constrainedType.GetVerifierCorElementType()));
// Native image signature encoder will use this field. It needs to match that pretended type, a bogus signature
// would be produced otherwise.
}
else
{
- // Don't cache inlining hints inside mscorlib during NGen of other assemblies,
- // since mscorlib is loaded domain neutral and will survive worker process recycling,
+ // Don't cache inlining hints inside CoreLib during NGen of other assemblies,
+ // since CoreLib is loaded domain neutral and will survive worker process recycling,
// causing determinism problems.
Module * pModule = ftn->GetModule();
if (pModule->IsSystem() && pModule->HasNativeImage())
/*********************************************************************
IL is the most efficient and portable way to implement certain low level methods
-in mscorlib.dll. Unfortunately, there is no good way to link IL into mscorlib.dll today.
-Until we find a good way to link IL into mscorlib.dll, we will provide the IL implementation here.
+in CoreLib. Unfortunately, there is no good way to link IL into CoreLib today.
+Until we find a good way to link IL into CoreLib, we will provide the IL implementation here.
- All IL intrinsincs are members of System.Runtime.CompilerServices.JitHelpers class
- All IL intrinsincs should be kept very simple. Implement the minimal reusable version of
{
STANDARD_VM_CONTRACT;
- _ASSERTE(MscorlibBinder::IsClass(ftn->GetMethodTable(), CLASS__UNSAFE));
+ _ASSERTE(CoreLibBinder::IsClass(ftn->GetMethodTable(), CLASS__UNSAFE));
mdMethodDef tk = ftn->GetMemberDef();
- if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_POINTER)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__AS_POINTER)->GetMemberDef())
{
// Return the argument that was passed in.
static const BYTE ilcode[] = { CEE_LDARG_0, CEE_CONV_U, CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__SIZEOF)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__SIZEOF)->GetMemberDef())
{
_ASSERTE(ftn->HasMethodInstantiation());
Instantiation inst = ftn->GetMethodInstantiation();
_ASSERTE(ftn->GetNumGenericMethodArgs() == 1);
- mdToken tokGenericArg = FindGenericMethodArgTypeSpec(MscorlibBinder::GetModule()->GetMDImport());
+ mdToken tokGenericArg = FindGenericMethodArgTypeSpec(CoreLibBinder::GetModule()->GetMDImport());
static BYTE ilcode[] = { CEE_PREFIX1, (CEE_SIZEOF & 0xFF), 0,0,0,0, CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_AS)->GetMemberDef() ||
- tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__OBJECT_AS)->GetMemberDef() ||
- tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_REF_POINTER)->GetMemberDef() ||
- tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_REF_IN)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_AS)->GetMemberDef() ||
+ tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__OBJECT_AS)->GetMemberDef() ||
+ tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__AS_REF_POINTER)->GetMemberDef() ||
+ tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__AS_REF_IN)->GetMemberDef())
{
// Return the argument that was passed in.
static const BYTE ilcode[] = { CEE_LDARG_0, CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_ADD)->GetMemberDef() ||
- tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__PTR_ADD)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_ADD)->GetMemberDef() ||
+ tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__PTR_ADD)->GetMemberDef())
{
- mdToken tokGenericArg = FindGenericMethodArgTypeSpec(MscorlibBinder::GetModule()->GetMDImport());
+ mdToken tokGenericArg = FindGenericMethodArgTypeSpec(CoreLibBinder::GetModule()->GetMDImport());
static BYTE ilcode[] = { CEE_LDARG_1,
CEE_PREFIX1, (CEE_SIZEOF & 0xFF), 0,0,0,0,
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_INTPTR_ADD)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_INTPTR_ADD)->GetMemberDef())
{
- mdToken tokGenericArg = FindGenericMethodArgTypeSpec(MscorlibBinder::GetModule()->GetMDImport());
+ mdToken tokGenericArg = FindGenericMethodArgTypeSpec(CoreLibBinder::GetModule()->GetMDImport());
static BYTE ilcode[] = { CEE_LDARG_1,
CEE_PREFIX1, (CEE_SIZEOF & 0xFF), 0,0,0,0,
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_ADD_BYTE_OFFSET)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_ADD_BYTE_OFFSET)->GetMemberDef())
{
static BYTE ilcode[] = { CEE_LDARG_0, CEE_LDARG_1, CEE_ADD, CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_ARE_SAME)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_ARE_SAME)->GetMemberDef())
{
// Compare the two arguments
static const BYTE ilcode[] = { CEE_LDARG_0, CEE_LDARG_1, CEE_PREFIX1, (CEE_CEQ & 0xFF), CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_IS_ADDRESS_GREATER_THAN)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_IS_ADDRESS_GREATER_THAN)->GetMemberDef())
{
// Compare the two arguments
static const BYTE ilcode[] = { CEE_LDARG_0, CEE_LDARG_1, CEE_PREFIX1, (CEE_CGT_UN & 0xFF), CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_IS_ADDRESS_LESS_THAN)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_IS_ADDRESS_LESS_THAN)->GetMemberDef())
{
// Compare the two arguments
static const BYTE ilcode[] = { CEE_LDARG_0, CEE_LDARG_1, CEE_PREFIX1, (CEE_CLT_UN & 0xFF), CEE_RET };
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_NULLREF)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_NULLREF)->GetMemberDef())
{
static const BYTE ilcode[] = { CEE_LDC_I4_0, CEE_CONV_U, CEE_RET };
methInfo->ILCode = const_cast<BYTE*>(ilcode);
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_IS_NULL)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_IS_NULL)->GetMemberDef())
{
// 'ldnull' opcode would produce type o, and we can't compare & against o (ECMA-335, Table III.4).
// However, we can compare & against native int, so we'll use that instead.
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_INIT_BLOCK_UNALIGNED)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_INIT_BLOCK_UNALIGNED)->GetMemberDef())
{
static const BYTE ilcode[] = { CEE_LDARG_0, CEE_LDARG_1, CEE_LDARG_2, CEE_PREFIX1, (CEE_UNALIGNED & 0xFF), 0x01, CEE_PREFIX1, (CEE_INITBLK & 0xFF), CEE_RET };
methInfo->ILCode = const_cast<BYTE*>(ilcode);
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_BYTE_OFFSET)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_BYTE_OFFSET)->GetMemberDef())
{
static const BYTE ilcode[] =
{
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_READ_UNALIGNED)->GetMemberDef() ||
- tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__PTR_READ_UNALIGNED)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_READ_UNALIGNED)->GetMemberDef() ||
+ tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__PTR_READ_UNALIGNED)->GetMemberDef())
{
_ASSERTE(ftn->HasMethodInstantiation());
Instantiation inst = ftn->GetMethodInstantiation();
_ASSERTE(ftn->GetNumGenericMethodArgs() == 1);
- mdToken tokGenericArg = FindGenericMethodArgTypeSpec(MscorlibBinder::GetModule()->GetMDImport());
+ mdToken tokGenericArg = FindGenericMethodArgTypeSpec(CoreLibBinder::GetModule()->GetMDImport());
static const BYTE ilcode[]
{
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_WRITE_UNALIGNED)->GetMemberDef() ||
- tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__PTR_WRITE_UNALIGNED)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__BYREF_WRITE_UNALIGNED)->GetMemberDef() ||
+ tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__PTR_WRITE_UNALIGNED)->GetMemberDef())
{
_ASSERTE(ftn->HasMethodInstantiation());
Instantiation inst = ftn->GetMethodInstantiation();
_ASSERTE(ftn->GetNumGenericMethodArgs() == 1);
- mdToken tokGenericArg = FindGenericMethodArgTypeSpec(MscorlibBinder::GetModule()->GetMDImport());
+ mdToken tokGenericArg = FindGenericMethodArgTypeSpec(CoreLibBinder::GetModule()->GetMDImport());
static const BYTE ilcode[]
{
methInfo->options = (CorInfoOptions)0;
return true;
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__SKIPINIT)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__UNSAFE__SKIPINIT)->GetMemberDef())
{
static BYTE ilcode[] = { CEE_RET };
{
STANDARD_VM_CONTRACT;
- _ASSERTE(MscorlibBinder::IsClass(ftn->GetMethodTable(), CLASS__MEMORY_MARSHAL));
+ _ASSERTE(CoreLibBinder::IsClass(ftn->GetMethodTable(), CLASS__MEMORY_MARSHAL));
mdMethodDef tk = ftn->GetMemberDef();
- if (tk == MscorlibBinder::GetMethod(METHOD__MEMORY_MARSHAL__GET_ARRAY_DATA_REFERENCE)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__MEMORY_MARSHAL__GET_ARRAY_DATA_REFERENCE)->GetMemberDef())
{
- mdToken tokRawSzArrayData = MscorlibBinder::GetField(FIELD__RAW_ARRAY_DATA__DATA)->GetMemberDef();
+ mdToken tokRawSzArrayData = CoreLibBinder::GetField(FIELD__RAW_ARRAY_DATA__DATA)->GetMemberDef();
static BYTE ilcode[] = { CEE_LDARG_0,
CEE_LDFLDA,0,0,0,0,
STANDARD_VM_CONTRACT;
//
- // This replaces the implementations of Volatile.* in mscorlib with more efficient ones.
+ // This replaces the implementations of Volatile.* in CoreLib with more efficient ones.
// We do this because we cannot otherwise express these in C#. What we *want* to do is
// to treat the byref args to these methods as "volatile." In pseudo-C#, this would look
// like:
// we substitute raw IL bodies for these methods that use the correct volatile instructions.
//
- _ASSERTE(MscorlibBinder::IsClass(ftn->GetMethodTable(), CLASS__VOLATILE));
+ _ASSERTE(CoreLibBinder::IsClass(ftn->GetMethodTable(), CLASS__VOLATILE));
const size_t VolatileMethodBodySize = 6;
//
// Ordinary volatile loads and stores only guarantee atomicity for pointer-sized (or smaller) data.
// So, on 32-bit platforms we must use Interlocked operations instead for the 64-bit types.
- // The implementation in mscorlib already does this, so we will only substitute a new
+ // The implementation in CoreLib already does this, so we will only substitute a new
// IL body if we're running on a 64-bit platform.
//
IN_TARGET_64BIT(VOLATILE_IMPL(Long, CEE_LDIND_I8, CEE_STIND_I8))
mdMethodDef md = ftn->GetMemberDef();
for (unsigned i = 0; i < NumItems(volatileImpls); i++)
{
- if (md == MscorlibBinder::GetMethod(volatileImpls[i].methodId)->GetMemberDef())
+ if (md == CoreLibBinder::GetMethod(volatileImpls[i].methodId)->GetMemberDef())
{
methInfo->ILCode = const_cast<BYTE*>(volatileImpls[i].body);
methInfo->ILCodeSize = VolatileMethodBodySize;
{
STANDARD_VM_CONTRACT;
- _ASSERTE(MscorlibBinder::IsClass(ftn->GetMethodTable(), CLASS__INTERLOCKED));
+ _ASSERTE(CoreLibBinder::IsClass(ftn->GetMethodTable(), CLASS__INTERLOCKED));
// We are only interested if ftn's token and CompareExchange<T> token match
- if (ftn->GetMemberDef() != MscorlibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_T)->GetMemberDef())
+ if (ftn->GetMemberDef() != CoreLibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_T)->GetMemberDef())
return false;
// Get MethodDesc for non-generic System.Threading.Interlocked.CompareExchange()
- MethodDesc* cmpxchgObject = MscorlibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_OBJECT);
+ MethodDesc* cmpxchgObject = CoreLibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_OBJECT);
// Setup up the body of the method
static BYTE il[] = {
{
STANDARD_VM_CONTRACT;
- _ASSERTE(MscorlibBinder::IsClass(ftn->GetMethodTable(), CLASS__RUNTIME_HELPERS));
+ _ASSERTE(CoreLibBinder::IsClass(ftn->GetMethodTable(), CLASS__RUNTIME_HELPERS));
mdMethodDef tk = ftn->GetMemberDef();
- if (tk == MscorlibBinder::GetMethod(METHOD__RUNTIME_HELPERS__IS_REFERENCE_OR_CONTAINS_REFERENCES)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__RUNTIME_HELPERS__IS_REFERENCE_OR_CONTAINS_REFERENCES)->GetMemberDef())
{
_ASSERTE(ftn->HasMethodInstantiation());
Instantiation inst = ftn->GetMethodInstantiation();
return true;
}
- if (tk == MscorlibBinder::GetMethod(METHOD__RUNTIME_HELPERS__IS_BITWISE_EQUATABLE)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__RUNTIME_HELPERS__IS_BITWISE_EQUATABLE)->GetMemberDef())
{
_ASSERTE(ftn->HasMethodInstantiation());
Instantiation inst = ftn->GetMethodInstantiation();
// n.b. This doesn't imply that the type's CompareTo method can be memcmp-implemented,
// as a method like CompareTo may need to take a type's signedness into account.
- if (methodTable == MscorlibBinder::GetClass(CLASS__BOOLEAN)
- || methodTable == MscorlibBinder::GetClass(CLASS__BYTE)
- || methodTable == MscorlibBinder::GetClass(CLASS__SBYTE)
+ if (methodTable == CoreLibBinder::GetClass(CLASS__BOOLEAN)
+ || methodTable == CoreLibBinder::GetClass(CLASS__BYTE)
+ || methodTable == CoreLibBinder::GetClass(CLASS__SBYTE)
#ifdef FEATURE_UTF8STRING
- || methodTable == MscorlibBinder::GetClass(CLASS__CHAR8)
+ || methodTable == CoreLibBinder::GetClass(CLASS__CHAR8)
#endif // FEATURE_UTF8STRING
- || methodTable == MscorlibBinder::GetClass(CLASS__CHAR)
- || methodTable == MscorlibBinder::GetClass(CLASS__INT16)
- || methodTable == MscorlibBinder::GetClass(CLASS__UINT16)
- || methodTable == MscorlibBinder::GetClass(CLASS__INT32)
- || methodTable == MscorlibBinder::GetClass(CLASS__UINT32)
- || methodTable == MscorlibBinder::GetClass(CLASS__INT64)
- || methodTable == MscorlibBinder::GetClass(CLASS__UINT64)
- || methodTable == MscorlibBinder::GetClass(CLASS__INTPTR)
- || methodTable == MscorlibBinder::GetClass(CLASS__UINTPTR)
- || methodTable == MscorlibBinder::GetClass(CLASS__RUNE)
+ || methodTable == CoreLibBinder::GetClass(CLASS__CHAR)
+ || methodTable == CoreLibBinder::GetClass(CLASS__INT16)
+ || methodTable == CoreLibBinder::GetClass(CLASS__UINT16)
+ || methodTable == CoreLibBinder::GetClass(CLASS__INT32)
+ || methodTable == CoreLibBinder::GetClass(CLASS__UINT32)
+ || methodTable == CoreLibBinder::GetClass(CLASS__INT64)
+ || methodTable == CoreLibBinder::GetClass(CLASS__UINT64)
+ || methodTable == CoreLibBinder::GetClass(CLASS__INTPTR)
+ || methodTable == CoreLibBinder::GetClass(CLASS__UINTPTR)
+ || methodTable == CoreLibBinder::GetClass(CLASS__RUNE)
|| methodTable->IsEnum())
{
methInfo->ILCode = const_cast<BYTE*>(returnTrue);
return true;
}
- if (tk == MscorlibBinder::GetMethod(METHOD__RUNTIME_HELPERS__GET_METHOD_TABLE)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__RUNTIME_HELPERS__GET_METHOD_TABLE)->GetMemberDef())
{
- mdToken tokRawData = MscorlibBinder::GetField(FIELD__RAW_DATA__DATA)->GetMemberDef();
+ mdToken tokRawData = CoreLibBinder::GetField(FIELD__RAW_DATA__DATA)->GetMemberDef();
// In the CLR, an object is laid out as follows.
// [ object_header || MethodTable* (64-bit pointer) || instance_data ]
return true;
}
- if (tk == MscorlibBinder::GetMethod(METHOD__RUNTIME_HELPERS__ENUM_EQUALS)->GetMemberDef())
+ if (tk == CoreLibBinder::GetMethod(METHOD__RUNTIME_HELPERS__ENUM_EQUALS)->GetMemberDef())
{
// Normally we would follow the above pattern and unconditionally replace the IL,
// relying on generic type constraints to guarantee that it will only ever be instantiated
return true;
}
}
- else if (tk == MscorlibBinder::GetMethod(METHOD__RUNTIME_HELPERS__ENUM_COMPARE_TO)->GetMemberDef())
+ else if (tk == CoreLibBinder::GetMethod(METHOD__RUNTIME_HELPERS__ENUM_COMPARE_TO)->GetMemberDef())
{
// The the comment above on why this is is not an unconditional replacement. This case handles
// Enums backed by 8 byte values.
{
static BYTE ilcode[8][9];
- TypeHandle thUnderlyingType = MscorlibBinder::GetElementType(et);
+ TypeHandle thUnderlyingType = CoreLibBinder::GetElementType(et);
- TypeHandle thIComparable = TypeHandle(MscorlibBinder::GetClass(CLASS__ICOMPARABLEGENERIC)).Instantiate(Instantiation(&thUnderlyingType, 1));
+ TypeHandle thIComparable = TypeHandle(CoreLibBinder::GetClass(CLASS__ICOMPARABLEGENERIC)).Instantiate(Instantiation(&thUnderlyingType, 1));
MethodDesc* pCompareToMD = thUnderlyingType.AsMethodTable()->GetMethodDescForInterfaceMethod(
- thIComparable, MscorlibBinder::GetMethod(METHOD__ICOMPARABLEGENERIC__COMPARE_TO), TRUE /* throwOnConflict */);
+ thIComparable, CoreLibBinder::GetMethod(METHOD__ICOMPARABLEGENERIC__COMPARE_TO), TRUE /* throwOnConflict */);
// Call CompareTo method on the primitive type
int tokCompareTo = pCompareToMD->GetMemberDef();
{
STANDARD_VM_CONTRACT;
- _ASSERTE(MscorlibBinder::IsClass(ftn->GetMethodTable(), CLASS__ACTIVATOR));
+ _ASSERTE(CoreLibBinder::IsClass(ftn->GetMethodTable(), CLASS__ACTIVATOR));
// We are only interested if ftn's token and CreateInstance<T> token match
- if (ftn->GetMemberDef() != MscorlibBinder::GetMethod(METHOD__ACTIVATOR__CREATE_INSTANCE_OF_T)->GetMemberDef())
+ if (ftn->GetMemberDef() != CoreLibBinder::GetMethod(METHOD__ACTIVATOR__CREATE_INSTANCE_OF_T)->GetMemberDef())
return false;
_ASSERTE(ftn->HasMethodInstantiation());
return false;
// Replace the body with implementation that just returns "default"
- MethodDesc* createDefaultInstance = MscorlibBinder::GetMethod(METHOD__ACTIVATOR__CREATE_DEFAULT_INSTANCE_OF_T);
+ MethodDesc* createDefaultInstance = CoreLibBinder::GetMethod(METHOD__ACTIVATOR__CREATE_DEFAULT_INSTANCE_OF_T);
COR_ILMETHOD_DECODER header(createDefaultInstance->GetILHeader(FALSE), createDefaultInstance->GetMDImport(), NULL);
getMethodInfoILMethodHeaderHelper(&header, methInfo);
*pSig = SigPointer(header.LocalVarSig, header.cbLocalVarSig);
if (ftn->IsJitIntrinsic())
{
- if (MscorlibBinder::IsClass(pMT, CLASS__UNSAFE))
+ if (CoreLibBinder::IsClass(pMT, CLASS__UNSAFE))
{
fILIntrinsic = getILIntrinsicImplementationForUnsafe(ftn, methInfo);
}
- else if (MscorlibBinder::IsClass(pMT, CLASS__MEMORY_MARSHAL))
+ else if (CoreLibBinder::IsClass(pMT, CLASS__MEMORY_MARSHAL))
{
fILIntrinsic = getILIntrinsicImplementationForMemoryMarshal(ftn, methInfo);
}
- else if (MscorlibBinder::IsClass(pMT, CLASS__INTERLOCKED))
+ else if (CoreLibBinder::IsClass(pMT, CLASS__INTERLOCKED))
{
fILIntrinsic = getILIntrinsicImplementationForInterlocked(ftn, methInfo);
}
- else if (MscorlibBinder::IsClass(pMT, CLASS__VOLATILE))
+ else if (CoreLibBinder::IsClass(pMT, CLASS__VOLATILE))
{
fILIntrinsic = getILIntrinsicImplementationForVolatile(ftn, methInfo);
}
- else if (MscorlibBinder::IsClass(pMT, CLASS__RUNTIME_HELPERS))
+ else if (CoreLibBinder::IsClass(pMT, CLASS__RUNTIME_HELPERS))
{
fILIntrinsic = getILIntrinsicImplementationForRuntimeHelpers(ftn, methInfo);
}
- else if (MscorlibBinder::IsClass(pMT, CLASS__ACTIVATOR))
+ else if (CoreLibBinder::IsClass(pMT, CLASS__ACTIVATOR))
{
SigPointer localSig;
fILIntrinsic = getILIntrinsicImplementationForActivator(ftn, methInfo, &localSig);
mdToken token;
IfFailThrow(ptr.GetToken(&token));
- // We are inside mscorlib - simple token match is sufficient
- if (token == MscorlibBinder::GetClass(CLASS__STACKCRAWMARK)->GetCl())
+ // We are inside CoreLib - simple token match is sufficient
+ if (token == CoreLibBinder::GetClass(CLASS__STACKCRAWMARK)->GetCl())
return TRUE;
}
*pMustExpand = true;
}
}
- else if (pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__SPAN)))
+ else if (pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__SPAN)))
{
- if (method->HasSameMethodDefAs(MscorlibBinder::GetMethod(METHOD__SPAN__GET_ITEM)))
+ if (method->HasSameMethodDefAs(CoreLibBinder::GetMethod(METHOD__SPAN__GET_ITEM)))
{
result = CORINFO_INTRINSIC_Span_GetItem;
}
}
- else if (pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__READONLY_SPAN)))
+ else if (pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__READONLY_SPAN)))
{
- if (method->HasSameMethodDefAs(MscorlibBinder::GetMethod(METHOD__READONLY_SPAN__GET_ITEM)))
+ if (method->HasSameMethodDefAs(CoreLibBinder::GetMethod(METHOD__READONLY_SPAN__GET_ITEM)))
{
result = CORINFO_INTRINSIC_ReadOnlySpan_GetItem;
}
TypeHandle elemTypeHnd(elemType);
// Special case for byte
- if (elemTypeHnd.AsMethodTable()->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__ELEMENT_TYPE_U1)))
+ if (elemTypeHnd.AsMethodTable()->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__ELEMENT_TYPE_U1)))
{
- return CORINFO_CLASS_HANDLE(MscorlibBinder::GetClass(CLASS__BYTE_EQUALITYCOMPARER));
+ return CORINFO_CLASS_HANDLE(CoreLibBinder::GetClass(CLASS__BYTE_EQUALITYCOMPARER));
}
// Else we'll need to find the appropriate instantation
Instantiation inst(&elemTypeHnd, 1);
// If T implements IEquatable<T>
- if (elemTypeHnd.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(inst)))
+ if (elemTypeHnd.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(inst)))
{
- TypeHandle resultTh = ((TypeHandle)MscorlibBinder::GetClass(CLASS__GENERIC_EQUALITYCOMPARER)).Instantiate(inst);
+ TypeHandle resultTh = ((TypeHandle)CoreLibBinder::GetClass(CLASS__GENERIC_EQUALITYCOMPARER)).Instantiate(inst);
return CORINFO_CLASS_HANDLE(resultTh.GetMethodTable());
}
if (Nullable::IsNullableType(elemTypeHnd))
{
Instantiation nullableInst = elemTypeHnd.AsMethodTable()->GetInstantiation();
- TypeHandle nullableComparer = TypeHandle(MscorlibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(nullableInst);
+ TypeHandle nullableComparer = TypeHandle(CoreLibBinder::GetClass(CLASS__IEQUATABLEGENERIC)).Instantiate(nullableInst);
if (nullableInst[0].CanCastTo(nullableComparer))
{
return CORINFO_CLASS_HANDLE(nullableComparer.GetMethodTable());
case ELEMENT_TYPE_I8:
case ELEMENT_TYPE_U8:
{
- targetClass = MscorlibBinder::GetClass(CLASS__ENUM_EQUALITYCOMPARER);
+ targetClass = CoreLibBinder::GetClass(CLASS__ENUM_EQUALITYCOMPARER);
break;
}
}
// Default case
- TypeHandle resultTh = ((TypeHandle)MscorlibBinder::GetClass(CLASS__OBJECT_EQUALITYCOMPARER)).Instantiate(inst);
+ TypeHandle resultTh = ((TypeHandle)CoreLibBinder::GetClass(CLASS__OBJECT_EQUALITYCOMPARER)).Instantiate(inst);
return CORINFO_CLASS_HANDLE(resultTh.GetMethodTable());
}
if (CORCOMPILE_IS_PCODE_TAGGED(result))
{
// There is a rare case where the function entrypoint may not be aligned. This could happen only for FCalls,
- // only on x86 and only if we failed to hardbind the fcall (e.g. ngen image for mscorlib.dll does not exist
+ // only on x86 and only if we failed to hardbind the fcall (e.g. ngen image for CoreLib does not exist
// and /nodependencies flag for ngen was used). The function entrypoints should be aligned in all other cases.
//
// We will wrap the unaligned method entrypoint by funcptr stub with aligned entrypoint.
// Initialize managed loader allocator reference holder
//
- MethodTable *pMT = MscorlibBinder::GetClass(CLASS__LOADERALLOCATOR);
+ MethodTable *pMT = CoreLibBinder::GetClass(CLASS__LOADERALLOCATOR);
*pKeepLoaderAllocatorAlive = (LOADERALLOCATORREF)AllocateObject(pMT);
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-// TODO: Re-implement with MC++ if we ever compile any mscorlib code with that
-
-
#include "common.h"
#include "mlinfo.h"
MODE_ANY;
} CONTRACTL_END;
- Signature sig = MscorlibBinder::GetSignature(pwzSignature);
+ Signature sig = CoreLibBinder::GetSignature(pwzSignature);
- return FindMethod(pMT, pwzName, sig.GetRawSig(), sig.GetRawSigLen(), MscorlibBinder::GetModule(), flags);
+ return FindMethod(pMT, pwzName, sig.GetRawSig(), sig.GetRawSigLen(), CoreLibBinder::GetModule(), flags);
}
//*******************************************************************************
}
CONTRACTL_END
- Signature sig = MscorlibBinder::GetSignature(pwzSignature);
+ Signature sig = CoreLibBinder::GetSignature(pwzSignature);
- return FindConstructor(pMT, sig.GetRawSig(), sig.GetRawSigLen(), MscorlibBinder::GetModule());
+ return FindConstructor(pMT, sig.GetRawSig(), sig.GetRawSigLen(), CoreLibBinder::GetModule());
}
//*******************************************************************************
CONTRACTL_END;
REFLECTMETHODREF retVal;
- REFLECTMETHODREF methodRef = (REFLECTMETHODREF)AllocateObject(MscorlibBinder::GetClass(CLASS__STUBMETHODINFO));
+ REFLECTMETHODREF methodRef = (REFLECTMETHODREF)AllocateObject(CoreLibBinder::GetClass(CLASS__STUBMETHODINFO));
GCPROTECT_BEGIN(methodRef);
methodRef->SetMethod(this);
{
public:
// Put the sig RVA in here - this allows us to avoid
- // touching the method desc table when mscorlib is prejitted.
+ // touching the method desc table when CoreLib is prejitted.
RelativePointer<TADDR> m_pSig;
DWORD m_cSig;
return (ndirect.m_wFlags & kThisCall) != 0;
}
- // Returns TRUE if this MethodDesc is internal call from mscorlib to mscorwks
+ // Returns TRUE if this MethodDesc is internal call from CoreLib to VM
BOOL IsQCall() const
{
LIMITED_METHOD_DAC_CONTRACT;
// managed code to re-enter into this codepath, causing a locking order violation.
pInitLock.Release();
- if (MscorlibBinder::GetException(kTypeInitializationException) != gc.pInitException->GetMethodTable())
+ if (CoreLibBinder::GetException(kTypeInitializationException) != gc.pInitException->GetMethodTable())
{
DefineFullyQualifiedNameForClassWOnStack();
LPCWSTR wszName = GetFullyQualifiedNameForClassW(this);
GetLoaderAllocator()->RegisterFailedTypeInitForCleanup(pEntry);
}
- _ASSERTE(g_pThreadAbortExceptionClass == MscorlibBinder::GetException(kThreadAbortException));
+ _ASSERTE(g_pThreadAbortExceptionClass == CoreLibBinder::GetException(kThreadAbortException));
if(gc.pInnerException->GetMethodTable() == g_pThreadAbortExceptionClass)
{
break;
case enum_flag_Category_PrimitiveValueType:
- // This path should only be taken for the builtin mscorlib types
+ // This path should only be taken for the builtin CoreLib types
// and primitive valuetypes
ret = GetClass()->GetInternalCorElementType();
_ASSERTE((ret != ELEMENT_TYPE_CLASS) &&
bmtGenerics->Debug_GetTypicalMethodTable()->Debug_HasInjectedInterfaceDuplicates();
if (GetModule() == g_pObjectClass->GetModule())
- { // mscorlib has some weird hardcoded information about interfaces (e.g.
+ { // CoreLib has some weird hardcoded information about interfaces (e.g.
// code:CEEPreloader::ApplyTypeDependencyForSZArrayHelper), so we don't inject duplicates into
- // mscorlib types
+ // CoreLib types
bmtInterface->dbg_fShouldInjectInterfaceDuplicates = FALSE;
}
}
));
#endif // _DEBUG
- // If this is mscorlib, then don't perform some sanity checks on the layout
+ // If this is CoreLib, then don't perform some sanity checks on the layout
bmtProp->fNoSanityChecks = pModule->IsSystem() ||
#ifdef FEATURE_READYTORUN
// No sanity checks for ready-to-run compiled images if possible
}
//@GENERICS:
// Generic methods or methods in generic classes
- // may not be part of a COM Import class, PInvoke, internal call outside mscorlib.
+ // may not be part of a COM Import class, PInvoke, internal call outside CoreLib.
if ((bmtGenerics->GetNumGenericArgs() != 0 || numGenericMethodArgs != 0) &&
(
#ifdef FEATURE_COMINTEROP
// This is broken because
// (a) g_pObjectClass->FindMethod("Equals", &gsig_IM_Obj_RetBool); will return
// the EqualsValue method
- // (b) When mscorlib has been preloaded (and thus the munge already done
+ // (b) When CoreLib has been preloaded (and thus the munge already done
// ahead of time), we cannot easily find both methods
// to compute EqualsAddr & EqualsSlot
//
Signature sig;
- sig = MscorlibBinder::GetSignature(&gsig_SM_RetVoid);
+ sig = CoreLibBinder::GetSignature(&gsig_SM_RetVoid);
- MethodSignature cctorSig(MscorlibBinder::GetModule(),
+ MethodSignature cctorSig(CoreLibBinder::GetModule(),
COR_CCTOR_METHOD_NAME,
sig.GetRawSig(), sig.GetRawSigLen());
- sig = MscorlibBinder::GetSignature(&gsig_IM_RetVoid);
+ sig = CoreLibBinder::GetSignature(&gsig_IM_RetVoid);
- MethodSignature defaultCtorSig(MscorlibBinder::GetModule(),
+ MethodSignature defaultCtorSig(CoreLibBinder::GetModule(),
COR_CTOR_METHOD_NAME,
sig.GetRawSig(), sig.GetRawSigLen());
if (GetModule()->IsSystem())
{
- // we are in mscorlib
CheckForSystemTypes();
}
IMDInternalImport *pMDImport = pModule->GetMDImport();
// Check to see if this type is a managed standard interface. All the managed
- // standard interfaces live in mscorlib.dll so checking for that first
+ // standard interfaces live in CoreLib so checking for that first
// makes the strcmp that comes afterwards acceptable.
if (pModule->IsSystem())
{
}
}
#endif // FEATURE_COMINTEROP
- else if (sigTH.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__SAFE_HANDLE))))
+ else if (sigTH.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__SAFE_HANDLE))))
{
if (nativeType != NATIVE_TYPE_DEFAULT)
{
m_args.m_pMT = m_pMT;
m_type = MARSHAL_TYPE_SAFEHANDLE;
}
- else if (sigTH.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__CRITICAL_HANDLE))))
+ else if (sigTH.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__CRITICAL_HANDLE))))
{
if (nativeType != NATIVE_TYPE_DEFAULT)
{
&& (!m_pMT->IsBlittable()
|| (m_pMT->HasSameTypeDefAs(g_pNullableClass)
|| m_pMT->HasSameTypeDefAs(g_pByReferenceClass)
- || m_pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__SPAN))
- || m_pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__READONLY_SPAN))
- || m_pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTOR64T))
- || m_pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTOR128T))
- || m_pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTOR256T))
+ || m_pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__SPAN))
+ || m_pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__READONLY_SPAN))
+ || m_pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR64T))
+ || m_pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR128T))
+ || m_pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTOR256T))
#ifndef CROSSGEN_COMPILE
// Crossgen scenarios block Vector<T> from even being loaded
- || m_pMT->HasSameTypeDefAs(MscorlibBinder::GetClass(CLASS__VECTORT))
+ || m_pMT->HasSameTypeDefAs(CoreLibBinder::GetClass(CLASS__VECTORT))
#endif // !CROSSGEN_COMPILE
)))
{
}
#endif // FEATURE_COMINTEROP
}
- else if (m_thElement.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__SAFE_HANDLE))))
+ else if (m_thElement.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__SAFE_HANDLE))))
{
// Array's of SAFEHANDLEs are not supported.
ReportInvalidArrayMarshalInfo(IDS_EE_BADMARSHAL_SAFEHANDLEARRAY);
}
- else if (m_thElement.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__CRITICAL_HANDLE))))
+ else if (m_thElement.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__CRITICAL_HANDLE))))
{
// Array's of CRITICALHANDLEs are not supported.
ReportInvalidArrayMarshalInfo(IDS_EE_BADMARSHAL_CRITICALHANDLEARRAY);
}
else if (etElement == ELEMENT_TYPE_VALUETYPE)
{
- if (m_thElement == TypeHandle(MscorlibBinder::GetClass(CLASS__DATE_TIME)))
+ if (m_thElement == TypeHandle(CoreLibBinder::GetClass(CLASS__DATE_TIME)))
{
if (ntElement == NATIVE_TYPE_STRUCT || ntElement == NATIVE_TYPE_DEFAULT)
m_vtElement = VT_DATE;
else
ReportInvalidArrayMarshalInfo(IDS_EE_BADMARSHAL_DATETIMEARRAY);
}
- else if (m_thElement == TypeHandle(MscorlibBinder::GetClass(CLASS__DECIMAL)))
+ else if (m_thElement == TypeHandle(CoreLibBinder::GetClass(CLASS__DECIMAL)))
{
if (ntElement == NATIVE_TYPE_STRUCT || ntElement == NATIVE_TYPE_DEFAULT)
m_vtElement = VT_DECIMAL;
}
}
#ifdef FEATURE_COMINTEROP
- else if (m_thElement == TypeHandle(MscorlibBinder::GetClass(CLASS__ERROR_WRAPPER)))
+ else if (m_thElement == TypeHandle(CoreLibBinder::GetClass(CLASS__ERROR_WRAPPER)))
{
m_vtElement = VT_ERROR;
}
if (g_pOverlappedDataClass == NULL)
{
- g_pOverlappedDataClass = MscorlibBinder::GetClass(CLASS__OVERLAPPEDDATA);
+ g_pOverlappedDataClass = CoreLibBinder::GetClass(CLASS__OVERLAPPEDDATA);
// We have optimization to avoid creating event if IO is in default domain. This depends on default domain
// can not be unloaded.
}
// MT of the innermost element is not getting unloaded. This then ensures the
// MT of the original object (i.e., array) itself must not be getting
// unloaded either, since the MTs of arrays and of their elements are
- // allocated on the same loader heap, except the case where the array is
- // Object[], in which case its MT is in mscorlib and thus doesn't unload.
-
+ // allocated on the same loader allocator.
Module * pLoaderModule = pMT->GetLoaderModule();
// Don't look up types that are unloading due to Collectible Assemblies. Haven't been
MethodTable* nullableMT = nullableType.GetMethodTable();
// insure that the managed version of the table is the same as the
- // unmanaged. Note that we can't do this in mscorlib.h because this
+ // unmanaged. Note that we can't do this in corelib.h because this
// class is generic and field layout depends on the instantiation.
_ASSERTE(nullableMT->GetNumInstanceFields() == 2);
// this hasn't yet been defined.
class ReflectClassBaseObject : public BaseObjectWithCachedData
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
OBJECTREF m_keepalive;
// type that does not sufficiently match this data structure.
class ReflectMethodObject : public BaseObjectWithCachedData
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
OBJECTREF m_object;
// type that does not sufficiently match this data structure.
class ReflectFieldObject : public BaseObjectWithCachedData
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
OBJECTREF m_object;
//
class ReflectModuleBaseObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
// READ ME:
class ThreadBaseObject;
class SynchronizationContextObject: public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
private:
// These field are also defined in the managed representation. (SecurityContext.cs)If you
// add or change these field you must also change the managed code so that
class CultureInfoBaseObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
private:
OBJECTREF _compareInfo;
{
friend class ClrDataAccess;
friend class ThreadNative;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
friend class Object;
private:
class AssemblyBaseObject : public Object
{
friend class Assembly;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
// READ ME:
#endif // defined(TARGET_X86) && !defined(TARGET_UNIX)
class AssemblyLoadContextBaseObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
// READ ME:
{
friend class AssemblyNative;
friend class AppDomainNative;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
// READ ME:
//
class VersionBaseObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
// READ ME:
//-------------------------------------------------------------
class ComObject : public MarshalByRefObjectBaseObject
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
protected:
class SafeHandle : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
private:
// READ ME:
class CriticalHandle : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
private:
// READ ME:
// Base class for WaitHandle
class WaitHandleBase :public MarshalByRefObjectBaseObject
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
__inline LPVOID GetWaitHandle() {
class DelegateObject : public Object
{
friend class CheckAsmOffsets;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
BOOL IsWrapperDelegate() { LIMITED_METHOD_CONTRACT; return _methodPtrAux == NULL; }
class LoaderAllocatorScoutObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
friend class LoaderAllocatorObject;
protected:
class LoaderAllocatorObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
PTRARRAYREF GetHandleTable()
#include "pshpack4.h"
class ExceptionObject : public Object
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
void SetHResult(HRESULT hr)
typedef DPTR(class ContractExceptionObject) PTR_ContractExceptionObject;
class ContractExceptionObject : public ExceptionObject
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
ContractFailureKind GetContractFailureKind()
friend class JIT_TrialAlloc;
friend class CheckAsmOffsets;
friend class COMString;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
private:
BASEARRAYREF _data;
friend class ClrDataAccess;
#endif
friend class CheckAsmOffsets;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
private:
OBJECTHANDLE _dependentHandle;
friend class ClrDataAccess;
#endif
friend class CheckAsmOffsets;
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
// _trackerOrTrackerSet is either a reference to a LAHashDependentHashTracker, or to a GCHeapHash of LAHashDependentHashTracker objects.
#ifdef FEATURE_COMINTEROP
// SafeHandle's or CriticalHandle's cannot be stored in VARIANT's.
- if (pMT->CanCastToClass(MscorlibBinder::GetClass(CLASS__SAFE_HANDLE)))
+ if (pMT->CanCastToClass(CoreLibBinder::GetClass(CLASS__SAFE_HANDLE)))
COMPlusThrow(kArgumentException, IDS_EE_SH_IN_VARIANT_NOT_SUPPORTED);
- if (pMT->CanCastToClass(MscorlibBinder::GetClass(CLASS__CRITICAL_HANDLE)))
+ if (pMT->CanCastToClass(CoreLibBinder::GetClass(CLASS__CRITICAL_HANDLE)))
COMPlusThrow(kArgumentException, IDS_EE_CH_IN_VARIANT_NOT_SUPPORTED);
// VariantWrappers cannot be stored in VARIANT's.
- if (MscorlibBinder::IsClass(pMT, CLASS__VARIANT_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__VARIANT_WRAPPER))
COMPlusThrow(kArgumentException, IDS_EE_VAR_WRAP_IN_VAR_NOT_SUPPORTED);
// We are dealing with a normal object (not a wrapper) so we will
return VT_VARIANT;
// We need to make sure the CVClasses table is populated.
- if(MscorlibBinder::IsClass(pMT, CLASS__DATE_TIME))
+ if(CoreLibBinder::IsClass(pMT, CLASS__DATE_TIME))
return VT_DATE;
- if(MscorlibBinder::IsClass(pMT, CLASS__DECIMAL))
+ if(CoreLibBinder::IsClass(pMT, CLASS__DECIMAL))
return VT_DECIMAL;
#ifdef HOST_64BIT
- if (MscorlibBinder::IsClass(pMT, CLASS__INTPTR))
+ if (CoreLibBinder::IsClass(pMT, CLASS__INTPTR))
return VT_I8;
- if (MscorlibBinder::IsClass(pMT, CLASS__UINTPTR))
+ if (CoreLibBinder::IsClass(pMT, CLASS__UINTPTR))
return VT_UI8;
#else
- if (MscorlibBinder::IsClass(pMT, CLASS__INTPTR))
+ if (CoreLibBinder::IsClass(pMT, CLASS__INTPTR))
return VT_INT;
- if (MscorlibBinder::IsClass(pMT, CLASS__UINTPTR))
+ if (CoreLibBinder::IsClass(pMT, CLASS__UINTPTR))
return VT_UINT;
#endif
#ifdef FEATURE_COMINTEROP
- if (MscorlibBinder::IsClass(pMT, CLASS__DISPATCH_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__DISPATCH_WRAPPER))
return VT_DISPATCH;
- if (MscorlibBinder::IsClass(pMT, CLASS__UNKNOWN_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__UNKNOWN_WRAPPER))
return VT_UNKNOWN;
- if (MscorlibBinder::IsClass(pMT, CLASS__ERROR_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__ERROR_WRAPPER))
return VT_ERROR;
- if (MscorlibBinder::IsClass(pMT, CLASS__CURRENCY_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__CURRENCY_WRAPPER))
return VT_CY;
- if (MscorlibBinder::IsClass(pMT, CLASS__BSTR_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__BSTR_WRAPPER))
return VT_BSTR;
// VariantWrappers cannot be stored in VARIANT's.
- if (MscorlibBinder::IsClass(pMT, CLASS__VARIANT_WRAPPER))
+ if (CoreLibBinder::IsClass(pMT, CLASS__VARIANT_WRAPPER))
COMPlusThrow(kArgumentException, IDS_EE_COM_UNSUPPORTED_SIG);
#endif // FEATURE_COMINTEROP
#ifdef FEATURE_COMINTEROP
// There is no VT corresponding to SafeHandles as they cannot be stored in
// VARIANTs or Arrays. The same applies to CriticalHandle.
- if (type.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__SAFE_HANDLE))))
+ if (type.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__SAFE_HANDLE))))
COMPlusThrow(kArgumentException, IDS_EE_COM_UNSUPPORTED_SIG);
- if (type.CanCastTo(TypeHandle(MscorlibBinder::GetClass(CLASS__CRITICAL_HANDLE))))
+ if (type.CanCastTo(TypeHandle(CoreLibBinder::GetClass(CLASS__CRITICAL_HANDLE))))
COMPlusThrow(kArgumentException, IDS_EE_COM_UNSUPPORTED_SIG);
if (pMT->IsInterface())
break;
case VT_CY:
- baseType = TypeHandle(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ baseType = TypeHandle(CoreLibBinder::GetClass(CLASS__DECIMAL));
break;
case VT_DATE:
- baseType = TypeHandle(MscorlibBinder::GetClass(CLASS__DATE_TIME));
+ baseType = TypeHandle(CoreLibBinder::GetClass(CLASS__DATE_TIME));
break;
case VT_DECIMAL:
- baseType = TypeHandle(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ baseType = TypeHandle(CoreLibBinder::GetClass(CLASS__DECIMAL));
break;
case VT_VARIANT:
}
if (baseType.IsNull())
- baseType = TypeHandle(MscorlibBinder::GetElementType(baseElement));
+ baseType = TypeHandle(CoreLibBinder::GetElementType(baseElement));
_ASSERTE(!baseType.IsNull());
if (vt & VT_ARRAY)
{
- return MscorlibBinder::GetClass(CLASS__INTPTR);
+ return CoreLibBinder::GetClass(CLASS__INTPTR);
}
switch (vt)
{
case VT_DATE:
- return MscorlibBinder::GetClass(CLASS__DOUBLE);
+ return CoreLibBinder::GetClass(CLASS__DOUBLE);
case VT_CY:
- return MscorlibBinder::GetClass(CLASS__CURRENCY);
+ return CoreLibBinder::GetClass(CLASS__CURRENCY);
case VTHACK_WINBOOL:
- return MscorlibBinder::GetClass(CLASS__INT32);
+ return CoreLibBinder::GetClass(CLASS__INT32);
case VT_BOOL:
- return MscorlibBinder::GetClass(CLASS__INT16);
+ return CoreLibBinder::GetClass(CLASS__INT16);
case VTHACK_CBOOL:
- return MscorlibBinder::GetClass(CLASS__BYTE);
+ return CoreLibBinder::GetClass(CLASS__BYTE);
case VT_DISPATCH:
case VT_UNKNOWN:
case VT_LPSTR:
case VT_USERDEFINED:
case VT_SAFEARRAY:
case VT_CARRAY:
- return MscorlibBinder::GetClass(CLASS__INTPTR);
+ return CoreLibBinder::GetClass(CLASS__INTPTR);
case VT_VARIANT:
- return MscorlibBinder::GetClass(CLASS__NATIVEVARIANT);
+ return CoreLibBinder::GetClass(CLASS__NATIVEVARIANT);
case VTHACK_ANSICHAR:
- return MscorlibBinder::GetClass(CLASS__BYTE);
+ return CoreLibBinder::GetClass(CLASS__BYTE);
case VT_UI2:
// When CharSet = CharSet.Unicode, System.Char arrays are marshaled as VT_UI2.
// However, since System.Char itself is CharSet.Ansi, the native size of
// System.Char is 1 byte instead of 2. So here we explicitly return System.UInt16's
// MethodTable to ensure the correct size.
- return MscorlibBinder::GetClass(CLASS__UINT16);
+ return CoreLibBinder::GetClass(CLASS__UINT16);
case VT_DECIMAL:
- return MscorlibBinder::GetClass(CLASS__NATIVEDECIMAL);
+ return CoreLibBinder::GetClass(CLASS__NATIVEDECIMAL);
default:
PREFIX_ASSUME(pManagedMT != NULL);
return pManagedMT;
case CV_NULL:
{
- FieldDesc * pFD = MscorlibBinder::GetField(FIELD__NULL__VALUE);
+ FieldDesc * pFD = CoreLibBinder::GetField(FIELD__NULL__VALUE);
_ASSERTE(pFD);
pFD->CheckRunClassInitThrowing();
}
CONTRACTL_END;
- OBJECTREF pDecimalRef = AllocateObject(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ OBJECTREF pDecimalRef = AllocateObject(CoreLibBinder::GetClass(CLASS__DECIMAL));
DECIMAL* pDecimal = (DECIMAL *) pDecimalRef->UnBox();
*pDecimal = V_DECIMAL(pOleVariant);
}
CONTRACTL_END;
- OBJECTREF pDecimalRef = AllocateObject(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ OBJECTREF pDecimalRef = AllocateObject(CoreLibBinder::GetClass(CLASS__DECIMAL));
DECIMAL* pDecimal = (DECIMAL *) pDecimalRef->UnBox();
*pDecimal = *V_DECIMALREF(pOleVariant);
else
{
MethodTable *pMT = (*pObj)->GetMethodTable();
- if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I4))
+ if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I4))
{
V_I4(pOle) = *(LONG*)( (*pObj)->GetData() );
V_VT(pOle) = VT_I4;
V_VT(pOle) = VT_BSTR;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I2))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I2))
{
V_I2(pOle) = *(SHORT*)( (*pObj)->GetData() );
V_VT(pOle) = VT_I2;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I1))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I1))
{
V_I1(pOle) = *(CHAR*)( (*pObj)->GetData() );
V_VT(pOle) = VT_I1;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U4))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U4))
{
V_UI4(pOle) = *(ULONG*)( (*pObj)->GetData() );
V_VT(pOle) = VT_UI4;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U2))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U2))
{
V_UI2(pOle) = *(USHORT*)( (*pObj)->GetData() );
V_VT(pOle) = VT_UI2;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U1))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U1))
{
V_UI1(pOle) = *(BYTE*)( (*pObj)->GetData() );
V_VT(pOle) = VT_UI1;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_R4))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_R4))
{
V_R4(pOle) = *(FLOAT*)( (*pObj)->GetData() );
V_VT(pOle) = VT_R4;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_R8))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_R8))
{
V_R8(pOle) = *(DOUBLE*)( (*pObj)->GetData() );
V_VT(pOle) = VT_R8;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN))
{
V_BOOL(pOle) = *(U1*)( (*pObj)->GetData() ) ? VARIANT_TRUE : VARIANT_FALSE;
V_VT(pOle) = VT_BOOL;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I))
{
*(LPVOID*)&(V_INT(pOle)) = *(LPVOID*)( (*pObj)->GetData() );
V_VT(pOle) = VT_INT;
}
- else if (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U))
+ else if (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U))
{
*(LPVOID*)&(V_UINT(pOle)) = *(LPVOID*)( (*pObj)->GetData() );
V_VT(pOle) = VT_UINT;
// Let's try to handle the common trivial cases quickly first before
// running the generalized stuff.
MethodTable *pMT = (*pObj) == NULL ? NULL : (*pObj)->GetMethodTable();
- if ( (V_VT(pOle) == (VT_BYREF | VT_I4) || V_VT(pOle) == (VT_BYREF | VT_UI4)) && (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I4) || pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U4)) )
+ if ( (V_VT(pOle) == (VT_BYREF | VT_I4) || V_VT(pOle) == (VT_BYREF | VT_UI4)) && (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I4) || pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U4)) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
*(V_I4REF(pOle)) = *(LONG*)( (*pObj)->GetData() );
}
- else if ( (V_VT(pOle) == (VT_BYREF | VT_I2) || V_VT(pOle) == (VT_BYREF | VT_UI2)) && (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I2) || pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U2)) )
+ else if ( (V_VT(pOle) == (VT_BYREF | VT_I2) || V_VT(pOle) == (VT_BYREF | VT_UI2)) && (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I2) || pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U2)) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
*(V_I2REF(pOle)) = *(SHORT*)( (*pObj)->GetData() );
}
- else if ( (V_VT(pOle) == (VT_BYREF | VT_I1) || V_VT(pOle) == (VT_BYREF | VT_UI1)) && (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I1) || pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U1)) )
+ else if ( (V_VT(pOle) == (VT_BYREF | VT_I1) || V_VT(pOle) == (VT_BYREF | VT_UI1)) && (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I1) || pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U1)) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
*(V_I1REF(pOle)) = *(CHAR*)( (*pObj)->GetData() );
}
- else if ( V_VT(pOle) == (VT_BYREF | VT_R4) && pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_R4) )
+ else if ( V_VT(pOle) == (VT_BYREF | VT_R4) && pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_R4) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
*(V_R4REF(pOle)) = *(FLOAT*)( (*pObj)->GetData() );
}
- else if ( V_VT(pOle) == (VT_BYREF | VT_R8) && pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_R8) )
+ else if ( V_VT(pOle) == (VT_BYREF | VT_R8) && pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_R8) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
*(V_R8REF(pOle)) = *(DOUBLE*)( (*pObj)->GetData() );
}
- else if ( V_VT(pOle) == (VT_BYREF | VT_BOOL) && pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN) )
+ else if ( V_VT(pOle) == (VT_BYREF | VT_BOOL) && pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
*(V_BOOLREF(pOle)) = ( *(U1*)( (*pObj)->GetData() ) ) ? VARIANT_TRUE : VARIANT_FALSE;
}
- else if ( (V_VT(pOle) == (VT_BYREF | VT_INT) || V_VT(pOle) == (VT_BYREF | VT_UINT)) && (pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_I4) || pMT == MscorlibBinder::GetElementType(ELEMENT_TYPE_U4)) )
+ else if ( (V_VT(pOle) == (VT_BYREF | VT_INT) || V_VT(pOle) == (VT_BYREF | VT_UINT)) && (pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_I4) || pMT == CoreLibBinder::GetElementType(ELEMENT_TYPE_U4)) )
{
// deallocation of old value optimized away since there's nothing to
// deallocate for this vartype.
case VT_I4:
case VT_INT:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I4)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I4)) );
*(LONG*)((*pObj)->GetData()) = V_I4(pOle);
break;
case VT_BYREF|VT_I4:
case VT_BYREF|VT_INT:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I4)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I4)) );
*(LONG*)((*pObj)->GetData()) = *(V_I4REF(pOle));
break;
case VT_UI4:
case VT_UINT:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_U4)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_U4)) );
*(ULONG*)((*pObj)->GetData()) = V_UI4(pOle);
break;
case VT_BYREF|VT_UI4:
case VT_BYREF|VT_UINT:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_U4)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_U4)) );
*(ULONG*)((*pObj)->GetData()) = *(V_UI4REF(pOle));
break;
case VT_I2:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I2)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I2)) );
(*(SHORT*)((*pObj)->GetData())) = V_I2(pOle);
break;
case VT_BYREF|VT_I2:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I2)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I2)) );
*(SHORT*)((*pObj)->GetData()) = *(V_I2REF(pOle));
break;
case VT_UI2:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_U2)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_U2)) );
*(USHORT*)((*pObj)->GetData()) = V_UI2(pOle);
break;
case VT_BYREF|VT_UI2:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_U2)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_U2)) );
*(USHORT*)((*pObj)->GetData()) = *(V_UI2REF(pOle));
break;
case VT_I1:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I1)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I1)) );
*(CHAR*)((*pObj)->GetData()) = V_I1(pOle);
break;
case VT_BYREF|VT_I1:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_I1)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_I1)) );
*(CHAR*)((*pObj)->GetData()) = *(V_I1REF(pOle));
break;
case VT_UI1:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_U1)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_U1)) );
*(BYTE*)((*pObj)->GetData()) = V_UI1(pOle);
break;
case VT_BYREF|VT_UI1:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_U1)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_U1)) );
*(BYTE*)((*pObj)->GetData()) = *(V_UI1REF(pOle));
break;
case VT_R4:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_R4)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_R4)) );
*(FLOAT*)((*pObj)->GetData()) = V_R4(pOle);
break;
case VT_BYREF|VT_R4:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_R4)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_R4)) );
*(FLOAT*)((*pObj)->GetData()) = *(V_R4REF(pOle));
break;
case VT_R8:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_R8)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_R8)) );
*(DOUBLE*)((*pObj)->GetData()) = V_R8(pOle);
break;
case VT_BYREF|VT_R8:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_R8)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_R8)) );
*(DOUBLE*)((*pObj)->GetData()) = *(V_R8REF(pOle));
break;
case VT_BOOL:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN)) );
*(VARIANT_BOOL*)((*pObj)->GetData()) = V_BOOL(pOle) ? 1 : 0;
break;
case VT_BYREF|VT_BOOL:
SetObjectReference( pObj,
- AllocateObject(MscorlibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN)) );
+ AllocateObject(CoreLibBinder::GetElementType(ELEMENT_TYPE_BOOLEAN)) );
*(VARIANT_BOOL*)((*pObj)->GetData()) = *(V_BOOLREF(pOle)) ? 1 : 0;
break;
}
CONTRACTL_END;
- OBJECTREF pDecimalRef = AllocateObject(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ OBJECTREF pDecimalRef = AllocateObject(CoreLibBinder::GetClass(CLASS__DECIMAL));
DECIMAL DecVal;
// Convert the currency to a decimal.
}
CONTRACTL_END;
- OBJECTREF pDecimalRef = AllocateObject(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ OBJECTREF pDecimalRef = AllocateObject(CoreLibBinder::GetClass(CLASS__DECIMAL));
DECIMAL DecVal;
// Convert the currency to a decimal.
if (!hndElemType.IsTypeDesc())
{
- if (hndElemType == TypeHandle(MscorlibBinder::GetClass(CLASS__DISPATCH_WRAPPER)) ||
- hndElemType == TypeHandle(MscorlibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
+ if (hndElemType == TypeHandle(CoreLibBinder::GetClass(CLASS__DISPATCH_WRAPPER)) ||
+ hndElemType == TypeHandle(CoreLibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
{
*pbOfInterfaceWrappers = TRUE;
return TRUE;
}
- if (hndElemType == TypeHandle(MscorlibBinder::GetClass(CLASS__ERROR_WRAPPER)) ||
- hndElemType == TypeHandle(MscorlibBinder::GetClass(CLASS__CURRENCY_WRAPPER)) ||
- hndElemType == TypeHandle(MscorlibBinder::GetClass(CLASS__BSTR_WRAPPER)))
+ if (hndElemType == TypeHandle(CoreLibBinder::GetClass(CLASS__ERROR_WRAPPER)) ||
+ hndElemType == TypeHandle(CoreLibBinder::GetClass(CLASS__CURRENCY_WRAPPER)) ||
+ hndElemType == TypeHandle(CoreLibBinder::GetClass(CLASS__BSTR_WRAPPER)))
{
*pbOfInterfaceWrappers = FALSE;
return TRUE;
BASEARRAYREF RetArray = NULL;
// Retrieve the element type handle for the array to create.
- if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__DISPATCH_WRAPPER)))
+ if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__DISPATCH_WRAPPER)))
hndElemType = TypeHandle(g_pObjectClass);
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
hndElemType = TypeHandle(g_pObjectClass);
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__BSTR_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__BSTR_WRAPPER)))
hndElemType = TypeHandle(g_pStringClass);
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__ERROR_WRAPPER)))
- hndElemType = TypeHandle(MscorlibBinder::GetClass(CLASS__INT32));
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__ERROR_WRAPPER)))
+ hndElemType = TypeHandle(CoreLibBinder::GetClass(CLASS__INT32));
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__CURRENCY_WRAPPER)))
- hndElemType = TypeHandle(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__CURRENCY_WRAPPER)))
+ hndElemType = TypeHandle(CoreLibBinder::GetClass(CLASS__DECIMAL));
else
_ASSERTE(!"Invalid wrapper type");
{
SIZE_T NumComponents = (*pArray)->GetNumComponents();
- if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__DISPATCH_WRAPPER)))
+ if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__DISPATCH_WRAPPER)))
{
DISPATCHWRAPPEROBJECTREF *pSrc = (DISPATCHWRAPPEROBJECTREF *)(*pArray)->GetDataPtr();
DISPATCHWRAPPEROBJECTREF *pSrcEnd = pSrc + NumComponents;
for (; pSrc < pSrcEnd; pSrc++, pDest++)
SetObjectReference(pDest, (*pSrc) != NULL ? (*pSrc)->GetWrappedObject() : NULL);
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
{
UNKNOWNWRAPPEROBJECTREF *pSrc = (UNKNOWNWRAPPEROBJECTREF *)(*pArray)->GetDataPtr();
UNKNOWNWRAPPEROBJECTREF *pSrcEnd = pSrc + NumComponents;
for (; pSrc < pSrcEnd; pSrc++, pDest++)
SetObjectReference(pDest, (*pSrc) != NULL ? (*pSrc)->GetWrappedObject() : NULL);
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__ERROR_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__ERROR_WRAPPER)))
{
ERRORWRAPPEROBJECTREF *pSrc = (ERRORWRAPPEROBJECTREF *)(*pArray)->GetDataPtr();
ERRORWRAPPEROBJECTREF *pSrcEnd = pSrc + NumComponents;
for (; pSrc < pSrcEnd; pSrc++, pDest++)
*pDest = (*pSrc) != NULL ? (*pSrc)->GetErrorCode() : NULL;
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__CURRENCY_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__CURRENCY_WRAPPER)))
{
CURRENCYWRAPPEROBJECTREF *pSrc = (CURRENCYWRAPPEROBJECTREF *)(*pArray)->GetDataPtr();
CURRENCYWRAPPEROBJECTREF *pSrcEnd = pSrc + NumComponents;
memset(pDest, 0, sizeof(DECIMAL));
}
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__BSTR_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__BSTR_WRAPPER)))
{
BSTRWRAPPEROBJECTREF *pSrc = (BSTRWRAPPEROBJECTREF *)(*pArray)->GetDataPtr();
BSTRWRAPPEROBJECTREF *pSrcEnd = pSrc + NumComponents;
TypeHandle hndWrapperType = (*pArray)->GetArrayElementTypeHandle();
TypeHandle pWrappedObjType;
- if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__DISPATCH_WRAPPER)) ||
- hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
+ if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__DISPATCH_WRAPPER)) ||
+ hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__UNKNOWN_WRAPPER)))
{
// There's no need to traverse the array up front. We'll use the default interface
// for each element in code:OleVariant::MarshalInterfaceArrayComToOleHelper.
pWrappedObjType = TypeHandle(g_pObjectClass);
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__ERROR_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__ERROR_WRAPPER)))
{
- pWrappedObjType = TypeHandle(MscorlibBinder::GetClass(CLASS__INT32));
+ pWrappedObjType = TypeHandle(CoreLibBinder::GetClass(CLASS__INT32));
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__CURRENCY_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__CURRENCY_WRAPPER)))
{
- pWrappedObjType = TypeHandle(MscorlibBinder::GetClass(CLASS__DECIMAL));
+ pWrappedObjType = TypeHandle(CoreLibBinder::GetClass(CLASS__DECIMAL));
}
- else if (hndWrapperType == TypeHandle(MscorlibBinder::GetClass(CLASS__BSTR_WRAPPER)))
+ else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__BSTR_WRAPPER)))
{
pWrappedObjType = TypeHandle(g_pStringClass);
}
}
CONTRACT_END;
- RETURN TypeHandle(MscorlibBinder::GetClass(CVTypeToBinderClassID[elemType]));
+ RETURN TypeHandle(CoreLibBinder::GetClass(CVTypeToBinderClassID[elemType]));
}
// Use this very carefully. There is not a direct mapping between
struct VariantData
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
public:
static void NewVariant(VariantData * const& dest, const CVTypes type, INT64 data
// to encode zero-valued fields with zero bits. Is this is deemed an important optimization in the
// future we could always given up on a simple linear mapping of the size field and use a lookup
// table to map values encoded into the real sizes. Experiments with EEClass packed fields over
- // mscorlib show that this currently doesn't yield us much benefit, primarily due to the DWORD
+ // CoreLib show that this currently doesn't yield us much benefit, primarily due to the DWORD
// round-up size semantic, which implies we'd need a lot more optimization than this to reduce the
// average structure size below the next DWORD threshhold.
BitVectorSet(dwOffset, kMaxLengthBits, dwFieldLength - 1);
PEImage * pPEImageNI,
ICLRPrivAssembly * pHostAssembly);
- // This opens the canonical mscorlib.dll
+ // This opens the canonical System.Private.CoreLib.dll
static PEAssembly *OpenSystem(IUnknown *pAppCtx);
#ifdef DACCESS_COMPILE
virtual void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);
GetNativeImageSignature(pAssembly->GetManifestFile(), wszSignature, lengthof(wszSignature));
// Build the path to the perfmap file, which consists of <inputpath><imagesimplename>.ni.<signature>.map.
- // Example: /tmp/mscorlib.ni.{GUID}.map
+ // Example: /tmp/System.Private.CoreLib.ni.{GUID}.map
SString sDestPerfMapPath;
sDestPerfMapPath.Printf("%S%s.ni.%S.map", pDestPath, lpcSimpleName, wszSignature);
CreateInstantiatingILStubTargetSig(pTargetMD, typeContext, &stubSigBuilder);
// 2. Emit the method body
- mdToken tokRawData = pCode->GetToken(MscorlibBinder::GetField(FIELD__RAW_DATA__DATA));
+ mdToken tokRawData = pCode->GetToken(CoreLibBinder::GetField(FIELD__RAW_DATA__DATA));
// 2.1 Push the thisptr
// We need to skip over the MethodTable*
//
// In this IL stub implementation we call the native method kernel32!GetFileAttributes,
// and then we immediately try to save the Last Error code by calling the
- // mscorlib method System.StubHelpers.StubHelpers.SetLastError().
+ // CoreLib method System.StubHelpers.StubHelpers.SetLastError().
//
// However when we are coming from a precompiled IL Stub in an ngen image
// we must use an ExternalMethodFixup to find the target address of
}
else
{
- target = ECall::GetFCallImpl(MscorlibBinder::GetMethod(METHOD__DELEGATE__CONSTRUCT_DELEGATE));
+ target = ECall::GetFCallImpl(CoreLibBinder::GetMethod(METHOD__DELEGATE__CONSTRUCT_DELEGATE));
ctorData.pArg3 = NULL;
}
GCX_COOP();
- ::TypeHandle typeHandle = MscorlibBinder::GetClass(CLASS__GUID);
+ ::TypeHandle typeHandle = CoreLibBinder::GetClass(CLASS__GUID);
BASEARRAYREF arr = (BASEARRAYREF) AllocateSzArray(typeHandle.MakeSZArray(), length);
memcpyNoGCRefs(arr->GetDataPtr(), p, length * sizeof(GUID));
Set(arr);
// QCALLS
//
-// QCalls are internal calls from managed code in mscorlib.dll to unmanaged code in mscorwks.dll. QCalls are very much like
-// a normal P/Invoke from mscorlib.dll to mscorwks.dll.
+// QCalls are internal calls from managed code in CoreLib to unmanaged code in VM. QCalls are very much like
+// a normal P/Invoke from CoreLib to VM.
//
// Unlike FCalls, QCalls will marshal all arguments as unmanaged types like a normal P/Invoke. QCall also switch to preemptive
// GC mode like a normal P/Invoke. These two features should make QCalls easier to write reliably compared to FCalls.
// the field type is a pointer
if (targetCorElement == ELEMENT_TYPE_PTR || targetCorElement == ELEMENT_TYPE_FNPTR) {
// the object must be an IntPtr or a System.Reflection.Pointer
- if (valueType == TypeHandle(MscorlibBinder::GetClass(CLASS__INTPTR))) {
+ if (valueType == TypeHandle(CoreLibBinder::GetClass(CLASS__INTPTR))) {
//
// it's an IntPtr, it's good.
}
case ELEMENT_TYPE_PTR: // pointers
if (gc.oValue != 0) {
value = 0;
- if (MscorlibBinder::IsClass(gc.oValue->GetMethodTable(), CLASS__POINTER)) {
+ if (CoreLibBinder::IsClass(gc.oValue->GetMethodTable(), CLASS__POINTER)) {
value = (size_t) InvokeUtil::GetPointerValue(gc.oValue);
#ifdef _MSC_VER
#pragma warning(disable: 4267) //work-around for compiler
OBJECTREF result = NULL;
HELPER_METHOD_FRAME_BEGIN_RET_0();
- MethodTable *pMT = MscorlibBinder::GetElementType(th.AsMethodTable()->GetInternalCorElementType());
+ MethodTable *pMT = CoreLibBinder::GetElementType(th.AsMethodTable()->GetInternalCorElementType());
result = pMT->GetManagedClassObject();
HELPER_METHOD_FRAME_END();
DEFINE_EXCEPTION(g_SystemNS, ArgumentNullException, false, E_POINTER)
-#define kLastExceptionInMscorlib kArgumentNullException
-
-//
-// All exceptions defined in other .NET Framework assemblies have to be at the end
-//
-
-
-
-// Please see comments on at the top of this list
-
#undef DEFINE_EXCEPTION
#endif //#ifndef CROSSGEN_COMPILE
// Helper method to allow us to compare a MethodTable against a known method table
-// from mscorlib. If the mscorlib type isn't loaded, we don't load it because we
+// from CoreLib. If the CoreLib type isn't loaded, we don't load it because we
// know that it can't be the MethodTable we're curious about.
-static bool MethodTableHasSameTypeDefAsMscorlibClass(MethodTable* pMT, BinderClassID classId)
+static bool MethodTableHasSameTypeDefAsCoreLibClass(MethodTable* pMT, BinderClassID classId)
{
CONTRACTL
{
}
CONTRACTL_END;
- MethodTable* pMT_MscorlibClass = MscorlibBinder::GetClassIfExist(classId);
- if (pMT_MscorlibClass == NULL)
+ MethodTable* pMT_CoreLibClass = CoreLibBinder::GetClassIfExist(classId);
+ if (pMT_CoreLibClass == NULL)
return false;
- return (pMT->HasSameTypeDefAs(pMT_MscorlibClass) != FALSE);
+ return (pMT->HasSameTypeDefAs(pMT_CoreLibClass) != FALSE);
}
#ifndef CROSSGEN_COMPILE
// If the requested interface is IEnumerable then we need to check to see if the
// COM object implements IDispatch and has a member with DISPID_NEWENUM.
- if (pItfMT == MscorlibBinder::GetClass(CLASS__IENUMERABLE))
+ if (pItfMT == CoreLibBinder::GetClass(CLASS__IENUMERABLE))
{
SafeComHolder<IDispatch> pDisp = GetIDispatch();
if (pDisp)
COMPlusThrow(kInvalidCastException, IDS_EE_RCW_INVALIDCAST_EVENTITF, strHRDescription.GetUnicode(), strComObjClassName.GetUnicode(),
strCastToName.GetUnicode(), strIID, strSrcItfIID);
}
- else if (thCastTo == TypeHandle(MscorlibBinder::GetClass(CLASS__IENUMERABLE)))
+ else if (thCastTo == TypeHandle(CoreLibBinder::GetClass(CLASS__IENUMERABLE)))
{
COMPlusThrow(kInvalidCastException, IDS_EE_RCW_INVALIDCAST_IENUMERABLE,
strHRDescription.GetUnicode(), strComObjClassName.GetUnicode(), strCastToName.GetUnicode(), strIID);
}
GCPROTECT_BEGIN(refArray);
- TypeHandle thRuntimeType = TypeHandle(MscorlibBinder::GetClass(arrayElemType));
+ TypeHandle thRuntimeType = TypeHandle(CoreLibBinder::GetClass(arrayElemType));
TypeHandle arrayHandle = ClassLoader::LoadArrayTypeThrowing(thRuntimeType, ELEMENT_TYPE_SZARRAY);
refArray = (PTRARRAYREF)AllocateSzArray(arrayHandle, numTypeHandles);
// modifiers now that we know how long they should be.
sp = argument;
- MethodTable *pMT = MscorlibBinder::GetClass(CLASS__TYPE);
+ MethodTable *pMT = CoreLibBinder::GetClass(CLASS__TYPE);
TypeHandle arrayHandle = ClassLoader::LoadArrayTypeThrowing(TypeHandle(pMT), ELEMENT_TYPE_SZARRAY);
gc.retVal = (PTRARRAYREF) AllocateSzArray(arrayHandle, cMods);
if (pILHeader)
{
- MethodTable * pExceptionHandlingClauseMT = MscorlibBinder::GetClass(CLASS__RUNTIME_EH_CLAUSE);
+ MethodTable * pExceptionHandlingClauseMT = CoreLibBinder::GetClass(CLASS__RUNTIME_EH_CLAUSE);
TypeHandle thEHClauseArray = ClassLoader::LoadArrayTypeThrowing(TypeHandle(pExceptionHandlingClauseMT), ELEMENT_TYPE_SZARRAY);
- MethodTable * pLocalVariableMT = MscorlibBinder::GetClass(CLASS__RUNTIME_LOCAL_VARIABLE_INFO);
+ MethodTable * pLocalVariableMT = CoreLibBinder::GetClass(CLASS__RUNTIME_LOCAL_VARIABLE_INFO);
TypeHandle thLocalVariableArray = ClassLoader::LoadArrayTypeThrowing(TypeHandle(pLocalVariableMT), ELEMENT_TYPE_SZARRAY);
Module* pModule = pMethod->GetModule();
}
}
- gc.MethodBodyObj = (RUNTIMEMETHODBODYREF)AllocateObject(MscorlibBinder::GetClass(CLASS__RUNTIME_METHOD_BODY));
+ gc.MethodBodyObj = (RUNTIMEMETHODBODYREF)AllocateObject(CoreLibBinder::GetClass(CLASS__RUNTIME_METHOD_BODY));
gc.MethodBodyObj->_maxStackSize = header.GetMaxStack();
gc.MethodBodyObj->_initLocals = !!(header.GetFlags() & CorILMethod_InitLocals);
// methods involves calling .GetMethod which can fail, we are doing this
// eagerly here, Otherwise we will have to do it at the time of the call,
// and this could be at risk if .GetMethod failed.
- MethodDesc* pMD = MscorlibBinder::GetMethod(METHOD__SAFE_HANDLE__GET_IS_INVALID);
+ MethodDesc* pMD = CoreLibBinder::GetMethod(METHOD__SAFE_HANDLE__GET_IS_INVALID);
s_IsInvalidHandleMethodSlot = pMD->GetSlot();
- pMD = MscorlibBinder::GetMethod(METHOD__SAFE_HANDLE__RELEASE_HANDLE);
+ pMD = CoreLibBinder::GetMethod(METHOD__SAFE_HANDLE__RELEASE_HANDLE);
s_ReleaseHandleMethodSlot = pMD->GetSlot();
}
}
CONTRACTL_END
- Signature sig = MscorlibBinder::GetMethodSignature(id);
+ Signature sig = CoreLibBinder::GetMethodSignature(id);
- _ASSERTE(MethodDescMatchesSig(MscorlibBinder::GetMethod(id),
- sig.GetRawSig(), sig.GetRawSigLen(), MscorlibBinder::GetModule()));
+ _ASSERTE(MethodDescMatchesSig(CoreLibBinder::GetMethod(id),
+ sig.GetRawSig(), sig.GetRawSigLen(), CoreLibBinder::GetModule()));
- Init(sig.GetRawSig(), sig.GetRawSigLen(), MscorlibBinder::GetModule(), NULL);
+ Init(sig.GetRawSig(), sig.GetRawSigLen(), CoreLibBinder::GetModule(), NULL);
}
MetaSig::MetaSig(LPHARDCODEDMETASIG pwzMetaSig)
}
CONTRACTL_END
- Signature sig = MscorlibBinder::GetSignature(pwzMetaSig);
+ Signature sig = CoreLibBinder::GetSignature(pwzMetaSig);
- Init(sig.GetRawSig(), sig.GetRawSigLen(), MscorlibBinder::GetModule(), NULL);
+ Init(sig.GetRawSig(), sig.GetRawSigLen(), CoreLibBinder::GetModule(), NULL);
}
// Helper constructor that constructs a field signature MetaSig from a FieldDesc
// case ELEMENT_TYPE_STRING = 0x0e,
// case ELEMENT_TYPE_OBJECT = 0x1c,
//
- thRet = TypeHandle(MscorlibBinder::GetElementType(typ));
+ thRet = TypeHandle(CoreLibBinder::GetElementType(typ));
}
else
{
{
if (TypeFromToken(typeToken) == mdtTypeRef)
{
- loadedType = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_VOID));
+ loadedType = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_VOID));
thRet = loadedType;
break;
}
TypeHandle th = GetTypeHandleThrowing(pModule, pTypeContext, ClassLoader::LoadTypes, CLASS_LOAD_APPROXPARENTS, TRUE);
if(th.IsNull())
{
- th = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_VOID));
+ th = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_VOID));
}
type = th.GetInternalCorElementType();
}
return CompareTypeTokens(
- MscorlibBinder::GetElementType(Type1)->GetCl(),
+ CoreLibBinder::GetElementType(Type1)->GetCl(),
tk2,
- MscorlibBinder::GetModule(),
+ CoreLibBinder::GetModule(),
pModule2,
pVisited);
} // MetaSig::CompareElementTypeToToken
// a) are vacuous, and
// b) may be implicit (ie. absent) in the overriden variable's declaration
if (!(CompareTypeDefOrRefOrSpec(pModule1, tkConstraintType1, NULL,
- MscorlibBinder::GetModule(), g_pObjectClass->GetCl(), NULL, NULL) ||
+ CoreLibBinder::GetModule(), g_pObjectClass->GetCl(), NULL, NULL) ||
(((specialConstraints1 & gpNotNullableValueTypeConstraint) != 0) &&
(CompareTypeDefOrRefOrSpec(pModule1, tkConstraintType1, NULL,
- MscorlibBinder::GetModule(), g_pValueTypeClass->GetCl(), NULL, NULL)))))
+ CoreLibBinder::GetModule(), g_pValueTypeClass->GetCl(), NULL, NULL)))))
{
HENUMInternalHolder hEnum2(pInternalImport2);
mdGenericParamConstraint tkConstraint2;
MetaSig(FieldDesc *pFD, TypeHandle declaringType = TypeHandle());
- // Used to avoid touching metadata for mscorlib methods. Nb. only use for non-generic methods.
+ // Used to avoid touching metadata for CoreLib methods. Nb. only use for non-generic methods.
MetaSig(BinderMethodID id);
MetaSig(LPHARDCODEDMETASIG pwzMetaSig);
if (TypeFromToken(tk) != mdtTypeDef)
{
// At this point, we would have to load other assemblies. The only one we have guaranteed
- // to be there is mscorlib.
+ // to be there is CoreLib.
return ELEMENT_TYPE_END;
}
sig.GetSignature(&pSig, &cbSig);
}
- IMDInternalImport * pIMDI = MscorlibBinder::GetModule()->GetMDImport();
+ IMDInternalImport * pIMDI = CoreLibBinder::GetModule()->GetMDImport();
CQuickBytes sigStr;
PrettyPrintSig(pSig, cbSig, "", &sigStr, pIMDI, NULL);
void ILCodeStream::EmitNEWOBJ(BinderMethodID id, int numInArgs)
{
STANDARD_VM_CONTRACT;
- EmitNEWOBJ(GetToken(MscorlibBinder::GetMethod(id)), numInArgs);
+ EmitNEWOBJ(GetToken(CoreLibBinder::GetMethod(id)), numInArgs);
}
void ILCodeStream::EmitCALL(BinderMethodID id, int numInArgs, int numRetArgs)
{
STANDARD_VM_CONTRACT;
- EmitCALL(GetToken(MscorlibBinder::GetMethod(id)), numInArgs, numRetArgs);
+ EmitCALL(GetToken(CoreLibBinder::GetMethod(id)), numInArgs, numRetArgs);
}
void ILCodeStream::EmitLDFLD(BinderFieldID id)
{
STANDARD_VM_CONTRACT;
- EmitLDFLD(GetToken(MscorlibBinder::GetField(id)));
+ EmitLDFLD(GetToken(CoreLibBinder::GetField(id)));
}
void ILCodeStream::EmitSTFLD(BinderFieldID id)
{
STANDARD_VM_CONTRACT;
- EmitSTFLD(GetToken(MscorlibBinder::GetField(id)));
+ EmitSTFLD(GetToken(CoreLibBinder::GetField(id)));
}
void ILCodeStream::EmitLDFLDA(BinderFieldID id)
{
STANDARD_VM_CONTRACT;
- EmitLDFLDA(GetToken(MscorlibBinder::GetField(id)));
+ EmitLDFLDA(GetToken(CoreLibBinder::GetField(id)));
}
void ILStubLinker::SetHasThis (bool fHasThis)
//
// we insert the ArgIterator in the same spot that the VASigCookie will go for sanity
//
- LocalDesc aiLoc(MscorlibBinder::GetClass(CLASS__ARG_ITERATOR));
+ LocalDesc aiLoc(CoreLibBinder::GetClass(CLASS__ARG_ITERATOR));
int aiLocNum;
aiLocNum = NewLocal(aiLoc);
aiLoc.ElementType[0] = ELEMENT_TYPE_BYREF;
aiLoc.ElementType[1] = ELEMENT_TYPE_INTERNAL;
aiLoc.cbType = 2;
- aiLoc.InternalToken = MscorlibBinder::GetClass(CLASS__ARG_ITERATOR);
+ aiLoc.InternalToken = CoreLibBinder::GetClass(CLASS__ARG_ITERATOR);
SetStubTargetArgType(&aiLoc, false);
}
CONTRACTL_END;
if (s_tailCallDispatcherMD == NULL)
- s_tailCallDispatcherMD = MscorlibBinder::GetMethod(METHOD__RUNTIME_HELPERS__DISPATCH_TAILCALLS);
+ s_tailCallDispatcherMD = CoreLibBinder::GetMethod(METHOD__RUNTIME_HELPERS__DISPATCH_TAILCALLS);
return s_tailCallDispatcherMD;
}
bool thisParamByRef = (calleeMD != NULL) ? calleeMD->GetMethodTable()->IsValueType() : thisArgByRef;
if (thisParamByRef)
{
- thisHnd = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_U1))
+ thisHnd = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_U1))
.MakeByRef();
}
else
}
if (CorTypeInfo::IsObjRef(ety))
{
- return TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_OBJECT));
+ return TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_OBJECT));
}
if (tyHnd.IsPointer() || tyHnd.IsFnPtrType())
{
- return TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_I));
+ return TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_I));
}
if (tyHnd.IsByRef())
{
- return TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_U1))
+ return TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_U1))
.MakeByRef();
}
GCPROTECT_BEGIN(args);
- MethodTable *pMT = MscorlibBinder::GetException(kThreadStartException);
+ MethodTable *pMT = CoreLibBinder::GetException(kThreadStartException);
args.pThrowable = AllocateObject(pMT);
MethodDescCallSite exceptionCtor(METHOD__THREAD_START_EXCEPTION__EX_CTOR);
}
CONTRACTL_END;
- // This is the case when we're building mscorlib and haven't yet created
+ // This is the case when we're building CoreLib and haven't yet created
// the system assembly.
if (SystemDomain::System()->SystemAssembly()==NULL || g_fForbidEnterEE) {
return NULL;
_ASSERTE(this == GetThread());
- MethodTable* pMT = MscorlibBinder::GetClass(CLASS__DESERIALIZATION_TRACKER);
+ MethodTable* pMT = CoreLibBinder::GetClass(CLASS__DESERIALIZATION_TRACKER);
m_DeserializationTracker = CreateGlobalStrongHandle(AllocateObject(pMT));
_ASSERTE(m_DeserializationTracker != NULL);
class TailCallTls
{
- friend class MscorlibBinder;
+ friend class CoreLibBinder;
PortableTailCallFrame* m_frame;
char* m_argBuffer;
return NULL;
if (GetInternalCorElementType() == ELEMENT_TYPE_FNPTR)
- return MscorlibBinder::GetElementType(ELEMENT_TYPE_U);
+ return CoreLibBinder::GetElementType(ELEMENT_TYPE_U);
_ASSERTE(HasTypeParam());
ParamTypeDesc* asParam = dac_cast<PTR_ParamTypeDesc>(this);
case ELEMENT_TYPE_FNPTR:
// A function pointer is mapped into typeof(IntPtr). It results in a loss of information.
- return MscorlibBinder::GetElementType(ELEMENT_TYPE_I)->GetManagedClassObject();
+ return CoreLibBinder::GetElementType(ELEMENT_TYPE_I)->GetManagedClassObject();
default:
_ASSERTE(!"Bad Element Type");
case ELEMENT_TYPE_FNPTR:
// A function pointer is mapped into typeof(IntPtr). It results in a loss of information.
- o = MscorlibBinder::GetElementType(ELEMENT_TYPE_I)->GetManagedClassObjectIfExists();
+ o = CoreLibBinder::GetElementType(ELEMENT_TYPE_I)->GetManagedClassObjectIfExists();
break;
default:
GCPROTECT_BEGIN(objSafeHandle);
- objSafeHandle = (SAFEHANDLE)AllocateObject(MscorlibBinder::GetClass(CLASS__SAFE_TYPENAMEPARSER_HANDLE));
+ objSafeHandle = (SAFEHANDLE)AllocateObject(CoreLibBinder::GetClass(CLASS__SAFE_TYPENAMEPARSER_HANDLE));
MethodDescCallSite strCtor(METHOD__SAFE_TYPENAMEPARSER_HANDLE__CTOR);
GCPROTECT_BEGIN(pReturnArguments);
- pReturnArguments = (PTRARRAYREF)AllocateObjectArray(count, MscorlibBinder::GetClass(CLASS__SAFE_TYPENAMEPARSER_HANDLE));
+ pReturnArguments = (PTRARRAYREF)AllocateObjectArray(count, CoreLibBinder::GetClass(CLASS__SAFE_TYPENAMEPARSER_HANDLE));
for (COUNT_T i = 0; i < count; i++)
{
// if szTypeName is not ASM-qualified, we will search for the types in the following order:
// - in pRequestingAssembly (if not NULL). pRequestingAssembly is the assembly that contained
// the custom attribute from which the typename was derived.
-// - in mscorlib.dll
+// - in CoreLib
// - raise an AssemblyResolveEvent() in the current appdomain
//
// pRequestingAssembly may be NULL. In that case, the "visibility" check will simply check that
// if szTypeName is not ASM-qualified, we will search for the types in the following order:
// - in pRequestingAssembly (if not NULL). pRequestingAssembly is the assembly that contained
// the custom attribute from which the typename was derived.
- // - in mscorlib.dll
+ // - in CoreLib
// - raise an AssemblyResolveEvent() in the current appdomain
//
// pRequestingAssembly may be NULL. In that case, the "visibility" check will simply check that
COMPlusThrow(kNullReferenceException);
if (pWeakReferenceMT == NULL)
- pWeakReferenceMT = MscorlibBinder::GetClass(CLASS__WEAKREFERENCE);
+ pWeakReferenceMT = CoreLibBinder::GetClass(CLASS__WEAKREFERENCE);
_ASSERTE(gc.pThis->GetMethodTable()->CanCastToClass(pWeakReferenceMT));
target_precompile_header(TARGET cee_wks_core HEADER common.h)
if (MSVC)
- # mscorlib.cpp does not compile with precompiled header file
- set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
+ # corelib.cpp does not compile with precompiled header file
+ set_source_files_properties(../corelib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
endif()
add_dependencies(cee_wks_core eventing_headers)
BOOL ZapImage::ShouldCompileMethodDef(mdMethodDef md)
{
DWORD partialNGenStressVal = PartialNGenStressPercentage();
- if (partialNGenStressVal &&
- // Module::AddCerListToRootTable has problems if mscorlib.dll is
- // a partial ngen image
- m_hModule != m_zapper->m_pEECompileInfo->GetLoaderModuleForMscorlib())
+ if (partialNGenStressVal)
{
_ASSERTE(partialNGenStressVal <= 100);
DWORD methodPercentageVal = (md % 100) + 1;
BOOL ZapImage::ShouldCompileInstantiatedMethod(CORINFO_METHOD_HANDLE handle)
{
DWORD partialNGenStressVal = PartialNGenStressPercentage();
- if (partialNGenStressVal &&
- // Module::AddCerListToRootTable has problems if mscorlib.dll is
- // a partial ngen image
- m_hModule != m_zapper->m_pEECompileInfo->GetLoaderModuleForMscorlib())
+ if (partialNGenStressVal)
{
_ASSERTE(partialNGenStressVal <= 100);
DWORD methodPercentageVal = (m_zapper->m_pEEJitInfo->getMethodHash(handle) % 100) + 1;
void Zapper::SetContextInfo(LPCWSTR assemblyName)
{
- // A special case: If we're compiling mscorlib, ignore m_exeName and don't set any context.
- // There can only be one mscorlib in the runtime, independent of any context. If we don't
- // check for mscorlib, and isExe == true, then CompilationDomain::SetContextInfo will call
- // into mscorlib and cause the resulting mscorlib.ni.dll to be slightly different (checked
+ // A special case: If we're compiling CoreLib, ignore m_exeName and don't set any context.
+ // There can only be one CoreLib in the runtime, independent of any context. If we don't
+ // check for CoreLib, and isExe == true, then CompilationDomain::SetContextInfo will call
+ // into CoreLib and cause the resulting System.Private.CoreLib.ni.dll to be slightly different (checked
// build only).
if (assemblyName != NULL && _wcsnicmp(assemblyName, CoreLibName_W, CoreLibNameLen) == 0 && (wcslen(assemblyName) == CoreLibNameLen || assemblyName[CoreLibNameLen] == W(',')))
{
{
HRESULT hr = S_OK;
- bool fMscorlib = false;
+ bool fCoreLib = false;
LPCWSTR fileName = PathFindFileName(string);
if (fileName != NULL && SString::_wcsicmp(fileName, g_pwBaseLibrary) == 0)
{
- fMscorlib = true;
+ fCoreLib = true;
}
- if (fMscorlib)
+ if (fCoreLib)
{
//
- // Disallow use of native image to force a new native image generation for mscorlib
+ // Disallow use of native image to force a new native image generation for CoreLib
//
g_fAllowNativeImages = false;
}
// That way the actual support checks will always be jitted.
// We only do this for CoreLib because forgetting to wrap intrinsics under IsSupported
// checks can lead to illegal instruction traps (instead of a nice managed exception).
- if (m_pEECompileInfo->GetAssemblyModule(m_hAssembly) == m_pEECompileInfo->GetLoaderModuleForMscorlib())
+ if (m_pEECompileInfo->GetAssemblyModule(m_hAssembly) == m_pEECompileInfo->GetLoaderModuleForCoreLib())
{
m_pOpt->m_compilerFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_FEATURE_SIMD);
// present. Other assemblies *MAY* benefit from this feature, but it doesn't show
// as useful at this time.
- if (m_hModule != m_zapper->m_pEECompileInfo->GetLoaderModuleForMscorlib())
+ if (m_hModule != m_zapper->m_pEECompileInfo->GetLoaderModuleForCoreLib())
return;
SArray<UINT16> table;