Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
8293816: CI: ciBytecodeStream::get_klass() is not consistent
Browse files Browse the repository at this point in the history
Backport-of: 746f5f589db5c1036f15fa47f8a48b2a12c921ce
  • Loading branch information
Yuri Nesterenko committed Nov 3, 2022
1 parent 374bf7f commit f030024
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/hotspot/share/ci/ciInstanceKlass.cpp
Expand Up @@ -317,7 +317,7 @@ void ciInstanceKlass::print_impl(outputStream* st) {
ciKlass::print_impl(st);
GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));)
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(has_finalizer()),
bool_to_str(has_subklass()),
Expand All @@ -332,8 +332,6 @@ void ciInstanceKlass::print_impl(outputStream* st) {
if (_java_mirror) {
st->print(" mirror=PRESENT");
}
} else {
st->print(" loaded=false");
}
}

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/ci/ciKlass.cpp
Expand Up @@ -223,6 +223,7 @@ jint ciKlass::access_flags() {
void ciKlass::print_impl(outputStream* st) {
st->print(" name=");
print_name_on(st);
st->print(" loaded=%s", (is_loaded() ? "true" : "false"));
}

// ------------------------------------------------------------------
Expand Down
8 changes: 2 additions & 6 deletions src/hotspot/share/ci/ciStreams.cpp
Expand Up @@ -200,12 +200,8 @@ ciKlass* ciBytecodeStream::get_klass() {
bool will_link;
ciKlass* klass = get_klass(will_link);
if (!will_link && klass->is_loaded()) { // klass not accessible
if (klass->is_array_klass()) {
assert(!klass->is_type_array_klass(), "");
klass = ciEnv::unloaded_ciobjarrayklass();
} else {
klass = ciEnv::unloaded_ciinstance_klass();
}
VM_ENTRY_MARK;
klass = CURRENT_ENV->get_unloaded_klass(_holder, klass->name());
}
return klass;
}
Expand Down

1 comment on commit f030024

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.