Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
9cfe4f87
R
runtime
项目概览
dotNET Platform
/
runtime
大约 1 年 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9cfe4f87
编写于
11月 21, 2019
作者:
E
Elinor Fung
提交者:
GitHub
11月 21, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove AppDomain::GetFusionContext (#188)
It is just the TPA binder context now. Remove dead code
上级
b4c44297
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
35 addition
and
319 deletion
+35
-319
src/coreclr/src/binder/applicationcontext.cpp
src/coreclr/src/binder/applicationcontext.cpp
+0
-11
src/coreclr/src/binder/fusionassemblyname.cpp
src/coreclr/src/binder/fusionassemblyname.cpp
+7
-81
src/coreclr/src/binder/inc/applicationcontext.hpp
src/coreclr/src/binder/inc/applicationcontext.hpp
+0
-24
src/coreclr/src/binder/inc/applicationcontext.inl
src/coreclr/src/binder/inc/applicationcontext.inl
+0
-5
src/coreclr/src/binder/inc/fusionassemblyname.hpp
src/coreclr/src/binder/inc/fusionassemblyname.hpp
+1
-7
src/coreclr/src/vm/appdomain.cpp
src/coreclr/src/vm/appdomain.cpp
+8
-43
src/coreclr/src/vm/appdomain.hpp
src/coreclr/src/vm/appdomain.hpp
+2
-30
src/coreclr/src/vm/assemblyspec.cpp
src/coreclr/src/vm/assemblyspec.cpp
+3
-3
src/coreclr/src/vm/clrprivbinderwinrt.cpp
src/coreclr/src/vm/clrprivbinderwinrt.cpp
+7
-83
src/coreclr/src/vm/clrprivbinderwinrt.h
src/coreclr/src/vm/clrprivbinderwinrt.h
+2
-17
src/coreclr/src/vm/compile.cpp
src/coreclr/src/vm/compile.cpp
+1
-1
src/coreclr/src/vm/coreassemblyspec.cpp
src/coreclr/src/vm/coreassemblyspec.cpp
+3
-13
src/coreclr/src/vm/corhost.cpp
src/coreclr/src/vm/corhost.cpp
+1
-1
未找到文件。
src/coreclr/src/binder/applicationcontext.cpp
浏览文件 @
9cfe4f87
...
...
@@ -76,7 +76,6 @@ namespace BINDER_SPACE
m_pFailureCache
=
NULL
;
m_contextCS
=
NULL
;
m_pTrustedPlatformAssemblyMap
=
nullptr
;
m_pFileNameHash
=
nullptr
;
}
ApplicationContext
::~
ApplicationContext
()
...
...
@@ -93,11 +92,6 @@ namespace BINDER_SPACE
{
delete
m_pTrustedPlatformAssemblyMap
;
}
if
(
m_pFileNameHash
!=
nullptr
)
{
delete
m_pFileNameHash
;
}
}
HRESULT
ApplicationContext
::
Init
()
...
...
@@ -220,7 +214,6 @@ namespace BINDER_SPACE
// Parse TrustedPlatformAssemblies
//
m_pTrustedPlatformAssemblyMap
=
new
SimpleNameToFileNameMap
();
m_pFileNameHash
=
new
TpaFileNameHash
();
sTrustedPlatformAssemblies
.
Normalize
();
...
...
@@ -349,10 +342,6 @@ namespace BINDER_SPACE
}
m_pTrustedPlatformAssemblyMap
->
AddOrReplace
(
mapEntry
);
FileNameMapEntry
fileNameExistenceEntry
;
fileNameExistenceEntry
.
m_wszFileName
=
wszFileName
;
m_pFileNameHash
->
AddOrReplace
(
fileNameExistenceEntry
);
}
//
...
...
src/coreclr/src/binder/fusionassemblyname.cpp
浏览文件 @
9cfe4f87
...
...
@@ -482,16 +482,11 @@ CreateAssemblyNameObject(
if
(
parseDisplayName
)
{
hr
=
pName
->
Init
(
NULL
,
NULL
);
if
(
FAILED
(
hr
))
{
goto
exit
;
}
hr
=
pName
->
Parse
((
LPWSTR
)
szAssemblyName
);
}
else
{
hr
=
pName
->
Init
(
szAssemblyName
,
NULL
);
hr
=
pName
->
SetName
(
szAssemblyName
);
}
if
(
FAILED
(
hr
))
...
...
@@ -507,40 +502,6 @@ exit:
return
hr
;
}
// ---------------------------------------------------------------------------
// CreateAssemblyNameObjectFromMetaData
// ---------------------------------------------------------------------------
STDAPI
CreateAssemblyNameObjectFromMetaData
(
LPASSEMBLYNAME
*
ppAssemblyName
,
LPCOLESTR
szAssemblyName
,
ASSEMBLYMETADATA
*
pamd
)
{
HRESULT
hr
=
S_OK
;
CAssemblyName
*
pName
=
NULL
;
pName
=
NEW
(
CAssemblyName
);
if
(
!
pName
)
{
hr
=
E_OUTOFMEMORY
;
goto
exit
;
}
hr
=
pName
->
Init
(
szAssemblyName
,
pamd
);
if
(
FAILED
(
hr
))
{
SAFERELEASE
(
pName
);
goto
exit
;
}
*
ppAssemblyName
=
pName
;
exit:
return
hr
;
}
// ---------------------------------------------------------------------------
// CAssemblyName constructor
// ---------------------------------------------------------------------------
...
...
@@ -566,50 +527,15 @@ CAssemblyName::~CAssemblyName()
}
// ---------------------------------------------------------------------------
// CAssemblyName::
Init
// CAssemblyName::
SetName
// ---------------------------------------------------------------------------
HRESULT
CAssemblyName
::
Init
(
LPCTSTR
pszAssemblyName
,
ASSEMBLYMETADATA
*
pamd
)
HRESULT
CAssemblyName
::
SetName
(
LPCTSTR
pszAssemblyName
)
{
HRESULT
hr
=
S_OK
;
if
(
pszAssemblyName
==
nullptr
)
return
E_INVALIDARG
;
// Name
if
(
pszAssemblyName
)
{
hr
=
SetProperty
(
ASM_NAME_NAME
,
(
LPTSTR
)
pszAssemblyName
,
(
DWORD
)((
wcslen
(
pszAssemblyName
)
+
1
)
*
sizeof
(
TCHAR
)));
if
(
FAILED
(
hr
))
goto
exit
;
}
if
(
pamd
)
{
// Major version
if
(
FAILED
(
hr
=
SetProperty
(
ASM_NAME_MAJOR_VERSION
,
&
pamd
->
usMajorVersion
,
sizeof
(
WORD
)))
// Minor version
||
FAILED
(
hr
=
SetProperty
(
ASM_NAME_MINOR_VERSION
,
&
pamd
->
usMinorVersion
,
sizeof
(
WORD
)))
// Revision number
||
FAILED
(
hr
=
SetProperty
(
ASM_NAME_REVISION_NUMBER
,
&
pamd
->
usRevisionNumber
,
sizeof
(
WORD
)))
// Build number
||
FAILED
(
hr
=
SetProperty
(
ASM_NAME_BUILD_NUMBER
,
&
pamd
->
usBuildNumber
,
sizeof
(
WORD
)))
// Culture
||
FAILED
(
hr
=
SetProperty
(
ASM_NAME_CULTURE
,
pamd
->
szLocale
,
pamd
->
cbLocale
*
sizeof
(
WCHAR
)))
)
{
goto
exit
;
}
}
exit:
return
hr
;
return
SetProperty
(
ASM_NAME_NAME
,
(
LPTSTR
)
pszAssemblyName
,
(
DWORD
)((
wcslen
(
pszAssemblyName
)
+
1
)
*
sizeof
(
TCHAR
)));
}
// ---------------------------------------------------------------------------
...
...
src/coreclr/src/binder/inc/applicationcontext.hpp
浏览文件 @
9cfe4f87
...
...
@@ -24,28 +24,6 @@ namespace BINDER_SPACE
{
//=============================================================================================
// Data structures for Simple Name -> File Name hash
struct
FileNameMapEntry
{
LPWSTR
m_wszFileName
;
};
class
FileNameHashTraits
:
public
NoRemoveSHashTraits
<
DefaultSHashTraits
<
FileNameMapEntry
>
>
{
public:
typedef
PCWSTR
key_t
;
static
const
FileNameMapEntry
Null
()
{
FileNameMapEntry
e
;
e
.
m_wszFileName
=
nullptr
;
return
e
;
}
static
bool
IsNull
(
const
FileNameMapEntry
&
e
)
{
return
e
.
m_wszFileName
==
nullptr
;
}
static
key_t
GetKey
(
const
FileNameMapEntry
&
e
)
{
key_t
key
;
key
=
e
.
m_wszFileName
;
return
key
;
}
static
count_t
Hash
(
const
key_t
&
str
)
{
return
HashiString
(
str
);
}
static
BOOL
Equals
(
const
key_t
&
lhs
,
const
key_t
&
rhs
)
{
LIMITED_METHOD_CONTRACT
;
return
(
_wcsicmp
(
lhs
,
rhs
)
==
0
);
}
};
typedef
SHash
<
FileNameHashTraits
>
TpaFileNameHash
;
// Entry in SHash table that maps namespace to list of files
struct
SimpleNameToFileNameMapEntry
...
...
@@ -133,7 +111,6 @@ namespace BINDER_SPACE
HRESULT
hrBindResult
);
inline
StringArrayList
*
GetAppPaths
();
inline
SimpleNameToFileNameMap
*
GetTpaList
();
inline
TpaFileNameHash
*
GetTpaFileNameList
();
inline
StringArrayList
*
GetPlatformResourceRoots
();
inline
StringArrayList
*
GetAppNiPaths
();
...
...
@@ -159,7 +136,6 @@ namespace BINDER_SPACE
StringArrayList
m_appNiPaths
;
SimpleNameToFileNameMap
*
m_pTrustedPlatformAssemblyMap
;
TpaFileNameHash
*
m_pFileNameHash
;
};
#include "applicationcontext.inl"
...
...
src/coreclr/src/binder/inc/applicationcontext.inl
浏览文件 @
9cfe4f87
...
...
@@ -69,11 +69,6 @@ SimpleNameToFileNameMap * ApplicationContext::GetTpaList()
return m_pTrustedPlatformAssemblyMap;
}
TpaFileNameHash * ApplicationContext::GetTpaFileNameList()
{
return m_pFileNameHash;
}
StringArrayList * ApplicationContext::GetPlatformResourceRoots()
{
return &m_platformResourceRoots;
...
...
src/coreclr/src/binder/inc/fusionassemblyname.hpp
浏览文件 @
9cfe4f87
...
...
@@ -79,7 +79,7 @@ public:
CAssemblyName
();
virtual
~
CAssemblyName
();
HRESULT
Init
(
LPCTSTR
pszAssemblyName
,
ASSEMBLYMETADATA
*
pamd
);
HRESULT
SetName
(
LPCTSTR
pszAssemblyName
);
HRESULT
Parse
(
LPCWSTR
szDisplayName
);
};
...
...
@@ -89,12 +89,6 @@ CreateAssemblyNameObject(
LPCOLESTR
szAssemblyName
,
bool
parseDisplayName
);
STDAPI
CreateAssemblyNameObjectFromMetaData
(
LPASSEMBLYNAME
*
ppAssemblyName
,
LPCOLESTR
szAssemblyName
,
ASSEMBLYMETADATA
*
pamd
);
namespace
fusion
{
namespace
util
...
...
src/coreclr/src/vm/appdomain.cpp
浏览文件 @
9cfe4f87
...
...
@@ -650,7 +650,6 @@ BaseDomain::BaseDomain()
m_fDisableInterfaceCache
=
FALSE
;
m_pFusionContext
=
NULL
;
m_pTPABinderContext
=
NULL
;
// Make sure the container is set to NULL so that it gets loaded when it is used.
...
...
@@ -794,7 +793,7 @@ void BaseDomain::InitVSD()
#ifndef CROSSGEN_COMPILE
void
BaseDomain
::
Clear
Fusion
Context
()
void
BaseDomain
::
Clear
Binder
Context
()
{
CONTRACTL
{
...
...
@@ -804,10 +803,6 @@ void BaseDomain::ClearFusionContext()
}
CONTRACTL_END
;
if
(
m_pFusionContext
)
{
m_pFusionContext
->
Release
();
m_pFusionContext
=
NULL
;
}
if
(
m_pTPABinderContext
)
{
m_pTPABinderContext
->
Release
();
m_pTPABinderContext
=
NULL
;
...
...
@@ -1705,10 +1700,10 @@ void SystemDomain::DetachEnd()
if
(
m_pSystemDomain
)
{
GCX_PREEMP
();
m_pSystemDomain
->
Clear
Fusion
Context
();
m_pSystemDomain
->
Clear
Binder
Context
();
AppDomain
*
pAppDomain
=
GetAppDomain
();
if
(
pAppDomain
)
pAppDomain
->
Clear
Fusion
Context
();
pAppDomain
->
Clear
Binder
Context
();
}
}
...
...
@@ -2668,30 +2663,6 @@ void SystemDomain::AddDomain(AppDomain* pDomain)
pDomain
));
}
BOOL
SystemDomain
::
RemoveDomain
(
AppDomain
*
pDomain
)
{
CONTRACTL
{
NOTHROW
;
GC_TRIGGERS
;
MODE_ANY
;
PRECONDITION
(
CheckPointer
(
pDomain
));
PRECONDITION
(
!
pDomain
->
IsDefaultDomain
());
}
CONTRACTL_END
;
// You can not remove the default domain.
if
(
!
pDomain
->
IsActive
())
return
FALSE
;
pDomain
->
Release
();
return
TRUE
;
}
#ifdef PROFILING_SUPPORTED
void
SystemDomain
::
NotifyProfilerStartup
()
{
...
...
@@ -5344,7 +5315,7 @@ AppDomain::RaiseUnhandledExceptionEvent(OBJECTREF *pThrowable, BOOL isTerminatin
#endif // CROSSGEN_COMPILE
IUnknown
*
AppDomain
::
Create
Fusion
Context
()
IUnknown
*
AppDomain
::
Create
Binder
Context
()
{
CONTRACT
(
IUnknown
*
)
{
...
...
@@ -5356,23 +5327,17 @@ IUnknown *AppDomain::CreateFusionContext()
}
CONTRACT_END
;
if
(
!
m_p
Fusion
Context
)
if
(
!
m_p
TPABinder
Context
)
{
ETWOnStartup
(
FusionAppCtx_V1
,
FusionAppCtxEnd_V1
);
CLRPrivBinderCoreCLR
*
pTPABinder
=
NULL
;
GCX_PREEMP
();
// Initialize the assembly binder for the default context loads for CoreCLR.
IfFailThrow
(
CCoreCLRBinderHelper
::
DefaultBinderSetupContext
(
DefaultADID
,
&
pTPABinder
));
m_pFusionContext
=
reinterpret_cast
<
IUnknown
*>
(
pTPABinder
);
// By default, initial binding context setup for CoreCLR is also the TPABinding context
(
m_pTPABinderContext
=
pTPABinder
)
->
AddRef
();
IfFailThrow
(
CCoreCLRBinderHelper
::
DefaultBinderSetupContext
(
DefaultADID
,
&
m_pTPABinderContext
));
}
RETURN
m_p
Fusion
Context
;
RETURN
m_p
TPABinder
Context
;
}
...
...
@@ -6879,7 +6844,7 @@ PTR_DomainAssembly AppDomain::FindAssembly(PTR_ICLRPrivAssembly pHostAssembly)
void
ZapperSetBindingPaths
(
ICorCompilationDomain
*
pDomain
,
SString
&
trustedPlatformAssemblies
,
SString
&
platformResourceRoots
,
SString
&
appPaths
,
SString
&
appNiPaths
)
{
CLRPrivBinderCoreCLR
*
pBinder
=
static_cast
<
CLRPrivBinderCoreCLR
*>
(((
CompilationDomain
*
)
pDomain
)
->
GetFusionContext
()
);
CLRPrivBinderCoreCLR
*
pBinder
=
((
CompilationDomain
*
)
pDomain
)
->
GetTPABinderContext
(
);
_ASSERTE
(
pBinder
!=
NULL
);
pBinder
->
SetupBindingPaths
(
trustedPlatformAssemblies
,
platformResourceRoots
,
appPaths
,
appNiPaths
);
#ifdef FEATURE_COMINTEROP
...
...
src/coreclr/src/vm/appdomain.hpp
浏览文件 @
9cfe4f87
...
...
@@ -966,14 +966,6 @@ public:
return
NULL
;
}
#ifdef FEATURE_COMINTEROP
//****************************************************************************************
//
// This will look up interop data for a method table
//
#endif // FEATURE_COMINTEROP
void
SetDisableInterfaceCache
()
{
m_fDisableInterfaceCache
=
TRUE
;
...
...
@@ -1141,11 +1133,8 @@ public:
#endif // DACCESS_COMPILE && !CROSSGEN_COMPILE
IUnknown
*
GetFusionContext
()
{
LIMITED_METHOD_CONTRACT
;
return
m_pFusionContext
;
}
CLRPrivBinderCoreCLR
*
GetTPABinderContext
()
{
LIMITED_METHOD_CONTRACT
;
return
m_pTPABinderContext
;
}
CrstExplicitInit
*
GetLoaderAllocatorReferencesLock
()
{
LIMITED_METHOD_CONTRACT
;
...
...
@@ -1158,10 +1147,6 @@ protected:
// Helper method to initialize the large heap handle table.
void
InitLargeHeapHandleTable
();
//****************************************************************************************
// Adds an assembly to the domain.
void
AddAssemblyNoLock
(
Assembly
*
assem
);
//****************************************************************************************
//
// Hash table that maps a MethodTable to COM Interop compatibility data.
...
...
@@ -1186,11 +1171,6 @@ protected:
JitListLock
m_JITLock
;
ListLock
m_ILStubGenLock
;
// Fusion context, used for adding assemblies to the is domain. It defines
// fusion properties for finding assemblyies such as SharedBinPath,
// PrivateBinPath, Application Directory, etc.
IUnknown
*
m_pFusionContext
;
// Current binding context for the domain
CLRPrivBinderCoreCLR
*
m_pTPABinderContext
;
// Reference to the binding context that holds TPA list details
IGCHandleStore
*
m_handleStore
;
...
...
@@ -1215,7 +1195,7 @@ protected:
public:
// Only call this routine when you can guarantee there are no
// loads in progress.
void
Clear
Fusion
Context
();
void
Clear
Binder
Context
();
//****************************************************************************************
// Synchronization holders.
...
...
@@ -2260,7 +2240,7 @@ public:
return
m_tpIndex
;
}
IUnknown
*
Create
Fusion
Context
();
IUnknown
*
Create
Binder
Context
();
void
SetIgnoreUnhandledExceptions
()
{
...
...
@@ -3015,10 +2995,6 @@ public:
static
void
PublishAppDomainAndInformDebugger
(
AppDomain
*
pDomain
);
#endif // DEBUGGING_SUPPORTED
//****************************************************************************************
// Helper function to remove a domain from the system
BOOL
RemoveDomain
(
AppDomain
*
pDomain
);
// Does not decrement the reference
#ifdef PROFILING_SUPPORTED
//****************************************************************************************
// Tell profiler about system created domains which are created before the profiler is
...
...
@@ -3113,10 +3089,6 @@ public:
private:
//****************************************************************************************
// Helper function to create the single COM domain
void
CreateDefaultDomain
();
//****************************************************************************************
// Helper function to add a domain to the global list
void
AddDomain
(
AppDomain
*
pDomain
);
...
...
src/coreclr/src/vm/assemblyspec.cpp
浏览文件 @
9cfe4f87
...
...
@@ -807,7 +807,7 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo
// TPABinder context anyways.
//
// Get the reference to the default binding context (this could be the TPABinder context or custom AssemblyLoadContext)
pParentAssemblyBinder
=
static_cast
<
ICLRPrivBinder
*>
(
pDomain
->
Get
Fusion
Context
());
pParentAssemblyBinder
=
static_cast
<
ICLRPrivBinder
*>
(
pDomain
->
Get
TPABinder
Context
());
}
}
...
...
@@ -844,7 +844,7 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo
//
// In such a case, the parent assembly (semantically) is CoreLibrary and thus, the default binding context should be
// used as the parent assembly binder.
pParentAssemblyBinder
=
static_cast
<
ICLRPrivBinder
*>
(
pDomain
->
Get
Fusion
Context
());
pParentAssemblyBinder
=
static_cast
<
ICLRPrivBinder
*>
(
pDomain
->
Get
TPABinder
Context
());
}
return
pParentAssemblyBinder
;
...
...
@@ -1221,7 +1221,7 @@ AssemblySpecBindingCache::AssemblyBinding* AssemblySpecBindingCache::LookupInter
else
{
// For System.Private.Corelib Binding context is either not set or if set then it should be TPA
_ASSERTE
(
pSpec
->
GetBindingContext
()
==
NULL
||
pSpec
->
GetBindingContext
()
==
pSpecDomain
->
Get
Fusion
Context
());
_ASSERTE
(
pSpec
->
GetBindingContext
()
==
NULL
||
pSpec
->
GetBindingContext
()
==
pSpecDomain
->
Get
TPABinder
Context
());
}
if
(
pBinderContextForLookup
!=
NULL
)
...
...
src/coreclr/src/vm/clrprivbinderwinrt.cpp
浏览文件 @
9cfe4f87
...
...
@@ -198,13 +198,6 @@ CLRPrivBinderWinRT::GetOrCreateBinder(
return
clr
::
SafeAddRef
(
s_pSingleton
);
}
//=====================================================================================================================
STDAPI
CreateAssemblyNameObjectFromMetaData
(
LPASSEMBLYNAME
*
ppAssemblyName
,
LPCOLESTR
szAssemblyName
,
ASSEMBLYMETADATA
*
pamd
);
//=====================================================================================================================
HRESULT
CLRPrivBinderWinRT
::
BindWinRTAssemblyByName
(
IAssemblyName
*
pAssemblyName
,
...
...
@@ -300,20 +293,6 @@ HRESULT CLRPrivBinderWinRT::BindWinRTAssemblyByName(
NewHolder
<
CLRPrivResourcePathImpl
>
pResource
(
new
CLRPrivResourcePathImpl
(
wszFileName
));
ReleaseHolder
<
IAssemblyName
>
pAssemblyDefName
;
// Instead of using the metadata of the assembly to get the AssemblyDef name, fake one up from the filename.
// This ties in with the PreBind binding behavior and ngen. This particular logic was implemented in order
// to provide best performance as actually reading the metadata was prohibitively slow. (Due to the cost of opening
// the assembly file.) We use a zeroed out ASSEMBLYMETADATA structure to create the assembly name object
// in order to ensure that every field of the assembly name is filled out as if this was created from a normal
// assembly def row.
// See comment on CLRPrivBinderWinRT::PreBind for further details about NGEN binding and WinMDs.
ASSEMBLYMETADATA
asmd
=
{
0
};
IfFailGo
(
CreateAssemblyNameObjectFromMetaData
(
&
pAssemblyDefName
,
wszFileNameStripped
,
&
asmd
));
DWORD
dwAsmContentType
=
AssemblyContentType_WindowsRuntime
;
IfFailGo
(
pAssemblyDefName
->
SetProperty
(
ASM_NAME_CONTENT_TYPE
,
(
LPBYTE
)
&
dwAsmContentType
,
sizeof
(
dwAsmContentType
)));
//
// Creating the BindResult we will pass to the native binder to find native images.
// We strip off the type from the assembly name, leaving the simple assembly name.
...
...
@@ -323,8 +302,6 @@ HRESULT CLRPrivBinderWinRT::BindWinRTAssemblyByName(
// native image for this WinRT assembly.
// The WinRT team has said that WinMDs will have the same simple name as the filename.
//
IfFailGo
(
pAssemblyDefName
->
SetProperty
(
ASM_NAME_NAME
,
wszFileNameStripped
,
(
DWORD
)((
wcslen
(
wszFileNameStripped
)
+
1
)
*
sizeof
(
WCHAR
))));
NewHolder
<
CoreBindResult
>
pBindResult
(
new
CoreBindResult
());
StackSString
sAssemblyPath
(
pResource
->
GetPath
());
ReleaseHolder
<
BINDER_SPACE
::
Assembly
>
pBinderAssembly
;
...
...
@@ -391,24 +368,6 @@ HRESULT CLRPrivBinderWinRT::BindWinRTAssemblyByName(
return
hr
;
}
//=====================================================================================================================
HRESULT
CLRPrivBinderWinRT
::
BindWinRTAssemblyByName
(
IAssemblyName
*
pAssemblyName
,
IBindResult
**
ppIBindResult
)
{
STANDARD_VM_CONTRACT
;
HRESULT
hr
=
S_OK
;
VALIDATE_ARG_RET
(
pAssemblyName
!=
nullptr
);
VALIDATE_ARG_RET
(
ppIBindResult
!=
nullptr
);
ReleaseHolder
<
CLRPrivAssemblyWinRT
>
pWinRTAssembly
;
IfFailRet
(
BindWinRTAssemblyByName
(
pAssemblyName
,
&
pWinRTAssembly
));
IfFailRet
(
pWinRTAssembly
->
GetIBindResult
(
ppIBindResult
));
return
hr
;
}
//
// This method opens the assembly using the CoreCLR Binder, which has logic supporting opening either the IL or
// even just the native image without IL present.
...
...
@@ -964,21 +923,21 @@ CLRPrivBinderWinRT::FindAssemblyForTypeIfLoaded(
CLRPrivAssemblyWinRT
::
CLRPrivAssemblyWinRT
(
CLRPrivBinderWinRT
*
pBinder
,
CLRPrivResourcePathImpl
*
pResourceIL
,
IBindResult
*
pI
BindResult
,
CoreBindResult
*
p
BindResult
,
BOOL
fShareable
)
:
m_pBinder
(
nullptr
),
m_pResourceIL
(
nullptr
),
m_pIResourceNI
(
nullptr
),
m_p
I
BindResult
(
nullptr
),
m_pBindResult
(
nullptr
),
m_dwImageTypes
(
0
),
m_FallbackBinder
(
nullptr
)
{
STANDARD_VM_CONTRACT
;
VALIDATE_ARG_THROW
((
pBinder
!=
nullptr
)
&&
(
pResourceIL
!=
nullptr
)
&&
(
p
I
BindResult
!=
nullptr
));
VALIDATE_ARG_THROW
((
pBinder
!=
nullptr
)
&&
(
pResourceIL
!=
nullptr
)
&&
(
pBindResult
!=
nullptr
));
m_pBinder
=
clr
::
SafeAddRef
(
pBinder
);
m_pResourceIL
=
clr
::
SafeAddRef
(
pResourceIL
);
m_p
IBindResult
=
clr
::
SafeAddRef
(
pI
BindResult
);
m_p
BindResult
=
clr
::
SafeAddRef
(
p
BindResult
);
}
//=====================================================================================================================
...
...
@@ -1064,7 +1023,7 @@ HRESULT CLRPrivAssemblyWinRT::GetImageResource(
STANDARD_BIND_CONTRACT
;
HRESULT
hr
=
S_OK
;
VALIDATE_ARG_RET
((
ppIResource
!=
nullptr
)
&&
(
m_p
I
BindResult
!=
nullptr
));
VALIDATE_ARG_RET
((
ppIResource
!=
nullptr
)
&&
(
m_pBindResult
!=
nullptr
));
EX_TRY
{
...
...
@@ -1115,21 +1074,6 @@ HRESULT CLRPrivBinderWinRT::GetBinderID(
return
S_OK
;
}
//=====================================================================================================================
HRESULT
CLRPrivAssemblyWinRT
::
GetIBindResult
(
IBindResult
**
ppIBindResult
)
{
LIMITED_METHOD_CONTRACT
;
VALIDATE_ARG_RET
(
ppIBindResult
!=
nullptr
);
VALIDATE_CONDITION
((
m_pIBindResult
!=
nullptr
),
return
E_UNEXPECTED
);
*
ppIBindResult
=
clr
::
SafeAddRef
(
m_pIBindResult
);
return
S_OK
;
}
//=====================================================================================================================
HRESULT
CLRPrivAssemblyWinRT
::
EnsureAvailableImageTypes
()
{
...
...
@@ -1143,9 +1087,9 @@ HRESULT CLRPrivAssemblyWinRT::EnsureAvailableImageTypes()
{
if
(
m_pIResourceNI
==
nullptr
)
{
if
(
m_p
I
BindResult
->
HasNativeImage
())
if
(
m_pBindResult
->
HasNativeImage
())
{
SString
sPath
=
m_p
I
BindResult
->
GetNativeImage
()
->
GetPath
();
SString
sPath
=
m_pBindResult
->
GetNativeImage
()
->
GetPath
();
m_pIResourceNI
=
new
CLRPrivResourcePathImpl
(
sPath
.
GetUnicode
());
m_pIResourceNI
->
AddRef
();
}
...
...
@@ -1167,24 +1111,4 @@ ErrExit:
return
hr
;
}
//=====================================================================================================================
//static
HRESULT
CLRPrivAssemblyWinRT
::
GetIBindResult
(
ICLRPrivAssembly
*
pPrivAssembly
,
IBindResult
**
ppIBindResult
)
{
LIMITED_METHOD_CONTRACT
;
HRESULT
hr
;
VALIDATE_ARG_RET
(
pPrivAssembly
!=
nullptr
);
ReleaseHolder
<
ICLRPrivAssemblyID_WinRT
>
pAssemblyID
;
IfFailRet
(
pPrivAssembly
->
QueryInterface
(
__uuidof
(
ICLRPrivAssemblyID_WinRT
),
(
LPVOID
*
)
&
pAssemblyID
));
// QI succeeded, we can cast up:
CLRPrivAssemblyWinRT
*
pPrivAssemblyWinRT
=
static_cast
<
CLRPrivAssemblyWinRT
*>
(
pPrivAssembly
);
return
pPrivAssemblyWinRT
->
GetIBindResult
(
ppIBindResult
);
}
#endif //!DACCESS_COMPILE
src/coreclr/src/vm/clrprivbinderwinrt.h
浏览文件 @
9cfe4f87
...
...
@@ -22,9 +22,6 @@
#include "coreclr/corebindresult.h"
// IBindResult maps directly to its one and only implementation on CoreCLR.
typedef
CoreBindResult
IBindResult
;
//=====================================================================================================================
// Forward declarations
class
CLRPrivBinderWinRT
;
...
...
@@ -158,11 +155,6 @@ public:
IAssemblyName
*
pIAssemblyName
,
ICLRPrivAssembly
**
ppPrivAssembly
);
// Binds WinRT assemblies only.
HRESULT
BindWinRTAssemblyByName
(
IAssemblyName
*
pIAssemblyName
,
IBindResult
**
ppIBindResult
);
HRESULT
GetAssemblyAndTryFindNativeImage
(
SString
&
sWinmdFilename
,
LPCWSTR
pwzSimpleName
,
BINDER_SPACE
::
Assembly
**
ppAssembly
);
// On Phone the application's APP_PATH CoreCLR hosting config property is used as the app
// package graph for RoResolveNamespace to find 3rd party WinMDs. This method wires up
...
...
@@ -257,18 +249,11 @@ public:
CLRPrivAssemblyWinRT
(
CLRPrivBinderWinRT
*
pBinder
,
CLRPrivBinderUtil
::
CLRPrivResourcePathImpl
*
pResourceIL
,
IBindResult
*
pI
BindResult
,
CoreBindResult
*
p
BindResult
,
BOOL
fShareable
);
~
CLRPrivAssemblyWinRT
();
HRESULT
GetIBindResult
(
IBindResult
**
ppIBindResult
);
static
HRESULT
GetIBindResult
(
ICLRPrivAssembly
*
pPrivAssembly
,
IBindResult
**
ppIBindResult
);
//=============================================================================================
// IUnknown interface methods
...
...
@@ -335,7 +320,7 @@ private:
ReleaseHolder
<
CLRPrivBinderUtil
::
CLRPrivResourcePathImpl
>
m_pResourceIL
;
// This cannot be a holder as there can be a race to assign to it.
ICLRPrivResource
*
m_pIResourceNI
;
ReleaseHolder
<
IBindResult
>
m_pI
BindResult
;
ReleaseHolder
<
CoreBindResult
>
m_p
BindResult
;
Volatile
<
DWORD
>
m_dwImageTypes
;
ReleaseHolder
<
ICLRPrivBinder
>
m_FallbackBinder
;
};
// class CLRPrivAssemblyWinRT
src/coreclr/src/vm/compile.cpp
浏览文件 @
9cfe4f87
...
...
@@ -165,7 +165,7 @@ HRESULT CEECompileInfo::CreateDomain(ICorCompilationDomain **ppDomain,
{
GCX_COOP
();
pCompilationDomain
->
Create
Fusion
Context
();
pCompilationDomain
->
Create
Binder
Context
();
pCompilationDomain
->
SetFriendlyName
(
W
(
"Compilation Domain"
));
SystemDomain
::
System
()
->
LoadDomain
(
pCompilationDomain
);
...
...
src/coreclr/src/vm/coreassemblyspec.cpp
浏览文件 @
9cfe4f87
...
...
@@ -324,20 +324,10 @@ HRESULT BaseAssemblySpec::ParseName()
_ASSERTE
(
pDomain
);
BINDER_SPACE
::
ApplicationContext
*
pAppContext
=
NULL
;
IUnknown
*
pIUnknownBinder
=
pDomain
->
GetFusionContext
();
if
(
pIUnknownBinder
!=
NULL
)
CLRPrivBinderCoreCLR
*
pBinder
=
pDomain
->
GetTPABinderContext
();
if
(
pBinder
!=
NULL
)
{
#if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
if
(
pDomain
->
GetFusionContext
()
!=
pDomain
->
GetTPABinderContext
())
{
pAppContext
=
(
static_cast
<
CLRPrivBinderAssemblyLoadContext
*>
(
static_cast
<
ICLRPrivBinder
*>
(
pIUnknownBinder
)))
->
GetAppContext
();
}
else
#endif // !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
{
pAppContext
=
(
static_cast
<
CLRPrivBinderCoreCLR
*>
(
pIUnknownBinder
))
->
GetAppContext
();
}
pAppContext
=
pBinder
->
GetAppContext
();
}
hr
=
CCoreCLRBinderHelper
::
GetAssemblyIdentity
(
m_pAssemblyName
,
pAppContext
,
pAssemblyIdentity
);
...
...
src/coreclr/src/vm/corhost.cpp
浏览文件 @
9cfe4f87
...
...
@@ -688,7 +688,7 @@ HRESULT CorHost2::_CreateAppDomain(
if
(
dwFlags
&
APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS
)
pDomain
->
SetForceTrivialWaitOperations
();
pDomain
->
Create
Fusion
Context
();
pDomain
->
Create
Binder
Context
();
{
GCX_COOP
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录