8293816: CI: ciBytecodeStream::get_klass() is not consistent

Reviewed-by: dlong, kvn
This commit is contained in:
Vladimir Ivanov 2022-09-16 17:57:03 +00:00
parent 4b297c1c16
commit 746f5f589d
3 changed files with 4 additions and 9 deletions

View File

@ -330,7 +330,7 @@ void ciInstanceKlass::print_impl(outputStream* st) {
ciKlass::print_impl(st); ciKlass::print_impl(st);
GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i(loader()));) GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i(loader()));)
if (is_loaded()) { if (is_loaded()) {
st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=", st->print(" initialized=%s finalized=%s subklass=%s size=%d flags=",
bool_to_str(is_initialized()), bool_to_str(is_initialized()),
bool_to_str(has_finalizer()), bool_to_str(has_finalizer()),
bool_to_str(has_subklass()), bool_to_str(has_subklass()),
@ -345,8 +345,6 @@ void ciInstanceKlass::print_impl(outputStream* st) {
if (_java_mirror) { if (_java_mirror) {
st->print(" mirror=PRESENT"); st->print(" mirror=PRESENT");
} }
} else {
st->print(" loaded=false");
} }
} }

View File

@ -233,6 +233,7 @@ jint ciKlass::access_flags() {
void ciKlass::print_impl(outputStream* st) { void ciKlass::print_impl(outputStream* st) {
st->print(" name="); st->print(" name=");
print_name_on(st); print_name_on(st);
st->print(" loaded=%s", (is_loaded() ? "true" : "false"));
} }
// ------------------------------------------------------------------ // ------------------------------------------------------------------

View File

@ -201,12 +201,8 @@ ciKlass* ciBytecodeStream::get_klass() {
bool will_link; bool will_link;
ciKlass* klass = get_klass(will_link); ciKlass* klass = get_klass(will_link);
if (!will_link && klass->is_loaded()) { // klass not accessible if (!will_link && klass->is_loaded()) { // klass not accessible
if (klass->is_array_klass()) { VM_ENTRY_MARK;
assert(!klass->is_type_array_klass(), ""); klass = CURRENT_ENV->get_unloaded_klass(_holder, klass->name());
klass = ciEnv::unloaded_ciobjarrayklass();
} else {
klass = ciEnv::unloaded_ciinstance_klass();
}
} }
return klass; return klass;
} }