Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/vm/appdomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5029,8 +5029,7 @@ AppDomain::BindHostedPrivAssembly(
//---------------------------------------------------------------------------------------------------------------------
PEAssembly * AppDomain::BindAssemblySpec(
AssemblySpec * pSpec,
BOOL fThrowOnFileNotFound,
BOOL fUseHostBinderIfAvailable)
BOOL fThrowOnFileNotFound)
{
STATIC_CONTRACT_THROWS;
STATIC_CONTRACT_GC_TRIGGERS;
Expand Down Expand Up @@ -5065,7 +5064,7 @@ PEAssembly * AppDomain::BindAssemblySpec(
goto EndTry2; // Goto end of try block.

PTR_CLRPrivAssemblyWinRT assem = dac_cast<PTR_CLRPrivAssemblyWinRT>(pAssembly->GetHostAssembly());
assem->SetFallbackBinder(pSpec->GetHostBinder());
assem->SetFallbackBinder(pSpec->GetFallbackLoadContextBinderForRequestingAssembly());
EndTry2:;
}
// The combination of this conditional catch/ the following if statement which will throw reduces the count of exceptions
Expand Down
3 changes: 1 addition & 2 deletions src/vm/appdomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2097,8 +2097,7 @@ class AppDomain : public BaseDomain
// static binding goes through this path.
virtual PEAssembly * BindAssemblySpec(
AssemblySpec *pSpec,
BOOL fThrowOnFileNotFound,
BOOL fUseHostBinderIfAvailable = TRUE) DAC_EMPTY_RET(NULL);
BOOL fThrowOnFileNotFound) DAC_EMPTY_RET(NULL);

HRESULT BindAssemblySpecForHostedBinder(
AssemblySpec * pSpec,
Expand Down
14 changes: 0 additions & 14 deletions src/vm/assemblyspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,14 +908,6 @@ DomainAssembly *AssemblySpec::LoadDomainAssembly(FileLoadLevel targetLevel,

ETWOnStartup (LoaderCatchCall_V1, LoaderCatchCallEnd_V1);
AppDomain* pDomain = GetAppDomain();

ICLRPrivBinder* pBinder = GetHostBinder();

// If no binder was explicitly set, check if parent assembly has a binder.
if (pBinder == nullptr)
{
pBinder = GetBindingContextFromParentAssembly(pDomain);
}

DomainAssembly* pAssembly = nullptr;
if (CanUseWithBindingCache())
Expand Down Expand Up @@ -1494,8 +1486,6 @@ BOOL AssemblySpecBindingCache::StoreAssembly(AssemblySpec *pSpec, DomainAssembly
THROWS;
GC_TRIGGERS;
MODE_ANY;
// Host binder based assembly spec's cannot currently be safely inserted into caches.
PRECONDITION(pSpec->GetHostBinder() == nullptr);
POSTCONDITION(UnsafeContains(this, pSpec));
POSTCONDITION(UnsafeVerifyLookupAssembly(this, pSpec, pAssembly));
INJECT_FAULT(COMPlusThrowOM(););
Expand Down Expand Up @@ -1582,8 +1572,6 @@ BOOL AssemblySpecBindingCache::StoreFile(AssemblySpec *pSpec, PEAssembly *pFile)
THROWS;
GC_TRIGGERS;
MODE_ANY;
// Host binder based assembly spec's cannot currently be safely inserted into caches.
PRECONDITION(pSpec->GetHostBinder() == nullptr);
POSTCONDITION((!RETVAL) || (UnsafeContains(this, pSpec) && UnsafeVerifyLookupFile(this, pSpec, pFile)));
INJECT_FAULT(COMPlusThrowOM(););
}
Expand Down Expand Up @@ -1672,8 +1660,6 @@ BOOL AssemblySpecBindingCache::StoreException(AssemblySpec *pSpec, Exception* pE
THROWS;
GC_TRIGGERS;
MODE_ANY;
// Host binder based assembly spec's cannot currently be safely inserted into caches.
PRECONDITION(pSpec->GetHostBinder() == nullptr);
DISABLED(POSTCONDITION(UnsafeContains(this, pSpec))); //<TODO>@todo: Getting violations here - StoreExceptions could happen anywhere so this is possibly too aggressive.</TODO>
INJECT_FAULT(COMPlusThrowOM(););
}
Expand Down
13 changes: 0 additions & 13 deletions src/vm/assemblyspec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,6 @@ class AssemblySpec : public BaseAssemblySpec
STATIC_CONTRACT_LIMITED_METHOD;
return HasUniqueIdentity();
}

inline ICLRPrivBinder *GetHostBinder() const
{
LIMITED_METHOD_CONTRACT;
return m_pHostBinder;
}

inline void SetHostBinder(ICLRPrivBinder *pHostBinder)
{
LIMITED_METHOD_CONTRACT;
m_pHostBinder = pHostBinder;
}

};

