Skip to content

Commit ac93ab0

Browse files
TobiHartmannVladimir Ivanov
authored andcommittedJul 19, 2022
8281859: Improve class compilation
Co-authored-by: Vladimir Ivanov <vlivanov@openjdk.org> Reviewed-by: chagedorn
1 parent 67dd3f7 commit ac93ab0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/hotspot/share/ci/ciEnv.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@ ciConstant ciEnv::get_resolved_constant(const constantPoolHandle& cpool, int obj
731731
ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
732732
int index, int obj_index,
733733
ciInstanceKlass* accessor) {
734-
bool ignore_will_link;
735734
if (obj_index >= 0) {
736735
ciConstant con = get_resolved_constant(cpool, obj_index);
737736
if (con.is_valid()) {
@@ -761,8 +760,10 @@ ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
761760
} else if (tag.is_unresolved_klass_in_error()) {
762761
return ciConstant(T_OBJECT, get_unloaded_klass_mirror(NULL));
763762
} else if (tag.is_klass() || tag.is_unresolved_klass()) {
764-
ciKlass* klass = get_klass_by_index_impl(cpool, index, ignore_will_link, accessor);
765-
return ciConstant(T_OBJECT, klass->java_mirror());
763+
bool will_link;
764+
ciKlass* klass = get_klass_by_index_impl(cpool, index, will_link, accessor);
765+
ciInstance* mirror = (will_link ? klass->java_mirror() : get_unloaded_klass_mirror(klass));
766+
return ciConstant(T_OBJECT, mirror);
766767
} else if (tag.is_method_type() || tag.is_method_type_in_error()) {
767768
// must execute Java code to link this CP entry into cache[i].f1
768769
assert(obj_index >= 0, "should have an object index");
@@ -772,6 +773,7 @@ ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
772773
} else if (tag.is_method_handle() || tag.is_method_handle_in_error()) {
773774
// must execute Java code to link this CP entry into cache[i].f1
774775
assert(obj_index >= 0, "should have an object index");
776+
bool ignore_will_link;
775777
int ref_kind = cpool->method_handle_ref_kind_at(index);
776778
int callee_index = cpool->method_handle_klass_index_at(index);
777779
ciKlass* callee = get_klass_by_index_impl(cpool, callee_index, ignore_will_link, accessor);

0 commit comments

Comments
 (0)