JDWP: fix breakpoint for method in the image
When we set a breakpoint in a compiled method, we deoptimize it by
changing its entrypoint so it is executed with the interpreter.
However, methods in the image can be called with their direct code
pointer, ignoring the updated entrypoint. In that case, the method
is not executed with the interpreter and we miss the breakpoint.
This CL avoids that situation by forcing a full deoptimization so
everything runs with the interpreter. However, if the image has been
compiled in PIC mode, we keep using selective deoptimization because
direct code pointer is not used in this mode.
Bug: 17965285
(cherry picked from commit 6963e44331258b131bcc0599b868ba15902d6d22)
Change-Id: I9bf738f89b9eb6d18733503216b376b8a1d181f5
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index a474166..23df6c0 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -1045,6 +1045,11 @@
DISALLOW_COPY_AND_ASSIGN(InitializeClassVisitor);
};
+ // Returns true if the class loader is null, ie the class loader is the boot strap class loader.
+ bool IsBootStrapClassLoaded() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ return GetClassLoader() == nullptr;
+ }
+
private:
void SetVerifyErrorClass(Class* klass) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);