Skip to content

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
GoeLin committed Oct 5, 2022
1 parent 6882bd3 commit 673b505
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 @@ -355,7 +355,7 @@ void ciInstanceKlass::print_impl(outputStream* st) {
ciKlass::print_impl(st);
GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i(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 @@ -370,8 +370,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 @@ -233,6 +233,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 @@ -201,12 +201,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 673b505

@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.