diff --git a/src/hotspot/share/cds/metaspaceShared.cpp b/src/hotspot/share/cds/metaspaceShared.cpp index 1ab241933570e..82cb3128419f8 100644 --- a/src/hotspot/share/cds/metaspaceShared.cpp +++ b/src/hotspot/share/cds/metaspaceShared.cpp @@ -390,7 +390,7 @@ static void rewrite_nofast_bytecode(const methodHandle& method) { void MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread* thread, InstanceKlass* ik) { for (int i = 0; i < ik->methods()->length(); i++) { methodHandle m(thread, ik->methods()->at(i)); - if (!ik->has_old_class_version()) { + if (!ik->can_be_verified_at_dumptime()) { rewrite_nofast_bytecode(m); } Fingerprinter fp(m); @@ -580,7 +580,7 @@ class CollectCLDClosure : public CLDClosure { bool MetaspaceShared::linking_required(InstanceKlass* ik) { // For static CDS dump, do not link old classes. // For dynamic CDS dump, only link classes loaded by the builtin class loaders. - return DumpSharedSpaces ? !ik->has_old_class_version() : !ik->is_shared_unregistered_class(); + return DumpSharedSpaces ? !ik->can_be_verified_at_dumptime() : !ik->is_shared_unregistered_class(); } bool MetaspaceShared::link_class_for_cds(InstanceKlass* ik, TRAPS) { @@ -756,7 +756,7 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) { ExceptionMark em(current); JavaThread* THREAD = current; // For exception macros. Arguments::assert_is_dumping_archive(); - if (ik->is_loaded() && !ik->is_linked() && !ik->has_old_class_version() && + if (ik->is_loaded() && !ik->is_linked() && !ik->can_be_verified_at_dumptime() && !SystemDictionaryShared::has_class_failed_verification(ik)) { bool saved = BytecodeVerificationLocal; if (ik->is_shared_unregistered_class() && ik->class_loader() == NULL) { diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index cd95a8a49f401..601b4c550098b 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -1386,7 +1386,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) { if (has_class_failed_verification(k)) { return warn_excluded(k, "Failed verification"); } else { - if (!k->has_old_class_version()) { + if (!k->can_be_verified_at_dumptime()) { return warn_excluded(k, "Not linked"); } } @@ -1400,7 +1400,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) { return true; } - if (k->has_old_class_version() && k->is_linked()) { + if (k->can_be_verified_at_dumptime() && k->is_linked()) { return warn_excluded(k, "Old class has been linked"); } diff --git a/src/hotspot/share/interpreter/rewriter.cpp b/src/hotspot/share/interpreter/rewriter.cpp index 7838c6b77689b..74f87ca208b95 100644 --- a/src/hotspot/share/interpreter/rewriter.cpp +++ b/src/hotspot/share/interpreter/rewriter.cpp @@ -571,7 +571,7 @@ void Rewriter::rewrite(InstanceKlass* klass, TRAPS) { #if INCLUDE_CDS if (klass->is_shared()) { assert(!klass->is_rewritten(), "rewritten shared classes cannot be rewritten again"); - assert(klass->has_old_class_version(), "only shared old classes aren't rewritten"); + assert(klass->can_be_verified_at_dumptime(), "only shared old classes aren't rewritten"); } #endif // INCLUDE_CDS ResourceMark rm(THREAD); diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index 603bdec1eb245..81d27775ea78b 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -2402,7 +2402,7 @@ void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) { void InstanceKlass::remove_unshareable_info() { - if (has_old_class_version()) { + if (can_be_verified_at_dumptime()) { // Set the old class bit. set_is_shared_old_klass(); } @@ -2546,17 +2546,17 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl // without changing the old verifier, the verification constraint cannot be // retrieved during dump time. // Verification of archived old classes will be performed during run time. -bool InstanceKlass::has_old_class_version() const { +bool InstanceKlass::can_be_verified_at_dumptime() const { if (major_version() < 50 /*JAVA_6_VERSION*/) { return true; } - if (java_super() != NULL && java_super()->has_old_class_version()) { + if (java_super() != NULL && java_super()->can_be_verified_at_dumptime()) { return true; } Array* interfaces = local_interfaces(); int len = interfaces->length(); for (int i = 0; i < len; i++) { - if (interfaces->at(i)->has_old_class_version()) { + if (interfaces->at(i)->can_be_verified_at_dumptime()) { return true; } } diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index 50279d7956a06..d0b829ed8cbf7 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -1228,7 +1228,7 @@ class InstanceKlass: public Klass { virtual void remove_java_mirror(); void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, PackageEntry* pkg_entry, TRAPS); void init_shared_package_entry(); - bool has_old_class_version() const; + bool can_be_verified_at_dumptime() const; jint compute_modifier_flags() const; diff --git a/src/hotspot/share/oops/klassVtable.cpp b/src/hotspot/share/oops/klassVtable.cpp index 69340c66ab217..32ac7c816c811 100644 --- a/src/hotspot/share/oops/klassVtable.cpp +++ b/src/hotspot/share/oops/klassVtable.cpp @@ -1094,8 +1094,8 @@ void itableMethodEntry::initialize(InstanceKlass* klass, Method* m) { #ifdef ASSERT if (MetaspaceShared::is_in_shared_metaspace((void*)&_method) && !MetaspaceShared::remapped_readwrite() && - !m->method_holder()->has_old_class_version() && - !klass->has_old_class_version()) { + !m->method_holder()->can_be_verified_at_dumptime() && + !klass->can_be_verified_at_dumptime()) { // At runtime initialize_itable is rerun as part of link_class_impl() // for a shared class loaded by the non-boot loader. // The dumptime itable method entry should be the same as the runtime entry.