Skip to content

Commit c7faf60

Browse files
committed
8305757: Call Method::compute_has_loops_flag() when creating CDS archive
Reviewed-by: coleenp, ccheung
1 parent eb8d8cd commit c7faf60

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/hotspot/share/cds/metaspaceShared.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
838838
SystemDictionaryShared::set_class_has_failed_verification(ik);
839839
_has_error_classes = true;
840840
}
841+
ik->compute_has_loops_flag_for_methods();
841842
BytecodeVerificationLocal = saved;
842843
return true;
843844
} else {

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,6 +2624,16 @@ void InstanceKlass::init_shared_package_entry() {
26242624
#endif
26252625
}
26262626

2627+
void InstanceKlass::compute_has_loops_flag_for_methods() {
2628+
Array<Method*>* methods = this->methods();
2629+
for (int index = 0; index < methods->length(); ++index) {
2630+
Method* m = methods->at(index);
2631+
if (!m->is_overpass()) { // work around JDK-8305771
2632+
m->compute_has_loops_flag();
2633+
}
2634+
}
2635+
}
2636+
26272637
void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain,
26282638
PackageEntry* pkg_entry, TRAPS) {
26292639
// InstanceKlass::add_to_hierarchy() sets the init_state to loaded

src/hotspot/share/oops/instanceKlass.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ class InstanceKlass: public Klass {
11411141
void init_shared_package_entry();
11421142
bool can_be_verified_at_dumptime() const;
11431143
bool methods_contain_jsr_bytecode() const;
1144+
void compute_has_loops_flag_for_methods();
11441145
#endif
11451146

11461147
jint compute_modifier_flags() const;

0 commit comments

Comments
 (0)