Remove dependency on IEEMemoryManager (#24755)
authorJan Kotas <jkotas@microsoft.com>
Fri, 24 May 2019 12:34:44 +0000 (05:34 -0700)
committerGitHub <noreply@github.com>
Fri, 24 May 2019 12:34:44 +0000 (05:34 -0700)
16 files changed:
src/ToolBox/superpmi/superpmi-shim-collector/superpmi-shim-collector.cpp
src/ToolBox/superpmi/superpmi-shim-counter/superpmi-shim-counter.cpp
src/ToolBox/superpmi/superpmi-shim-simple/superpmi-shim-simple.cpp
src/ToolBox/superpmi/superpmi/jitinstance.cpp
src/inc/corjit.h
src/jit/ClrJit.PAL.exports
src/jit/ClrJit.exports
src/jit/armelnonjit/armelnonjit.def
src/jit/dll/clrjit.def
src/jit/ee_il_dll.cpp
src/jit/jittelemetry.cpp
src/jit/protojit/protojit.def
src/jit/protononjit/protononjit.def
src/vm/codeman.cpp
src/vm/jitinterface.cpp
src/zap/zapper.cpp

index a2a01b1..71d0e49 100644 (file)
@@ -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);
+    }
 }
index 96996ee..65ec724 100644 (file)
@@ -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);
+    }
 }
index 07663c8..60fa17d 100644 (file)
@@ -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);
+    }
 }
index 9f904a6..85d7ca0 100644 (file)
 #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)
index 20ff2b3..6892e06 100644 (file)
@@ -292,7 +292,7 @@ public:
 class ICorJitInfo : public ICorDynamicInfo
 {
 public:
-    // return memory manager that the JIT can use to allocate a regular memory
+    // OBSOLETE: return memory manager that the JIT can use to allocate a regular memory
     virtual IEEMemoryManager* getMemoryManager() = 0;
 
     // get a block of memory for the code, readonly data, and read-write data
index f53923f..b27c61f 100644 (file)
@@ -1,6 +1,5 @@
 getJit
 jitStartup
-sxsJitStartup
 DllMain
 PAL_RegisterModule
 PAL_UnregisterModule
index 60a223b..41a37db 100644 (file)
@@ -5,4 +5,3 @@
 EXPORTS
     getJit
     jitStartup
-    sxsJitStartup
index 1603af7..e229be4 100644 (file)
@@ -4,4 +4,3 @@
 EXPORTS
     getJit
     jitStartup
-    sxsJitStartup
index 1603af7..e229be4 100644 (file)
@@ -4,4 +4,3 @@
 EXPORTS
     getJit
     jitStartup
-    sxsJitStartup
index 882c9bc..a1f3c8c 100644 (file)
@@ -176,12 +176,14 @@ HINSTANCE GetModuleInst()
     return (g_hInst);
 }
 
+#ifndef FEATURE_CORECLR
 extern "C" DLLEXPORT void __stdcall sxsJitStartup(CoreClrCallbacks const& cccallbacks)
 {
 #ifndef SELF_NO_HOST
     InitUtilcode(cccallbacks);
 #endif
 }
+#endif // FEATURE_CORECLR
 
 #endif // !FEATURE_MERGE_JIT_AND_ENGINE
 
index 9498791..021fb45 100644 (file)
@@ -69,8 +69,6 @@
 //            This roughly translates to InitUtilcode() being called before jitDllOnProcessAttach.
 //
 //            For CLRJIT.dll, compStartup is called on jitOnDllProcessAttach().
-//            This can be called twice through sxsJitStartup -- so prevent double initialization.
-//            UtilCode is init-ed by this time. The same is true for CoreCLR.
 //
 //         2) For CLRJIT.dll and CoreCLR, compShutdown will be called during jitOnDllProcessDetach().
 //
index 1603af7..e229be4 100644 (file)
@@ -4,4 +4,3 @@
 EXPORTS
     getJit
     jitStartup
-    sxsJitStartup
index 1603af7..e229be4 100644 (file)
@@ -4,4 +4,3 @@
 EXPORTS
     getJit
     jitStartup
