Module *pModule = refType->GetType().GetAssembly()->GetManifestModule();
pDomainFile = pModule->FindDomainFile(GetAppDomain());
-#ifdef FEATURE_LOADER_OPTIMIZATION
- if (pDomainFile == NULL)
- {
- HELPER_METHOD_FRAME_BEGIN_RET_1(refType);
-
- pDomainFile = GetAppDomain()->LoadDomainNeutralModuleDependency(pModule, FILE_LOADED);
-
- HELPER_METHOD_FRAME_END();
- }
-#endif // FEATURE_LOADER_OPTIMIZATION
-
FC_RETURN_ASSEMBLY_OBJECT((DomainAssembly *)pDomainFile, refType);
}
TypeHandle th = TypeHandle::FromPtr(pTypeHandle);
assert(handleType >= HNDTYPE_WEAK_SHORT && handleType <= HNDTYPE_WEAK_WINRT);
- objHandle = th.GetDomain()->CreateTypedHandle(NULL, static_cast<HandleType>(handleType));
+ objHandle = AppDomain::GetCurrentDomain()->CreateTypedHandle(NULL, static_cast<HandleType>(handleType));
th.GetLoaderAllocator()->RegisterHandleForCleanup(objHandle);
END_QCALL;
// with at least an abstract method. b19897_GetInterfaceMap_Abstract.exe tests this case.
//@TODO:STUBDISPATCH: Don't need to track down the implementation, just the declaration, and this can
//@TODO: be done faster - just need to make a function FindDispatchDecl.
- DispatchSlot slot(typeHandle.GetMethodTable()->FindDispatchSlotForInterfaceMD(thOwnerOfMD, pMD));
+ DispatchSlot slot(typeHandle.GetMethodTable()->FindDispatchSlotForInterfaceMD(thOwnerOfMD, pMD, TRUE /* throwOnConflict */));
if (!slot.IsNull())
pResult = slot.GetMethodDesc();
return;
}
-void QCALLTYPE RuntimeTypeHandle::GetTypeByName(LPCWSTR pwzClassName, BOOL bThrowOnError, BOOL bIgnoreCase, BOOL bReflectionOnly,
+void QCALLTYPE RuntimeTypeHandle::GetTypeByName(LPCWSTR pwzClassName, BOOL bThrowOnError, BOOL bIgnoreCase,
QCall::StackCrawlMarkHandle pStackMark,
ICLRPrivBinder * pPrivHostBinder,
BOOL bLoadTypeFromPartialNameHack, QCall::ObjectHandleOnStack retType,
COMPlusThrowArgumentNull(W("className"),W("ArgumentNull_String"));
{
- typeHandle = TypeName::GetTypeManaged(pwzClassName, NULL, bThrowOnError, bIgnoreCase, bReflectionOnly, /*bProhibitAsmQualifiedName =*/ FALSE, pStackMark,
+ typeHandle = TypeName::GetTypeManaged(pwzClassName, NULL, bThrowOnError, bIgnoreCase, /*bProhibitAsmQualifiedName =*/ FALSE, pStackMark,
bLoadTypeFromPartialNameHack, (OBJECTREF*)keepAlive.m_ppObject,
pPrivHostBinder);
}
return funcPtr;
}
+
+BOOL QCALLTYPE RuntimeMethodHandle::GetIsCollectible(MethodDesc * pMethod)
+{
+ QCALL_CONTRACT;
+
+ BOOL isCollectible = FALSE;
+
+ BEGIN_QCALL;
+
+ isCollectible = pMethod->GetLoaderAllocator()->IsCollectible();
+
+ END_QCALL;
+
+ return isCollectible;
+}
FCIMPL1(LPCUTF8, RuntimeMethodHandle::GetUtf8Name, MethodDesc *pMethod) {
CONTRACTL {
FCIMPLEND
-FCIMPL2(MethodBody *, RuntimeMethodHandle::GetMethodBody, ReflectMethodObject *pMethodUNSAFE, ReflectClassBaseObject *pDeclaringTypeUNSAFE)
+FCIMPL2(RuntimeMethodBody *, RuntimeMethodHandle::GetMethodBody, ReflectMethodObject *pMethodUNSAFE, ReflectClassBaseObject *pDeclaringTypeUNSAFE)
{
CONTRACTL
{
struct _gc
{
- METHODBODYREF MethodBodyObj;
- EXCEPTIONHANDLINGCLAUSEREF EHClauseObj;
+ RUNTIMEMETHODBODYREF MethodBodyObj;
+ RUNTIMEEXCEPTIONHANDLINGCLAUSEREF EHClauseObj;
RUNTIMELOCALVARIABLEINFOREF RuntimeLocalVariableInfoObj;
U1ARRAYREF U1Array;
BASEARRAYREF TempArray;
if (pILHeader)
{
- MethodTable * pExceptionHandlingClauseMT = MscorlibBinder::GetClass(CLASS__EH_CLAUSE);
+ MethodTable * pExceptionHandlingClauseMT = MscorlibBinder::GetClass(CLASS__RUNTIME_EH_CLAUSE);
TypeHandle thEHClauseArray = ClassLoader::LoadArrayTypeThrowing(TypeHandle(pExceptionHandlingClauseMT), ELEMENT_TYPE_SZARRAY);
MethodTable * pLocalVariableMT = MscorlibBinder::GetClass(CLASS__RUNTIME_LOCAL_VARIABLE_INFO);
}
}
- gc.MethodBodyObj = (METHODBODYREF)AllocateObject(MscorlibBinder::GetClass(CLASS__METHOD_BODY));
+ gc.MethodBodyObj = (RUNTIMEMETHODBODYREF)AllocateObject(MscorlibBinder::GetClass(CLASS__RUNTIME_METHOD_BODY));
- gc.MethodBodyObj->m_maxStackSize = header.GetMaxStack();
- gc.MethodBodyObj->m_initLocals = !!(header.GetFlags() & CorILMethod_InitLocals);
+ gc.MethodBodyObj->_maxStackSize = header.GetMaxStack();
+ gc.MethodBodyObj->_initLocals = !!(header.GetFlags() & CorILMethod_InitLocals);
if (header.IsFat())
- gc.MethodBodyObj->m_localVarSigToken = header.GetLocalVarSigTok();
+ gc.MethodBodyObj->_localVarSigToken = header.GetLocalVarSigTok();
else
- gc.MethodBodyObj->m_localVarSigToken = 0;
+ gc.MethodBodyObj->_localVarSigToken = 0;
// Allocate the array of IL and fill it in from the method header.
BYTE* pIL = const_cast<BYTE*>(header.Code);
COUNT_T cIL = header.GetCodeSize();
gc.U1Array = (U1ARRAYREF) AllocatePrimitiveArray(ELEMENT_TYPE_U1, cIL);
- SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->m_IL, gc.U1Array, GetAppDomain());
- memcpyNoGCRefs(gc.MethodBodyObj->m_IL->GetDataPtr(), pIL, cIL);
+ SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->_IL, gc.U1Array, GetAppDomain());
+ memcpyNoGCRefs(gc.MethodBodyObj->_IL->GetDataPtr(), pIL, cIL);
// Allocate the array of exception clauses.
INT32 cEh = (INT32)header.EHCount();
const COR_ILMETHOD_SECT_EH* ehInfo = header.EH;
gc.TempArray = (BASEARRAYREF) AllocateArrayEx(thEHClauseArray, &cEh, 1);
- SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->m_exceptionClauses, gc.TempArray, GetAppDomain());
+ SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->_exceptionClauses, gc.TempArray, GetAppDomain());
for (INT32 i = 0; i < cEh; i++)
{
const COR_ILMETHOD_SECT_EH_CLAUSE_FAT* ehClause =
(const COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)ehInfo->EHClause(i, &ehBuff);
- gc.EHClauseObj = (EXCEPTIONHANDLINGCLAUSEREF) AllocateObject(pExceptionHandlingClauseMT);
+ gc.EHClauseObj = (RUNTIMEEXCEPTIONHANDLINGCLAUSEREF) AllocateObject(pExceptionHandlingClauseMT);
- gc.EHClauseObj->m_flags = ehClause->GetFlags();
- gc.EHClauseObj->m_tryOffset = ehClause->GetTryOffset();
- gc.EHClauseObj->m_tryLength = ehClause->GetTryLength();
- gc.EHClauseObj->m_handlerOffset = ehClause->GetHandlerOffset();
- gc.EHClauseObj->m_handlerLength = ehClause->GetHandlerLength();
+ gc.EHClauseObj->_flags = ehClause->GetFlags();
+ gc.EHClauseObj->_tryOffset = ehClause->GetTryOffset();
+ gc.EHClauseObj->_tryLength = ehClause->GetTryLength();
+ gc.EHClauseObj->_handlerOffset = ehClause->GetHandlerOffset();
+ gc.EHClauseObj->_handlerLength = ehClause->GetHandlerLength();
if ((ehClause->GetFlags() & COR_ILEXCEPTION_CLAUSE_FILTER) == 0)
- gc.EHClauseObj->m_catchToken = ehClause->GetClassToken();
+ gc.EHClauseObj->_catchToken = ehClause->GetClassToken();
else
- gc.EHClauseObj->m_filterOffset = ehClause->GetFilterOffset();
+ gc.EHClauseObj->_filterOffset = ehClause->GetFilterOffset();
- gc.MethodBodyObj->m_exceptionClauses->SetAt(i, (OBJECTREF) gc.EHClauseObj);
- SetObjectReference((OBJECTREF*)&(gc.EHClauseObj->m_methodBody), (OBJECTREF)gc.MethodBodyObj, GetAppDomain());
+ gc.MethodBodyObj->_exceptionClauses->SetAt(i, (OBJECTREF) gc.EHClauseObj);
+ SetObjectReference((OBJECTREF*)&(gc.EHClauseObj->_methodBody), (OBJECTREF)gc.MethodBodyObj, GetAppDomain());
}
if (header.LocalVarSig != NULL)
MetaSig::sigLocalVars);
INT32 cLocals = metaSig.NumFixedArgs();
gc.TempArray = (BASEARRAYREF) AllocateArrayEx(thLocalVariableArray, &cLocals, 1);
- SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->m_localVariables, gc.TempArray, GetAppDomain());
+ SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->_localVariables, gc.TempArray, GetAppDomain());
for (INT32 i = 0; i < cLocals; i ++)
{
TypeHandle tempType= metaSig.GetArgProps().GetTypeHandleThrowing(pModule, &sigTypeContext);
OBJECTREF refLocalType = tempType.GetManagedClassObject();
gc.RuntimeLocalVariableInfoObj->SetType(refLocalType);
- gc.MethodBodyObj->m_localVariables->SetAt(i, (OBJECTREF) gc.RuntimeLocalVariableInfoObj);
+ gc.MethodBodyObj->_localVariables->SetAt(i, (OBJECTREF) gc.RuntimeLocalVariableInfoObj);
}
}
else
{
INT32 cLocals = 0;
gc.TempArray = (BASEARRAYREF) AllocateArrayEx(thLocalVariableArray, &cLocals, 1);
- SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->m_localVariables, gc.TempArray, GetAppDomain());
+ SetObjectReference((OBJECTREF*)&gc.MethodBodyObj->_localVariables, gc.TempArray, GetAppDomain());
}
}
}
HELPER_METHOD_FRAME_END();
- return (MethodBody*)OBJECTREFToObject(gc.MethodBodyObj);
+ return (RuntimeMethodBody*)OBJECTREFToObject(gc.MethodBodyObj);
}
FCIMPLEND