diff options
author | Jan Kotas <jkotas@microsoft.com> | 2019-05-24 05:34:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-24 05:34:44 -0700 |
commit | e4134398fd3c91cf3db99972f66fa74d5aa32bcf (patch) | |
tree | 4a2a5e515a8c2b23818203e3a81a7794013e7516 /src/ToolBox | |
parent | d5d18896900561b7aaf38ba9501a8525a4b9caea (diff) | |
download | coreclr-e4134398fd3c91cf3db99972f66fa74d5aa32bcf.tar.gz coreclr-e4134398fd3c91cf3db99972f66fa74d5aa32bcf.tar.bz2 coreclr-e4134398fd3c91cf3db99972f66fa74d5aa32bcf.zip |
Remove dependency on IEEMemoryManager (#24755)
Diffstat (limited to 'src/ToolBox')
4 files changed, 70 insertions, 80 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp b/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp index a2a01b14a7..71d0e49a2b 100644 --- a/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp +++ b/src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp @@ -84,10 +84,10 @@ void SetLogFilePath() extern "C" #ifdef FEATURE_PAL -DLLEXPORT // For Win32 PAL LoadLibrary emulation + DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif - BOOL - DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) + BOOL + DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { @@ -203,25 +203,23 @@ extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& origin // get entry point pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(g_hRealJit, "sxsJitStartup"); - if (pnsxsJitStartup == 0) - { - LogError("sxsJitStartup() - GetProcAddress 'sxsJitStartup' failed (0x%08x)", ::GetLastError()); - return; - } - // Setup CoreClrCallbacks and call sxsJitStartup - original_CoreClrCallbacks = new CoreClrCallbacks(); - original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; - original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE; - original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; - original_CoreClrCallbacks->m_pfnGetCLRFunction = original_cccallbacks.m_pfnGetCLRFunction; + if (pnsxsJitStartup != nullptr) + { + // Setup CoreClrCallbacks and call sxsJitStartup + original_CoreClrCallbacks = new CoreClrCallbacks(); + original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; + original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE; + original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; + original_CoreClrCallbacks->m_pfnGetCLRFunction = original_cccallbacks.m_pfnGetCLRFunction; - CoreClrCallbacks* temp = new CoreClrCallbacks(); + CoreClrCallbacks* temp = new CoreClrCallbacks(); - temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; - temp->m_pfnIEE = IEE_t; - temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; - temp->m_pfnGetCLRFunction = GetCLRFunction; + temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; + temp->m_pfnIEE = IEE_t; + temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; + temp->m_pfnGetCLRFunction = GetCLRFunction; - pnsxsJitStartup(*temp); + pnsxsJitStartup(*temp); + } } diff --git a/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp b/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp index 96996ee270..65ec7242e9 100644 --- a/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp +++ b/src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp @@ -70,10 +70,10 @@ void SetLogFilePath() extern "C" #ifdef FEATURE_PAL -DLLEXPORT // For Win32 PAL LoadLibrary emulation + DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif - BOOL - DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) + BOOL + DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { @@ -199,25 +199,23 @@ extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& origin // get entry point pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(g_hRealJit, "sxsJitStartup"); - if (pnsxsJitStartup == 0) - { - LogError("sxsJitStartup() - GetProcAddress 'sxsJitStartup' failed (0x%08x)", ::GetLastError()); - return; - } - // Setup CoreClrCallbacks and call sxsJitStartup - original_CoreClrCallbacks = new CoreClrCallbacks(); - original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; - original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE; - original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; - original_CoreClrCallbacks->m_pfnGetCLRFunction = original_cccallbacks.m_pfnGetCLRFunction; + if (pnsxsJitStartup != nullptr) + { + // Setup CoreClrCallbacks and call sxsJitStartup + original_CoreClrCallbacks = new CoreClrCallbacks(); + original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; + original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE; + original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; + original_CoreClrCallbacks->m_pfnGetCLRFunction = original_cccallbacks.m_pfnGetCLRFunction; - CoreClrCallbacks* temp = new CoreClrCallbacks(); + CoreClrCallbacks* temp = new CoreClrCallbacks(); - temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; - temp->m_pfnIEE = IEE_t; - temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; - temp->m_pfnGetCLRFunction = GetCLRFunction; + temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; + temp->m_pfnIEE = IEE_t; + temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; + temp->m_pfnGetCLRFunction = GetCLRFunction; - pnsxsJitStartup(*temp); + pnsxsJitStartup(*temp); + } } diff --git a/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp b/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp index 07663c8bce..60fa17dcc6 100644 --- a/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp +++ b/src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp @@ -60,10 +60,10 @@ void SetLogFilePath() extern "C" #ifdef FEATURE_PAL -DLLEXPORT // For Win32 PAL LoadLibrary emulation + DLLEXPORT // For Win32 PAL LoadLibrary emulation #endif - BOOL - DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) + BOOL + DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { @@ -174,25 +174,23 @@ extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& origin // get entry point pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(g_hRealJit, "sxsJitStartup"); - if (pnsxsJitStartup == 0) - { - LogError("sxsJitStartup() - GetProcAddress 'sxsJitStartup' failed (0x%08x)", ::GetLastError()); - return; - } - // Setup CoreClrCallbacks and call sxsJitStartup - original_CoreClrCallbacks = new CoreClrCallbacks(); - original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; - original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE; - original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; - original_CoreClrCallbacks->m_pfnGetCLRFunction = original_cccallbacks.m_pfnGetCLRFunction; + if (pnsxsJitStartup != nullptr) + { + // Setup CoreClrCallbacks and call sxsJitStartup + original_CoreClrCallbacks = new CoreClrCallbacks(); + original_CoreClrCallbacks->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; + original_CoreClrCallbacks->m_pfnIEE = original_cccallbacks.m_pfnIEE; + original_CoreClrCallbacks->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; + original_CoreClrCallbacks->m_pfnGetCLRFunction = original_cccallbacks.m_pfnGetCLRFunction; - CoreClrCallbacks* temp = new CoreClrCallbacks(); + CoreClrCallbacks* temp = new CoreClrCallbacks(); - temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; - temp->m_pfnIEE = IEE_t; - temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; - temp->m_pfnGetCLRFunction = GetCLRFunction; + temp->m_hmodCoreCLR = original_cccallbacks.m_hmodCoreCLR; + temp->m_pfnIEE = IEE_t; + temp->m_pfnGetCORSystemDirectory = original_cccallbacks.m_pfnGetCORSystemDirectory; + temp->m_pfnGetCLRFunction = GetCLRFunction; - pnsxsJitStartup(*temp); + pnsxsJitStartup(*temp); + } } diff --git a/src/ToolBox/superpmi/superpmi/jitinstance.cpp b/src/ToolBox/superpmi/superpmi/jitinstance.cpp index 9f904a6d41..85d7ca0b74 100644 --- a/src/ToolBox/superpmi/superpmi/jitinstance.cpp +++ b/src/ToolBox/superpmi/superpmi/jitinstance.cpp @@ -12,10 +12,10 @@ #include "errorhandling.h" #include "spmiutil.h" -JitInstance* JitInstance::InitJit(char* nameOfJit, - bool breakOnAssert, - SimpleTimer* st1, - MethodContext* firstContext, +JitInstance* JitInstance::InitJit(char* nameOfJit, + bool breakOnAssert, + SimpleTimer* st1, + MethodContext* firstContext, LightWeightMap<DWORD, DWORD>* forceOptions, LightWeightMap<DWORD, DWORD>* options) { @@ -174,16 +174,14 @@ HRESULT JitInstance::StartUp(char* PathToJit, bool copyJit, bool breakOnDebugBre return -1; } pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(hLib, "sxsJitStartup"); - if (pnsxsJitStartup == 0) + pnjitStartup = (PjitStartup)::GetProcAddress(hLib, "jitStartup"); + + if (pnsxsJitStartup != nullptr) { - LogError("GetProcAddress 'sxsJitStartup' failed (0x%08x)", ::GetLastError()); - return -1; + // Setup CoreClrCallbacks and call sxsJitStartup + CoreClrCallbacks* cccallbacks = InitCoreClrCallbacks(); + pnsxsJitStartup(*cccallbacks); } - pnjitStartup = (PjitStartup)::GetProcAddress(hLib, "jitStartup"); - - // Setup CoreClrCallbacks and call sxsJitStartup - CoreClrCallbacks* cccallbacks = InitCoreClrCallbacks(); - pnsxsJitStartup(*cccallbacks); // Setup ICorJitHost and call jitStartup if necessary if (pnjitStartup != nullptr) @@ -244,16 +242,14 @@ bool JitInstance::reLoad(MethodContext* firstContext) return false; } pnsxsJitStartup = (PsxsJitStartup)::GetProcAddress(hLib, "sxsJitStartup"); - if (pnsxsJitStartup == 0) + pnjitStartup = (PjitStartup)::GetProcAddress(hLib, "jitStartup"); + + if (pnsxsJitStartup != nullptr) { - LogError("GetProcAddress 'sxsJitStartup' failed (0x%08x)", ::GetLastError()); - return false; + // Setup CoreClrCallbacks and call sxsJitStartup + CoreClrCallbacks* cccallbacks = InitCoreClrCallbacks(); + pnsxsJitStartup(*cccallbacks); } - pnjitStartup = (PjitStartup)::GetProcAddress(hLib, "jitStartup"); - - // Setup CoreClrCallbacks and call sxsJitStartup - CoreClrCallbacks* cccallbacks = InitCoreClrCallbacks(); - pnsxsJitStartup(*cccallbacks); // Setup ICorJitHost and call jitStartup if necessary if (pnjitStartup != nullptr) |