--- a/src/hotspot/share/oops/instanceKlass.hpp Sun Sep 03 16:08:13 2017 +0100
+++ b/src/hotspot/share/oops/instanceKlass.hpp Mon Mar 20 13:05:00 2017 -0400
@@ -609,9 +609,11 @@
InstanceKlass* host_klass() const {
InstanceKlass** hk = adr_host_klass();
if (hk == NULL) {
+ assert(!is_anonymous(), "Anonymous classes have host klasses");
return NULL;
} else {
assert(*hk != NULL, "host klass should always be set if the address is not null");
+ assert(is_anonymous(), "Only anonymous classes have host klasses");
return *hk;
}
}
@@ -623,6 +625,9 @@
*addr = host;
}
}
+ bool has_host_klass() const {
+ return adr_host_klass() != NULL;
+ }
bool is_anonymous() const {
return (_misc_flags & _misc_is_anonymous) != 0;
}