@@ -731,7 +731,6 @@ ciConstant ciEnv::get_resolved_constant(const constantPoolHandle& cpool, int obj
731
731
ciConstant ciEnv::get_constant_by_index_impl (const constantPoolHandle& cpool,
732
732
int index, int obj_index,
733
733
ciInstanceKlass* accessor) {
734
- bool ignore_will_link;
735
734
if (obj_index >= 0 ) {
736
735
ciConstant con = get_resolved_constant (cpool, obj_index);
737
736
if (con.is_valid ()) {
@@ -761,8 +760,10 @@ ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
761
760
} else if (tag.is_unresolved_klass_in_error ()) {
762
761
return ciConstant (T_OBJECT, get_unloaded_klass_mirror (NULL ));
763
762
} 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);
766
767
} else if (tag.is_method_type () || tag.is_method_type_in_error ()) {
767
768
// must execute Java code to link this CP entry into cache[i].f1
768
769
assert (obj_index >= 0 , " should have an object index" );
@@ -772,6 +773,7 @@ ciConstant ciEnv::get_constant_by_index_impl(const constantPoolHandle& cpool,
772
773
} else if (tag.is_method_handle () || tag.is_method_handle_in_error ()) {
773
774
// must execute Java code to link this CP entry into cache[i].f1
774
775
assert (obj_index >= 0 , " should have an object index" );
776
+ bool ignore_will_link;
775
777
int ref_kind = cpool->method_handle_ref_kind_at (index );
776
778
int callee_index = cpool->method_handle_klass_index_at (index );
777
779
ciKlass* callee = get_klass_by_index_impl (cpool, callee_index, ignore_will_link, accessor);
0 commit comments