8209574: [AOT] breakpoint events are generated in different threads does not meet expected count
Summary: Disable AOT when debugger is attached.
Reviewed-by: dlong
--- a/src/hotspot/share/aot/aotLoader.cpp Mon Sep 17 11:50:39 2018 -0700
+++ b/src/hotspot/share/aot/aotLoader.cpp Mon Sep 17 13:43:22 2018 -0700
@@ -47,6 +47,13 @@
return;
}
if (UseAOT) {
+ if (JvmtiExport::can_hotswap_or_post_breakpoint()) {
+ if (PrintAOT) {
+ warning("JVMTI capability to hotswap and post breakpoint is not compatible with AOT (switching AOT off)");
+ }
+ FLAG_SET_DEFAULT(UseAOT, false);
+ return;
+ }
FOR_ALL_AOT_HEAPS(heap) {
(*heap)->load_klass_data(ik, thread);
}
@@ -54,6 +61,7 @@
}
uint64_t AOTLoader::get_saved_fingerprint(InstanceKlass* ik) {
+ assert(UseAOT, "called only when AOT is enabled");
if (ik->is_unsafe_anonymous()) {
// don't even bother
return 0;
@@ -67,24 +75,6 @@
return 0;
}
-bool AOTLoader::find_klass(InstanceKlass* ik) {
- FOR_ALL_AOT_HEAPS(heap) {
- if ((*heap)->find_klass(ik) != NULL) {
- return true;
- }
- }
- return false;
-}
-
-bool AOTLoader::contains(address p) {
- FOR_ALL_AOT_HEAPS(heap) {
- if ((*heap)->contains(p)) {
- return true;
- }
- }
- return false;
-}
-
void AOTLoader::oops_do(OopClosure* f) {
if (UseAOT) {
FOR_ALL_AOT_HEAPS(heap) {
@@ -130,6 +120,14 @@
return;
}
+ if (JvmtiExport::can_hotswap_or_post_breakpoint()) {
+ if (PrintAOT) {
+ warning("JVMTI capability to hotswap and post breakpoint is not compatible with AOT (switching AOT off)");
+ }
+ FLAG_SET_DEFAULT(UseAOT, false);
+ return;
+ }
+
// -Xint is not compatible with AOT
if (Arguments::is_interpreter_only()) {
if (PrintAOT) {
--- a/src/hotspot/share/aot/aotLoader.hpp Mon Sep 17 11:50:39 2018 -0700
+++ b/src/hotspot/share/aot/aotLoader.hpp Mon Sep 17 13:43:22 2018 -0700
@@ -59,9 +59,7 @@
static void universe_init() NOT_AOT_RETURN;
static void set_narrow_oop_shift() NOT_AOT_RETURN;
static void set_narrow_klass_shift() NOT_AOT_RETURN;
- static bool contains(address p) NOT_AOT({ return false; });
static void load_for_klass(InstanceKlass* ik, Thread* thread) NOT_AOT_RETURN;
- static bool find_klass(InstanceKlass* ik) NOT_AOT({ return false; });
static uint64_t get_saved_fingerprint(InstanceKlass* ik) NOT_AOT({ return 0; });
static void oops_do(OopClosure* f) NOT_AOT_RETURN;
static void metadata_do(void f(Metadata*)) NOT_AOT_RETURN;
--- a/test/hotspot/jtreg/compiler/aot/AotCompiler.java Mon Sep 17 11:50:39 2018 -0700
+++ b/test/hotspot/jtreg/compiler/aot/AotCompiler.java Mon Sep 17 13:43:22 2018 -0700
@@ -100,6 +100,7 @@
}
List<String> args = new ArrayList<>();
args.add("--compile-with-assertions");
+ args.add("--info");
args.add("--output");
args.add(libName);
if (file != null) {