-    sxsJitStartup
index f475541..0596906 100644 (file)
@@ -1521,8 +1521,6 @@ enum JIT_LOAD_STATUS
 {
     JIT_LOAD_STATUS_STARTING = 1001,                   // The JIT load process is starting. Start at a number that is somewhat uncommon (i.e., not zero or 1) to help distinguish from garbage, in process dumps.
     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.
@@ -1635,72 +1633,60 @@ static void LoadAndInitializeJIT(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT I
 
         EX_TRY
         {
-            bool fContinueToLoadJIT = false;
-            // For CoreCLR, we never use "sxsJitStartup" as that is Desktop utilcode initialization
-            // specific. Thus, assume we always got 
-            fContinueToLoadJIT = true;
+            typedef void (__stdcall* pjitStartup)(ICorJitHost*);
+            pjitStartup jitStartupFn = (pjitStartup) GetProcAddress(*phJit, "jitStartup");
 
-            if (fContinueToLoadJIT)
+            if (jitStartupFn)
             {
-                typedef void (__stdcall* pjitStartup)(ICorJitHost*);
-                pjitStartup jitStartupFn = (pjitStartup) GetProcAddress(*phJit, "jitStartup");
+                pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_GET_JITSTARTUP;
 
-                if (jitStartupFn)
-                {
-                    pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_GET_JITSTARTUP;
+                (*jitStartupFn)(JitHost::getJitHost());
 
-                    (*jitStartupFn)(JitHost::getJitHost());
+                pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_JITSTARTUP;
+            }
 
-                    pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_JITSTARTUP;
-                }
+            typedef ICorJitCompiler* (__stdcall* pGetJitFn)();
+            pGetJitFn getJitFn = (pGetJitFn) GetProcAddress(*phJit, "getJit");
 
-                typedef ICorJitCompiler* (__stdcall* pGetJitFn)();
-                pGetJitFn getJitFn = (pGetJitFn) GetProcAddress(*phJit, "getJit");
+            if (getJitFn)
+            {
+                pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_GET_GETJIT;
 
-                if (getJitFn)
+                ICorJitCompiler* pICorJitCompiler = (*getJitFn)();
+                if (pICorJitCompiler != NULL)
                 {
-                    pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_GET_GETJIT;
-
-                    ICorJitCompiler* pICorJitCompiler = (*getJitFn)();
-                    if (pICorJitCompiler != NULL)
-                    {
-                        pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_GETJIT;
+                    pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_GETJIT;
 
-                        GUID versionId;
-                        memset(&versionId, 0, sizeof(GUID));
-                        pICorJitCompiler->getVersionIdentifier(&versionId);
+                    GUID versionId;
+                    memset(&versionId, 0, sizeof(GUID));
+                    pICorJitCompiler->getVersionIdentifier(&versionId);
 
-                        pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_GETVERSIONIDENTIFIER;
+                    pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_CALL_GETVERSIONIDENTIFIER;
 
-                        if (memcmp(&versionId, &JITEEVersionIdentifier, sizeof(GUID)) == 0)
-                        {
-                            pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_VERSION_CHECK;
+                    if (memcmp(&versionId, &JITEEVersionIdentifier, sizeof(GUID)) == 0)
+                    {
+                        pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE_VERSION_CHECK;
 
-                            // The JIT has loaded and passed the version identifier test, so publish the JIT interface to the caller.
-                            *ppICorJitCompiler = pICorJitCompiler;
+                        // The JIT has loaded and passed the version identifier test, so publish the JIT interface to the caller.
+                        *ppICorJitCompiler = pICorJitCompiler;
 
-                            // The JIT is completely loaded and initialized now.
-                            pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE;
-                        }
-                        else
-                        {
-                            // Mismatched version ID. Fail the load.
-                            LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: mismatched JIT version identifier in %S\n", pwzJitName));
-                        }
+                        // The JIT is completely loaded and initialized now.
+                        pJitLoadData->jld_status = JIT_LOAD_STATUS_DONE;
                     }
                     else
                     {
-                        LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: failed to get ICorJitCompiler in %S\n", pwzJitName));
+                        // Mismatched version ID. Fail the load.
+                        LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: mismatched JIT version identifier in %S\n", pwzJitName));
                     }
                 }
                 else
                 {
-                    LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: failed to find 'getJit' entrypoint in %S\n", pwzJitName));
+                    LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: failed to get ICorJitCompiler in %S\n", pwzJitName));
                 }
             }
             else
             {
-                LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: failed to find 'sxsJitStartup' entrypoint in %S\n", pwzJitName));
+                LOG((LF_JIT, LL_FATALERROR, "LoadAndInitializeJIT: failed to find 'getJit' entrypoint in %S\n", pwzJitName));
             }
         }
         EX_CATCH
index c38c53d..de9538e 100644 (file)
@@ -10852,21 +10852,8 @@ bool CEEInfo::runWithErrorTrap(void (*function)(void*), void* param)
 /*********************************************************************/
 IEEMemoryManager* CEEInfo::getMemoryManager()
 {
-    CONTRACTL {
-        NOTHROW;
-        GC_NOTRIGGER;
-        MODE_PREEMPTIVE;
-    } CONTRACTL_END;
-
-    IEEMemoryManager* result = NULL;
-
-    JIT_TO_EE_TRANSITION_LEAF();
-
-    result = GetEEMemoryManager();
-
-    EE_TO_JIT_TRANSITION_LEAF();
-
-    return result;
+    UNREACHABLE(); // OBSOLETE
+    return NULL;
 }
 
 /*********************************************************************/
index b22fe62..26d9c4e 100644 (file)
@@ -510,19 +510,6 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi
         ThrowLastError();
     }
 
-#if !defined(CROSSGEN_COMPILE)
-    typedef void (__stdcall* pSxsJitStartup) (CoreClrCallbacks const & cccallbacks);
-    pSxsJitStartup sxsJitStartupFn = (pSxsJitStartup) GetProcAddress(*phJit, "sxsJitStartup");
-    if (sxsJitStartupFn == NULL)
-    {
-        Error(W("Unable to load Jit startup function: %s\r\n"), pwzJitName);
-        ThrowLastError();
-    }
-
-    CoreClrCallbacks cccallbacks = GetClrCallbacks();
-    (*sxsJitStartupFn) (cccallbacks);
-#endif
-
     typedef void (__stdcall* pJitStartup)(ICorJitHost* host);
     pJitStartup jitStartupFn = (pJitStartup)GetProcAddress(*phJit, "jitStartup");
     if (jitStartupFn != nullptr)