return ret;
}
-CorJitResult CallCompileMethodWithSEHWrapper(EEJitManager *jitMgr,
- CEEInfo *comp,
- struct CORINFO_METHOD_INFO *info,
- CORJIT_FLAGS flags,
- BYTE **nativeEntry,
- uint32_t *nativeSizeOfCode,
- NativeCodeVersion nativeCodeVersion)
-{
- // no dynamic contract here because SEH is used, with a finally clause
- STATIC_CONTRACT_NOTHROW;
- STATIC_CONTRACT_GC_TRIGGERS;
-
- MethodDesc* ftn = nativeCodeVersion.GetMethodDesc();
-
- LOG((LF_CORDB, LL_EVERYTHING, "CallCompileMethodWithSEHWrapper called...\n"));
-
- struct Param
- {
- EEJitManager *jitMgr;
- CEEInfo *comp;
- struct CORINFO_METHOD_INFO *info;
- CORJIT_FLAGS flags;
- BYTE **nativeEntry;
- uint32_t *nativeSizeOfCode;
- MethodDesc *ftn;
- CorJitResult res;
- }; Param param;
- param.jitMgr = jitMgr;
- param.comp = comp;
- param.info = info;
- param.flags = flags;
- param.nativeEntry = nativeEntry;
- param.nativeSizeOfCode = nativeSizeOfCode;
- param.ftn = ftn;
- param.res = CORJIT_INTERNALERROR;
-
- PAL_TRY(Param *, pParam, ¶m)
- {
- //
- // Call out to the JIT-compiler
- //
-
- pParam->res = invokeCompileMethod( pParam->jitMgr,
- pParam->comp,
- pParam->info,
- pParam->flags,
- pParam->nativeEntry,
- pParam->nativeSizeOfCode);
- }
- PAL_FINALLY
- {
-#if defined(DEBUGGING_SUPPORTED) && !defined(CROSSGEN_COMPILE)
- if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) &&
- !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND)
-#ifdef FEATURE_STACK_SAMPLING
- && !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_SAMPLING_JIT_BACKGROUND)
-#endif // FEATURE_STACK_SAMPLING
- )
- {
- //
- // Notify the debugger that we have successfully jitted the function
- //
- if (g_pDebugInterface)
- {
- if (param.res == CORJIT_OK && !((CEEJitInfo*)param.comp)->JitAgain())
- {
- g_pDebugInterface->JITComplete(nativeCodeVersion, (TADDR)*nativeEntry);
- }
- }
- }
-#endif // DEBUGGING_SUPPORTED && !CROSSGEN_COMPILE
- }
- PAL_ENDTRY
-
- return param.res;
-}
-
/*********************************************************************/
// Figures out the compile flags that are used by both JIT and NGen
QueryPerformanceCounter (&methodJitTimeStart);
#endif
- // Note on debuggerTrackInfo arg: if we're only importing (ie, verifying/
- // checking to make sure we could JIT, but not actually generating code (
- // eg, for inlining), then DON'T TELL THE DEBUGGER about this.
- res = CallCompileMethodWithSEHWrapper(jitMgr,
- &jitInfo,
- &methodInfo,
- flags,
- &nativeEntry,
- &sizeOfCode,
- nativeCodeVersion);
- LOG((LF_CORDB, LL_EVERYTHING, "Got through CallCompile MethodWithSEHWrapper\n"));
+ LOG((LF_CORDB, LL_EVERYTHING, "Calling invokeCompileMethod...\n"));
+
+ res = invokeCompileMethod(jitMgr,
+ &jitInfo,
+ &methodInfo,
+ flags,
+ &nativeEntry,
+ &sizeOfCode);
+
+ LOG((LF_CORDB, LL_EVERYTHING, "Got through invokeCompileMethod\n"));
#if FEATURE_PERFMAP
// Save the code size so that it can be reported to the perfmap.
if (SUCCEEDED(res))
{
jitInfo.WriteCode(jitMgr);
+#if defined(DEBUGGING_SUPPORTED)
+ // Note: if we're only importing (ie, verifying/
+ // checking to make sure we could JIT, but not actually generating code (
+ // eg, for inlining), then DON'T TELL THE DEBUGGER about this.
+ if (!flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) &&
+ !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND)
+#ifdef FEATURE_STACK_SAMPLING
+ && !flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_SAMPLING_JIT_BACKGROUND)
+#endif // FEATURE_STACK_SAMPLING
+ )
+ {
+ //
+ // Notify the debugger that we have successfully jitted the function
+ //
+ if (g_pDebugInterface)
+ {
+ if (!jitInfo.JitAgain())
+ {
+ g_pDebugInterface->JITComplete(nativeCodeVersion, (TADDR)nativeEntry);
+ }
+ }
+ }
+#endif // DEBUGGING_SUPPORTED
}
else
{