Skip to content

Commit

Permalink
8305757: Call Method::compute_has_loops_flag() when creating CDS archive
Browse files Browse the repository at this point in the history
Reviewed-by: coleenp, ccheung
  • Loading branch information
iklam committed Apr 19, 2023
1 parent eb8d8cd commit c7faf60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hotspot/share/cds/metaspaceShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
SystemDictionaryShared::set_class_has_failed_verification(ik);
_has_error_classes = true;
}
ik->compute_has_loops_flag_for_methods();
BytecodeVerificationLocal = saved;
return true;
} else {
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/share/oops/instanceKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,16 @@ void InstanceKlass::init_shared_package_entry() {
#endif
}

void InstanceKlass::compute_has_loops_flag_for_methods() {
Array<Method*>* methods = this->methods();
for (int index = 0; index < methods->length(); ++index) {
Method* m = methods->at(index);
if (!m->is_overpass()) { // work around JDK-8305771
m->compute_has_loops_flag();
}
}
}

void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain,
PackageEntry* pkg_entry, TRAPS) {
// InstanceKlass::add_to_hierarchy() sets the init_state to loaded
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/oops/instanceKlass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ class InstanceKlass: public Klass {
void init_shared_package_entry();
bool can_be_verified_at_dumptime() const;
bool methods_contain_jsr_bytecode() const;
void compute_has_loops_flag_for_methods();
#endif

jint compute_modifier_flags() const;
Expand Down

1 comment on commit c7faf60

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