Add ability to AutoStartProfiling for CoreCLR.
authorLubomir Litchev <lubol@microsoft.com>
Tue, 26 Apr 2016 20:11:02 +0000 (13:11 -0700)
committerLubomir Litchev <lubol@microsoft.com>
Mon, 2 May 2016 18:37:53 +0000 (11:37 -0700)
Add ability to do MultiCoreJit profiling in the CoreCLR. This is used for
testing of the MultiCoreJit functionality.

Commit migrated from https://github.com/dotnet/coreclr/commit/031f312f208c8798805c8d43234b3a4a37ea030c

src/coreclr/src/vm/corhost.cpp

index 0f61b4a..7fbd0ca 100644 (file)
@@ -1302,6 +1302,8 @@ HRESULT CorHost2::ExecuteAssembly(DWORD dwAppDomainId,
 
     HRESULT hr = S_OK;
 
+    AppDomain *pCurDomain = SystemDomain::GetCurrentDomain();
+
     Thread *pThread = GetThread();
     if (pThread == NULL)
     {
@@ -1312,7 +1314,7 @@ HRESULT CorHost2::ExecuteAssembly(DWORD dwAppDomainId,
         }
     }
 
-    if(SystemDomain::GetCurrentDomain()->GetId().m_dwId != DefaultADID)
+    if(pCurDomain->GetId().m_dwId != DefaultADID)
     {
         return HOST_E_INVALIDOPERATION;
     }
@@ -1324,6 +1326,10 @@ HRESULT CorHost2::ExecuteAssembly(DWORD dwAppDomainId,
 
     Assembly *pAssembly = AssemblySpec::LoadAssembly(pwzAssemblyPath);
 
+#if defined(FEATURE_MULTICOREJIT)
+    pCurDomain->GetMulticoreJitManager().AutoStartProfile(pCurDomain);
+#endif // defined(FEATURE_MULTICOREJIT)
+
     {
         GCX_COOP();
 
@@ -8729,7 +8735,7 @@ HRESULT STDMETHODCALLTYPE DllGetActivationFactoryImpl(LPCWSTR wszAssemblyName,
     {
         BaseDomain::LockHolder lh(pDomain);
 #ifdef FEATURE_HOSTED_BINDER
-        if (!SystemDomain::System()->DefaultDomain()->HasLoadContextHostBinder())
+        if (!pDomain->HasLoadContextHostBinder())
 #endif
         {
             // don't allow redirects