#define INITIAL_ASM_SPEC_HASH_SIZE 7
Expand Down
1 change: 0 additions & 1 deletion src/vm/baseassemblyspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class BaseAssemblySpec
LPCWSTR m_wszCodeBase; // URL to the code
LPCSTR m_szWinRtTypeNamespace;
LPCSTR m_szWinRtTypeClassName;
ICLRPrivBinder *m_pHostBinder;
int m_ownedFlags;
ICLRPrivBinder *m_pBindingContext;

Expand Down
2 changes: 0 additions & 2 deletions src/vm/baseassemblyspec.inl
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ inline void BaseAssemblySpec::CopyFrom(const BaseAssemblySpec *pSpec)

m_context = pSpec->m_context;

m_pHostBinder = pSpec->m_pHostBinder;

if ((pSpec->m_ownedFlags & BAD_NAME_OWNED) != 0)
{
m_ownedFlags |= BAD_NAME_OWNED;
Expand Down
10 changes: 4 additions & 6 deletions src/vm/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ HRESULT CEECompileInfo::LoadAssemblyByPath(
// If there is a host binder then use it to bind the assembly.
if (isWinRT)
{
pAssemblyHolder = pDomain->BindAssemblySpec(&spec, TRUE, FALSE);
pAssemblyHolder = pDomain->BindAssemblySpec(&spec, TRUE);
}
else
{
Expand Down Expand Up @@ -531,7 +531,7 @@ HRESULT CEECompileInfo::SetCompilationTarget(CORINFO_ASSEMBLY_HANDLE assembl

AssemblySpec mscorlib;
mscorlib.InitializeSpec(SystemDomain::SystemFile());
GetAppDomain()->BindAssemblySpec(&mscorlib,TRUE,FALSE);
GetAppDomain()->BindAssemblySpec(&mscorlib,TRUE);

if (!IsReadyToRunCompilation() && !SystemDomain::SystemFile()->HasNativeImage())
{
Expand Down Expand Up @@ -7178,8 +7178,7 @@ void ReportMissingDependency(Exception * e)

PEAssembly *CompilationDomain::BindAssemblySpec(
AssemblySpec *pSpec,
BOOL fThrowOnFileNotFound,
BOOL fUseHostBinderIfAvailable)
BOOL fThrowOnFileNotFound)
{
PEAssembly *pFile = NULL;
//
Expand All @@ -7194,8 +7193,7 @@ PEAssembly *CompilationDomain::BindAssemblySpec(
//
pFile = AppDomain::BindAssemblySpec(
pSpec,
fThrowOnFileNotFound,
fUseHostBinderIfAvailable);
fThrowOnFileNotFound);
}
EX_HOOK
{
Expand Down
3 changes: 1 addition & 2 deletions src/vm/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,7 @@ class CompilationDomain : public AppDomain,

PEAssembly *BindAssemblySpec(
AssemblySpec *pSpec,
BOOL fThrowOnFileNotFound,
BOOL fUseHostBinderIfAvailable = TRUE) DAC_EMPTY_RET(NULL);
BOOL fThrowOnFileNotFound) DAC_EMPTY_RET(NULL);

BOOL CanEagerBindToZapFile(Module *targetModule, BOOL limitToHardBindList = TRUE);

Expand Down