diff options
-rw-r--r-- | src/inc/corinfo.h | 37 | ||||
-rw-r--r-- | src/inc/corjit.h | 9 | ||||
-rw-r--r-- | src/inc/corjithost.h | 48 | ||||
-rw-r--r-- | src/inc/jithost.h | 28 | ||||
-rw-r--r-- | src/jit/ClrJit.exports | 1 | ||||
-rw-r--r-- | src/jit/dll/clrjit.def | 3 | ||||
-rw-r--r-- | src/jit/ee_il_dll.cpp | 16 | ||||
-rw-r--r-- | src/jit/jitpch.h | 4 | ||||
-rw-r--r-- | src/jit/protojit/protojit.def | 3 | ||||
-rw-r--r-- | src/utilcode/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/utilcode/UtilCode.vcproj | 4 | ||||
-rw-r--r-- | src/utilcode/UtilCode.vcxproj | 1 | ||||
-rw-r--r-- | src/utilcode/jithost.cpp | 75 | ||||
-rw-r--r-- | src/utilcode/utilcode.settings.targets | 2 | ||||
-rw-r--r-- | src/vm/codeman.cpp | 22 | ||||
-rw-r--r-- | src/vm/codeman.h | 2 | ||||
-rw-r--r-- | src/vm/jitinterface.cpp | 94 | ||||
-rw-r--r-- | src/vm/jitinterface.h | 13 | ||||
-rw-r--r-- | src/zap/common.h | 1 | ||||
-rw-r--r-- | src/zap/zapinfo.cpp | 31 | ||||
-rw-r--r-- | src/zap/zapinfo.h | 6 | ||||
-rw-r--r-- | src/zap/zapper.cpp | 8 |
22 files changed, 220 insertions, 189 deletions
diff --git a/src/inc/corinfo.h b/src/inc/corinfo.h index 5616e71895..d6a497aaca 100644 --- a/src/inc/corinfo.h +++ b/src/inc/corinfo.h @@ -231,11 +231,11 @@ TODO: Talk about initializing strutures before use #if COR_JIT_EE_VERSION > 460 // Update this one -SELECTANY const GUID JITEEVersionIdentifier = { /* 13accf3d-12d7-4fd4-bc65-d73578b1a474 */ - 0x13accf3d, - 0x12d7, - 0x4fd4, - { 0xbc, 0x65, 0xd7, 0x35, 0x78, 0xb1, 0xa4, 0x74 } +SELECTANY const GUID JITEEVersionIdentifier = { /* 35ef98ab-fd22-4ccc-8ddb-b1156a7d94f3 */ + 0x35ef98ab, + 0xfd22, + 0x4ccc, + { 0x8d, 0xdb, 0xb1, 0x15, 0x6a, 0x7d, 0x94, 0xf3 } }; #else @@ -2758,33 +2758,6 @@ public: /* OUT */ SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr ) = 0; - /*************************************************************************/ - // - // Configuration values - Allows querying of the CLR configuration. - // - /*************************************************************************/ - - // Return an integer ConfigValue if any. - // - virtual int getIntConfigValue( - const wchar_t *name, - int defaultValue - ) = 0; - - // Return a string ConfigValue if any. - // - virtual wchar_t *getStringConfigValue( - const wchar_t *name - ) = 0; - - // Free a string ConfigValue returned by the runtime. - // JITs using the getStringConfigValue query are required - // to return the string values to the runtime for deletion. - // this avoid leaking the memory in the JIT. - virtual void freeStringConfigValue( - __in_z wchar_t *value - ) = 0; - #endif // COR_JIT_EE_VERSION }; diff --git a/src/inc/corjit.h b/src/inc/corjit.h index 561e4b1520..32ceac6880 100644 --- a/src/inc/corjit.h +++ b/src/inc/corjit.h @@ -320,9 +320,16 @@ enum CheckedWriteBarrierKinds { }; #endif +#if COR_JIT_EE_VERSION > 460 + +#include "corjithost.h" + +extern "C" void __stdcall jitStartup(ICorJitHost* host); + +#endif + class ICorJitCompiler; class ICorJitInfo; - struct IEEMemoryManager; extern "C" ICorJitCompiler* __stdcall getJit(); diff --git a/src/inc/corjithost.h b/src/inc/corjithost.h new file mode 100644 index 0000000000..8242fab2b8 --- /dev/null +++ b/src/inc/corjithost.h @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#ifndef __CORJITHOST_H__ +#define __CORJITHOST_H__ + +// ICorJitHost +// +// ICorJitHost provides the interface that the JIT uses to access some functionality that +// would normally be provided by the operating system. This is intended to allow for +// host-specific policies re: memory allocation, configuration value access, etc. It is +// expected that the `ICorJitHost` value provided to `jitStartup` lives at least as +// long as the JIT itself. +class ICorJitHost +{ +public: + // Allocate memory of the given size in bytes. All bytes of the returned block + // must be initialized to zero. If `usePageAllocator` is true, the implementation + // should use an allocator that deals in OS pages if one exists. + virtual void* allocateMemory(size_t size, bool usePageAllocator = false) = 0; + + // Frees memory previous obtained by a call to `ICorJitHost::allocateMemory`. The + // value of the `usePageAllocator` parameter must match the value that was + // provided to the call to used to allocate the memory. + virtual void freeMemory(void* block, bool usePageAllocator = false) = 0; + + // Return an integer config value for the given key, if any exists. + virtual int getIntConfigValue( + const wchar_t* name, + int defaultValue + ) = 0; + + // Return a string config value for the given key, if any exists. + virtual const wchar_t* getStringConfigValue( + const wchar_t* name + ) = 0; + + // Free a string ConfigValue returned by the runtime. + // JITs using the getStringConfigValue query are required + // to return the string values to the runtime for deletion. + // This avoids leaking the memory in the JIT. + virtual void freeStringConfigValue( + const wchar_t* value + ) = 0; +}; + +#endif diff --git a/src/inc/jithost.h b/src/inc/jithost.h new file mode 100644 index 0000000000..73ad3343b5 --- /dev/null +++ b/src/inc/jithost.h @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#ifndef __JITHOST_H__ +#define __JITHOST_H__ + +// Common implementation of ICorJitHost that respects CLR host policies. +class JitHost : public ICorJitHost +{ +private: + static JitHost theJitHost; + + JitHost() {} + JitHost(const JitHost& other) = delete; + JitHost& operator=(const JitHost& other) = delete; + +public: + virtual void* allocateMemory(size_t size, bool usePageAllocator); + virtual void freeMemory(void* block, bool usePageAllocator); + virtual int getIntConfigValue(const wchar_t* name, int defaultValue); + virtual const wchar_t* getStringConfigValue(const wchar_t* name); + virtual void freeStringConfigValue(const wchar_t* value); + + static ICorJitHost* getJitHost(); +}; + +#endif // __JITHOST_H__ diff --git a/src/jit/ClrJit.exports b/src/jit/ClrJit.exports index 9a914d7038..0126e63b4d 100644 --- a/src/jit/ClrJit.exports +++ b/src/jit/ClrJit.exports @@ -1,2 +1,3 @@ getJit +jitStartup sxsJitStartup diff --git a/src/jit/dll/clrjit.def b/src/jit/dll/clrjit.def index 73a6ba1ae1..1603af74ca 100644 --- a/src/jit/dll/clrjit.def +++ b/src/jit/dll/clrjit.def @@ -3,4 +3,5 @@ ; See the LICENSE file in the project root for more information. EXPORTS getJit - sxsJitStartup
\ No newline at end of file + jitStartup + sxsJitStartup diff --git a/src/jit/ee_il_dll.cpp b/src/jit/ee_il_dll.cpp index f32f87557f..f0da62d153 100644 --- a/src/jit/ee_il_dll.cpp +++ b/src/jit/ee_il_dll.cpp @@ -19,8 +19,10 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #endif #include "emit.h" + /*****************************************************************************/ +static ICorJitHost* g_jitHost = nullptr; static CILJit* ILJitter = 0; // The one and only JITTER I return #ifndef FEATURE_MERGE_JIT_AND_ENGINE HINSTANCE g_hInst = NULL; @@ -45,8 +47,11 @@ JitOptions jitOpts = /*****************************************************************************/ -void jitStartup() +extern "C" +void __stdcall jitStartup(ICorJitHost* jitHost) { + g_jitHost = jitHost; + #ifdef FEATURE_TRACELOGGING JitTelemetry::NotifyDllProcessAttach(); #endif @@ -61,13 +66,16 @@ void jitShutdown() #endif } + /***************************************************************************** * jitOnDllProcessAttach() called by DllMain() when jit.dll is loaded */ void jitOnDllProcessAttach() { - jitStartup(); +#if COR_JIT_EE_VERSION <= 460 + jitStartup(JitHost::getJitHost()); +#endif } /***************************************************************************** @@ -79,7 +87,6 @@ void jitOnDllProcessDetach() jitShutdown(); } - #ifndef FEATURE_MERGE_JIT_AND_ENGINE extern "C" @@ -139,9 +146,6 @@ ICorJitCompiler* __stdcall getJit() if (ILJitter == 0) { ILJitter = new (CILJitSingleton) CILJit(); -#ifdef FEATURE_MERGE_JIT_AND_ENGINE - jitStartup(); -#endif } return(ILJitter); } diff --git a/src/jit/jitpch.h b/src/jit/jitpch.h index 7c333a72c2..a3c7e24464 100644 --- a/src/jit/jitpch.h +++ b/src/jit/jitpch.h @@ -16,6 +16,10 @@ #include <cstdlib> #include <intrin.h> +#if COR_JIT_EE_VERSION <= 460 +#include "corjithost.h" +#include "jithost.h" +#endif #include "jit.h" #include "iallocator.h" #include "hashbv.h" diff --git a/src/jit/protojit/protojit.def b/src/jit/protojit/protojit.def index 73a6ba1ae1..1603af74ca 100644 --- a/src/jit/protojit/protojit.def +++ b/src/jit/protojit/protojit.def @@ -3,4 +3,5 @@ ; See the LICENSE file in the project root for more information. EXPORTS getJit - sxsJitStartup
\ No newline at end of file + jitStartup + sxsJitStartup diff --git a/src/utilcode/CMakeLists.txt b/src/utilcode/CMakeLists.txt index 9aeb243790..001205a62b 100644 --- a/src/utilcode/CMakeLists.txt +++ b/src/utilcode/CMakeLists.txt @@ -61,6 +61,7 @@ set(UTILCODE_COMMON_SOURCES pedecoder.cpp winfix.cpp longfilepathwrappers.cpp + jithost.cpp ) # These source file do not yet compile on Linux. diff --git a/src/utilcode/UtilCode.vcproj b/src/utilcode/UtilCode.vcproj index d43c2a02c3..c12516464a 100644 --- a/src/utilcode/UtilCode.vcproj +++ b/src/utilcode/UtilCode.vcproj @@ -604,6 +604,10 @@ RelativePath=".\longfilepathwrappers.cpp" > </File> + <File + RelativePath=".\jithost.cpp" + > + </File> </Files> <Globals> </Globals> diff --git a/src/utilcode/UtilCode.vcxproj b/src/utilcode/UtilCode.vcxproj index b0cca8dd70..54afef7da4 100644 --- a/src/utilcode/UtilCode.vcxproj +++ b/src/utilcode/UtilCode.vcxproj @@ -436,6 +436,7 @@ <ClCompile Include="UTSEM.cpp" /> <ClCompile Include="winfix.cpp" /> <ClCompile Include="longfilepathwrappers.cpp" /> + <ClCompile Include="jithost.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="hostimpl.h" /> diff --git a/src/utilcode/jithost.cpp b/src/utilcode/jithost.cpp new file mode 100644 index 0000000000..88479de24f --- /dev/null +++ b/src/utilcode/jithost.cpp @@ -0,0 +1,75 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +#include "utilcode.h" +#include "corjit.h" +#include "jithost.h" + +void* JitHost::allocateMemory(size_t size, bool usePageAllocator) +{ + WRAPPER_NO_CONTRACT; + + if (usePageAllocator) + { + return GetEEMemoryManager()->ClrVirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); + } + else + { + return ClrAllocInProcessHeap(0, S_SIZE_T(size)); + } +} + +void JitHost::freeMemory(void* block, bool usePageAllocator) +{ + WRAPPER_NO_CONTRACT; + + if (usePageAllocator) + { + GetEEMemoryManager()->ClrVirtualFree(block, 0, MEM_RELEASE); + } + else + { + ClrFreeInProcessHeap(0, block); + } +} + +int JitHost::getIntConfigValue(const wchar_t* name, int defaultValue) +{ + WRAPPER_NO_CONTRACT; + + // Translate JIT call into runtime configuration query + CLRConfig::ConfigDWORDInfo info{ name, defaultValue, CLRConfig::REGUTIL_default }; + + // Perform a CLRConfig look up on behalf of the JIT. + return CLRConfig::GetConfigValue(info); +} + +const wchar_t* JitHost::getStringConfigValue(const wchar_t* name) +{ + WRAPPER_NO_CONTRACT; + + // Translate JIT call into runtime configuration query + CLRConfig::ConfigStringInfo info{ name, CLRConfig::REGUTIL_default }; + + // Perform a CLRConfig look up on behalf of the JIT. + return CLRConfig::GetConfigValue(info); +} + +void JitHost::freeStringConfigValue(const wchar_t* value) +{ + WRAPPER_NO_CONTRACT; + + CLRConfig::FreeConfigString(const_cast<wchar_t*>(value)); +} + +JitHost JitHost::theJitHost; +ICorJitHost* JitHost::getJitHost() +{ + STATIC_CONTRACT_SO_TOLERANT; + STATIC_CONTRACT_GC_NOTRIGGER; + STATIC_CONTRACT_NOTHROW; + STATIC_CONTRACT_CANNOT_TAKE_LOCK; + + return &theJitHost; +} diff --git a/src/utilcode/utilcode.settings.targets b/src/utilcode/utilcode.settings.targets index 690000d402..7c11fd50b4 100644 --- a/src/utilcode/utilcode.settings.targets +++ b/src/utilcode/utilcode.settings.targets @@ -125,5 +125,7 @@ <CppCompile Include="$(UtilCodeSrcDir)\SecurityUtil.cpp" /> <CppCompile Include="$(UtilCodeSrcDir)\AppXUtil.cpp" Condition="'$(FeatureAppX)' == 'true'"/> + + <CppCompile Include="$(UtilCodeSrcDir)\jithost.cpp" /> </ItemGroup> </Project> diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp index 4f99539215..eb6a976e45 100644 --- a/src/vm/codeman.cpp +++ b/src/vm/codeman.cpp @@ -9,6 +9,7 @@ #include "common.h" #include "jitinterface.h" #include "corjit.h" +#include "jithost.h" #include "eetwain.h" #include "eeconfig.h" #include "excep.h" @@ -1332,6 +1333,8 @@ enum JIT_LOAD_STATUS JIT_LOAD_STATUS_DONE_LOAD, // LoadLibrary of the JIT dll succeeded. JIT_LOAD_STATUS_DONE_GET_SXSJITSTARTUP, // GetProcAddress for "sxsJitStartup" succeeded. JIT_LOAD_STATUS_DONE_CALL_SXSJITSTARTUP, // Calling sxsJitStartup() succeeded. + JIT_LOAD_STATUS_DONE_GET_JITSTARTUP, // GetProcAddress for "jitStartup" succeeded. + JIT_LOAD_STATUS_DONE_CALL_JITSTARTUP, // Calling jitStartup() succeeded. JIT_LOAD_STATUS_DONE_GET_GETJIT, // GetProcAddress for "getJit" succeeded. JIT_LOAD_STATUS_DONE_CALL_GETJIT, // Calling getJit() succeeded. JIT_LOAD_STATUS_DONE_CALL_GETVERSIONIDENTIFIER, // Calling ICorJitCompiler::getVersionIdentifier() succeeded. @@ -1427,6 +1430,18 @@ static void LoadAndInitializeJIT(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT I pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_SXSJITSTARTUP; + typedef void (__stdcall* pjitStartup)(ICorJitHost*); + pjitStartup jitStartupFn = (pjitStartup) GetProcAddress(*phJit, "jitStartup"); + + if (jitStartupFn) + { + pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_GET_JITSTARTUP; + + (*jitStartupFn)(JitHost::getJitHost()); + + pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_JITSTARTUP; + } + typedef ICorJitCompiler* (__stdcall* pGetJitFn)(); pGetJitFn getJitFn = (pGetJitFn) GetProcAddress(*phJit, "getJit"); @@ -1490,6 +1505,7 @@ static void LoadAndInitializeJIT(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT I } #ifdef FEATURE_MERGE_JIT_AND_ENGINE +EXTERN_C void __stdcall jitStartup(ICorJitHost* host); EXTERN_C ICorJitCompiler* __stdcall getJit(); #endif // FEATURE_MERGE_JIT_AND_ENGINE @@ -1517,11 +1533,11 @@ BOOL EEJitManager::LoadJIT() #ifdef FEATURE_MERGE_JIT_AND_ENGINE - typedef ICorJitCompiler* (__stdcall* pGetJitFn)(); - pGetJitFn getJitFn = (pGetJitFn) getJit; EX_TRY { - newJitCompiler = (*getJitFn)(); + jitStartup(JitHost::getJitHost()); + + newJitCompiler = getJit(); // We don't need to call getVersionIdentifier(), since the JIT is linked together with the VM. } diff --git a/src/vm/codeman.h b/src/vm/codeman.h index 71a86bf364..3f10aba74c 100644 --- a/src/vm/codeman.h +++ b/src/vm/codeman.h @@ -836,7 +836,7 @@ private: /*****************************************************************************/ -class EEJitManager :public IJitManager +class EEJitManager : public IJitManager { #ifdef DACCESS_COMPILE friend class ClrDataAccess; diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index d04d978c0f..54c9043a8b 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -13436,100 +13436,6 @@ void CEEInfo::GetProfilingHandle(BOOL *pbHookFunction, UNREACHABLE(); // only called on derived class. } -// Allow access to CLRConfig environment variables from the JIT with -// out exposing CLR internals. -// -// Args: -// name - String name being queried for. -// defaultValue - Default integer value to return if no value is found. -// -// Returns: -// Raw string from environment variable. Caller owns the string. -// -int CEEInfo::getIntConfigValue( - const wchar_t *name, int defaultValue - ) -{ - CONTRACTL{ - SO_TOLERANT; - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - DWORD ret = defaultValue; - - JIT_TO_EE_TRANSITION(); - - // Translate JIT call into runtime configuration query - CLRConfig::ConfigDWORDInfo info{ name, defaultValue, CLRConfig::REGUTIL_default }; - - // Perform a CLRConfig look up on behalf of the JIT. - ret = CLRConfig::GetConfigValue(info); - - EE_TO_JIT_TRANSITION(); - - return ret; -} - -// Allow access to CLRConfig environment variables from the JIT with -// out exposing CLR internals. -// -// Args: -// name - String name being queried for. -// -// Returns: -// Raw string from environment variable. Caller owns the string. -// -wchar_t *CEEInfo::getStringConfigValue( - const wchar_t *name - ) -{ - CONTRACTL{ - SO_TOLERANT; - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - wchar_t * returnStr = nullptr; - - JIT_TO_EE_TRANSITION(); - - // Translate JIT call into runtime configuration query - CLRConfig::ConfigStringInfo info{ name, CLRConfig::REGUTIL_default }; - - // Perform a CLRConfig look up on behalf of the JIT. - returnStr = CLRConfig::GetConfigValue(info); - - EE_TO_JIT_TRANSITION(); - - return returnStr; -} - -// Free runtime allocated CLRConfig strings requrested by the JIT. -// -// Args: -// value - String to be freed. -// -void CEEInfo::freeStringConfigValue( - wchar_t *value - ) -{ - CONTRACTL{ - SO_TOLERANT; - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - JIT_TO_EE_TRANSITION(); - - CLRConfig::FreeConfigString(value); - - EE_TO_JIT_TRANSITION(); -} - #endif // !DACCESS_COMPILE EECodeInfo::EECodeInfo() diff --git a/src/vm/jitinterface.h b/src/vm/jitinterface.h index ce2c7deec8..215ceda4b2 100644 --- a/src/vm/jitinterface.h +++ b/src/vm/jitinterface.h @@ -1055,19 +1055,6 @@ public: DWORD getExpectedTargetArchitecture(); - int getIntConfigValue( - const wchar_t *name, - int defaultValue - ); - - wchar_t *getStringConfigValue( - const wchar_t *name - ); - - void freeStringConfigValue( - __in_z wchar_t *value - ); - CEEInfo(MethodDesc * fd = NULL, bool fVerifyOnly = false) : m_pOverride(NULL), m_pMethodBeingCompiled(fd), diff --git a/src/zap/common.h b/src/zap/common.h index 44bb2740a2..95655fd9b8 100644 --- a/src/zap/common.h +++ b/src/zap/common.h @@ -29,6 +29,7 @@ #include "utilcode.h" #include "corjit.h" +#include "jithost.h" #include "corcompile.h" #include "iceefilegen.h" #ifdef FEATURE_FUSION diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp index d6862f2e9d..0b9d0a6a42 100644 --- a/src/zap/zapinfo.cpp +++ b/src/zap/zapinfo.cpp @@ -3838,34 +3838,3 @@ BOOL ZapInfo::CurrentMethodHasProfileData() ICorJitInfo::ProfileBuffer * profileBuffer; return SUCCEEDED(getBBProfileData(m_currentMethodHandle, &size, &profileBuffer, NULL)); } - -int ZapInfo::getIntConfigValue(const wchar_t *name, int defaultValue) -{ - int ret; - - // Translate JIT call into runtime configuration query - CLRConfig::ConfigDWORDInfo info{name, defaultValue, CLRConfig::REGUTIL_default}; - - // Perform a CLRConfig look up on behalf of the JIT. - ret = CLRConfig::GetConfigValue(info); - - return ret; -} - -wchar_t *ZapInfo::getStringConfigValue(const wchar_t *name) -{ - wchar_t *returnStr = nullptr; - - // Translate JIT call into runtime configuration query - CLRConfig::ConfigStringInfo info { name, CLRConfig::REGUTIL_default }; - - // Perform a CLRConfig look up on behalf of the JIT. - returnStr = CLRConfig::GetConfigValue(info); - - return returnStr; -} - -void ZapInfo::freeStringConfigValue(wchar_t *value) -{ - CLRConfig::FreeConfigString(value); -} diff --git a/src/zap/zapinfo.h b/src/zap/zapinfo.h index dab1b295a2..bb1c1103d2 100644 --- a/src/zap/zapinfo.h +++ b/src/zap/zapinfo.h @@ -693,12 +693,6 @@ public: void HandleException(struct _EXCEPTION_POINTERS *pExceptionPointers); void ThrowExceptionForJitResult(HRESULT result); void ThrowExceptionForHelper(const CORINFO_HELPER_DESC * throwHelper); - - int getIntConfigValue(const wchar_t *name, int defaultValue); - - wchar_t *getStringConfigValue(const wchar_t *name); - - void freeStringConfigValue(__in_z wchar_t *value); }; #endif // __ZAPINFO_H__ diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp index 6d559d377b..77bb114143 100644 --- a/src/zap/zapper.cpp +++ b/src/zap/zapper.cpp @@ -772,6 +772,13 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi (*sxsJitStartupFn) (cccallbacks); #endif + typedef void (__stdcall* pJitStartup)(ICorJitHost* host); + pJitStartup jitStartupFn = (pJitStartup)GetProcAddress(*phJit, "jitStartup"); + if (jitStartupFn != nullptr) + { + jitStartupFn(JitHost::getJitHost()); + } + //get the appropriate compiler interface typedef ICorJitCompiler* (__stdcall* pGetJitFn)(); pGetJitFn getJitFn = (pGetJitFn) GetProcAddress(*phJit, "getJit"); @@ -882,6 +889,7 @@ void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument) // #ifdef FEATURE_MERGE_JIT_AND_ENGINE + jitStartup(JitHost::getJitHost()); m_pJitCompiler = getJit(); if (m_pJitCompiler == NULL) |