Fix ClassLinker::MayBeCalledWithDirectCodePointer for JIT

Currently, we don't know if another method has a direct code
pointer or not. This should fix the case where breakpoints
occasionally don't work with JIT.

The JIT now also checks that a method doesn't have any breakpoints
before starting to compile it.

Bug: 17950037

Change-Id: I17cfe874fe4825beba23903a5053d5cb27e106cb
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 7144577..a1ae236 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -3153,6 +3153,11 @@
   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)