summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonghyun Park <parjong@gmail.com>2017-08-02 12:05:34 +0900
committerJonghyun Park <parjong@gmail.com>2017-08-02 12:05:34 +0900
commite36431719109208cdc56d3e98ac9deb859e13b2a (patch)
tree1587f992088a0759a2e2991f28ea14ed5aac2c5e
parent2293b72929a27df38c66a3bab26fe06e5cb804fd (diff)
downloadcoreclr-e36431719109208cdc56d3e98ac9deb859e13b2a.tar.gz
coreclr-e36431719109208cdc56d3e98ac9deb859e13b2a.tar.bz2
coreclr-e36431719109208cdc56d3e98ac9deb859e13b2a.zip
Resolve FEATURE_GDBJIT/FEATURE_INTERPRETER conflict
-rw-r--r--src/vm/jitinterface.cpp19
-rw-r--r--src/vm/prestub.cpp15
2 files changed, 28 insertions, 6 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 677a7ba0b4..ff3010d12c 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -11761,6 +11761,7 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
#ifdef FEATURE_INTERPRETER
static ConfigDWORD s_InterpreterFallback;
+ bool isInterpreterStub = false;
bool interpreterFallback = (s_InterpreterFallback.val(CLRConfig::INTERNAL_InterpreterFallback) != 0);
if (interpreterFallback == false)
@@ -11769,7 +11770,10 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
// (We assume that importation is completely architecture-independent, or at least nearly so.)
if (FAILED(ret) && !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) && !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE))
{
- ret = Interpreter::GenerateInterpreterStub(comp, info, nativeEntry, nativeSizeOfCode);
+ if (SUCCEEDED(ret = Interpreter::GenerateInterpreterStub(comp, info, nativeEntry, nativeSizeOfCode)))
+ {
+ isInterpreterStub = true;
+ }
}
}
@@ -11789,7 +11793,10 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
// (We assume that importation is completely architecture-independent, or at least nearly so.)
if (FAILED(ret) && !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_IMPORT_ONLY) && !jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE))
{
- ret = Interpreter::GenerateInterpreterStub(comp, info, nativeEntry, nativeSizeOfCode);
+ if (SUCCEEDED(ret = Interpreter::GenerateInterpreterStub(comp, info, nativeEntry, nativeSizeOfCode)))
+ {
+ isInterpreterStub = true;
+ }
}
}
#else
@@ -11824,7 +11831,13 @@ CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
#if defined(FEATURE_GDBJIT)
- if (SUCCEEDED(ret) && *nativeEntry != NULL)
+ bool isJittedEntry = SUCCEEDED(ret) && *nativeEntry != NULL;
+
+#ifdef FEATURE_INTERPRETER
+ isJittedEntry &= !isInterpreterStub;
+#endif // FEATURE_INTERPRETER
+
+ if (isJittedEntry)
{
CodeHeader* pCH = ((CodeHeader*)((PCODE)*nativeEntry & ~1)) - 1;
pCH->SetCalledMethods((PTR_VOID)comp->GetCalledMethods());
diff --git a/src/vm/prestub.cpp b/src/vm/prestub.cpp
index e7014bef87..8f72d23b93 100644
--- a/src/vm/prestub.cpp
+++ b/src/vm/prestub.cpp
@@ -795,9 +795,13 @@ PCODE MethodDesc::JitCompileCodeLockedEventWrapper(PrepareCodeConfig* pConfig, J
}
#endif // PROFILING_SUPPORTED
+#ifdef FEATURE_INTERPRETER
+ bool isJittedMethod = (Interpreter::InterpretationStubToMethodInfo(pCode) == NULL);
+#endif
+
// Interpretted methods skip this notification
#ifdef FEATURE_INTERPRETER
- if (Interpreter::InterpretationStubToMethodInfo(pCode) == NULL)
+ if (isJittedMethod)
#endif
{
#ifdef FEATURE_PERFMAP
@@ -822,8 +826,13 @@ PCODE MethodDesc::JitCompileCodeLockedEventWrapper(PrepareCodeConfig* pConfig, J
}
#endif
- // The notification will only occur if someone has registered for this method.
- DACNotifyCompilationFinished(this);
+#ifdef FEATURE_INTERPRETER
+ if (isJittedMethod)
+#endif
+ {
+ // The notification will only occur if someone has registered for this method.
+ DACNotifyCompilationFinished(this);
+ }
return pCode;
}