8175932: Improve host instance supports

Reviewed-by: coleenp, mschoene
This commit is contained in:
Harold Seigel 2017-03-20 13:05:00 -04:00 committed by Harold Seigel
parent 979cec24f8
commit dd5b1ee367
2 changed files with 6 additions and 1 deletions

View file

@ -609,9 +609,11 @@ class InstanceKlass: public Klass {
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 @@ class InstanceKlass: public Klass {
*addr = host;
}
}
bool has_host_klass() const {
return adr_host_klass() != NULL;
}
bool is_anonymous() const {
return (_misc_flags & _misc_is_anonymous) != 0;
}