summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-03-26 22:34:57 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-03-26 22:34:57 +0000
commit83aae275268b021d23d2dc6708bd9cef3d7e4b50 (patch)
tree8c5eca4c2604e0edc1606ea151d78538098dc040 /runtime
parent81adb4f8fd261be11d399d210029189e94888a9e (diff)
parentd8565456d29f4ad05f11cf84d2d2dac488508e06 (diff)
downloadandroid_art-83aae275268b021d23d2dc6708bd9cef3d7e4b50.tar.gz
android_art-83aae275268b021d23d2dc6708bd9cef3d7e4b50.tar.bz2
android_art-83aae275268b021d23d2dc6708bd9cef3d7e4b50.zip
Merge "Fix ClassLinker::MayBeCalledWithDirectCodePointer for JIT"
Diffstat (limited to 'runtime')
-rw-r--r--runtime/class_linker.cc4
-rw-r--r--runtime/debugger.cc5
-rw-r--r--runtime/debugger.h4
-rw-r--r--runtime/jit/jit.cc4
4 files changed, 17 insertions, 0 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 67872d76ae..b0708a6c0e 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -5286,6 +5286,10 @@ std::size_t ClassLinker::ClassDescriptorHashEquals::operator()(const char* descr
}
bool ClassLinker::MayBeCalledWithDirectCodePointer(mirror::ArtMethod* m) {
+ if (Runtime::Current()->UseJit()) {
+ // JIT can have direct code pointers from any method to any other method.
+ return true;
+ }
// Non-image methods don't use direct code pointer.
if (!m->GetDeclaringClass()->IsBootStrapClassLoaded()) {
return false;
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 7144577acb..a1ae236397 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -3153,6 +3153,11 @@ static const Breakpoint* FindFirstBreakpointForMethod(mirror::ArtMethod* m)
return nullptr;
}
+bool Dbg::MethodHasAnyBreakpoints(mirror::ArtMethod* method) {
+ ReaderMutexLock mu(Thread::Current(), *Locks::breakpoint_lock_);
+ return FindFirstBreakpointForMethod(method) != nullptr;
+}
+
// Sanity checks all existing breakpoints on the same method.
static void SanityCheckExistingBreakpoints(mirror::ArtMethod* m,
DeoptimizationRequest::Kind deoptimization_kind)
diff --git a/runtime/debugger.h b/runtime/debugger.h
index d015294eac..4f4a781c23 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -253,6 +253,10 @@ class Dbg {
// Returns true if we had -Xrunjdwp or -agentlib:jdwp= on the command line.
static bool IsJdwpConfigured();
+ // Returns true if a method has any breakpoints.
+ static bool MethodHasAnyBreakpoints(mirror::ArtMethod* method)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) LOCKS_EXCLUDED(Locks::breakpoint_lock_);
+
static bool IsDisposed();
/*
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 13c1f813bd..5dc739edb2 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -128,6 +128,10 @@ bool Jit::LoadCompiler(std::string* error_msg) {
bool Jit::CompileMethod(mirror::ArtMethod* method, Thread* self) {
DCHECK(!method->IsRuntimeMethod());
+ if (Dbg::IsDebuggerActive() && Dbg::MethodHasAnyBreakpoints(method)) {
+ VLOG(jit) << "JIT not compiling " << PrettyMethod(method) << " due to breakpoint";
+ return false;
+ }
const bool result = jit_compile_method_(jit_compiler_handle_, method, self);
if (result) {
method->SetEntryPointFromInterpreter(artInterpreterToCompiledCodeBridge);