Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8267431: Rename InstanceKlass::has_old_class_version to can_be_verified_at_dumptime #4176

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/metaspaceShared.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/classfile/systemDictionaryShared.cpp
Expand Up @@ -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");
}
}
Expand All @@ -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");
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/interpreter/rewriter.cpp
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/oops/instanceKlass.cpp
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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<InstanceKlass*>* 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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/instanceKlass.hpp
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/oops/klassVtable.cpp
Expand Up @@ -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.
Expand Down