Skip to content

Commit de27da7

Browse files
committed
8267431: Rename InstanceKlass::has_old_class_version to can_be_verified_at_dumptime
Reviewed-by: iklam
1 parent c519ba2 commit de27da7

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/hotspot/share/cds/metaspaceShared.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static void rewrite_nofast_bytecode(const methodHandle& method) {
390390
void MetaspaceShared::rewrite_nofast_bytecodes_and_calculate_fingerprints(Thread* thread, InstanceKlass* ik) {
391391
for (int i = 0; i < ik->methods()->length(); i++) {
392392
methodHandle m(thread, ik->methods()->at(i));
393-
if (!ik->has_old_class_version()) {
393+
if (!ik->can_be_verified_at_dumptime()) {
394394
rewrite_nofast_bytecode(m);
395395
}
396396
Fingerprinter fp(m);
@@ -580,7 +580,7 @@ class CollectCLDClosure : public CLDClosure {
580580
bool MetaspaceShared::linking_required(InstanceKlass* ik) {
581581
// For static CDS dump, do not link old classes.
582582
// For dynamic CDS dump, only link classes loaded by the builtin class loaders.
583-
return DumpSharedSpaces ? !ik->has_old_class_version() : !ik->is_shared_unregistered_class();
583+
return DumpSharedSpaces ? !ik->can_be_verified_at_dumptime() : !ik->is_shared_unregistered_class();
584584
}
585585

586586
bool MetaspaceShared::link_class_for_cds(InstanceKlass* ik, TRAPS) {
@@ -756,7 +756,7 @@ bool MetaspaceShared::try_link_class(JavaThread* current, InstanceKlass* ik) {
756756
ExceptionMark em(current);
757757
JavaThread* THREAD = current; // For exception macros.
758758
Arguments::assert_is_dumping_archive();
759-
if (ik->is_loaded() && !ik->is_linked() && !ik->has_old_class_version() &&
759+
if (ik->is_loaded() && !ik->is_linked() && !ik->can_be_verified_at_dumptime() &&
760760
!SystemDictionaryShared::has_class_failed_verification(ik)) {
761761
bool saved = BytecodeVerificationLocal;
762762
if (ik->is_shared_unregistered_class() && ik->class_loader() == NULL) {

src/hotspot/share/classfile/systemDictionaryShared.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
13861386
if (has_class_failed_verification(k)) {
13871387
return warn_excluded(k, "Failed verification");
13881388
} else {
1389-
if (!k->has_old_class_version()) {
1389+
if (!k->can_be_verified_at_dumptime()) {
13901390
return warn_excluded(k, "Not linked");
13911391
}
13921392
}
@@ -1400,7 +1400,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
14001400
return true;
14011401
}
14021402

1403-
if (k->has_old_class_version() && k->is_linked()) {
1403+
if (k->can_be_verified_at_dumptime() && k->is_linked()) {
14041404
return warn_excluded(k, "Old class has been linked");
14051405
}
14061406

src/hotspot/share/interpreter/rewriter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ void Rewriter::rewrite(InstanceKlass* klass, TRAPS) {
571571
#if INCLUDE_CDS
572572
if (klass->is_shared()) {
573573
assert(!klass->is_rewritten(), "rewritten shared classes cannot be rewritten again");
574-
assert(klass->has_old_class_version(), "only shared old classes aren't rewritten");
574+
assert(klass->can_be_verified_at_dumptime(), "only shared old classes aren't rewritten");
575575
}
576576
#endif // INCLUDE_CDS
577577
ResourceMark rm(THREAD);

src/hotspot/share/oops/instanceKlass.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,7 @@ void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) {
24022402

24032403
void InstanceKlass::remove_unshareable_info() {
24042404

2405-
if (has_old_class_version()) {
2405+
if (can_be_verified_at_dumptime()) {
24062406
// Set the old class bit.
24072407
set_is_shared_old_klass();
24082408
}
@@ -2546,17 +2546,17 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl
25462546
// without changing the old verifier, the verification constraint cannot be
25472547
// retrieved during dump time.
25482548
// Verification of archived old classes will be performed during run time.
2549-
bool InstanceKlass::has_old_class_version() const {
2549+
bool InstanceKlass::can_be_verified_at_dumptime() const {
25502550
if (major_version() < 50 /*JAVA_6_VERSION*/) {
25512551
return true;
25522552
}
2553-
if (java_super() != NULL && java_super()->has_old_class_version()) {
2553+
if (java_super() != NULL && java_super()->can_be_verified_at_dumptime()) {
25542554
return true;
25552555
}
25562556
Array<InstanceKlass*>* interfaces = local_interfaces();
25572557
int len = interfaces->length();
25582558
for (int i = 0; i < len; i++) {
2559-
if (interfaces->at(i)->has_old_class_version()) {
2559+
if (interfaces->at(i)->can_be_verified_at_dumptime()) {
25602560
return true;
25612561
}
25622562
}

src/hotspot/share/oops/instanceKlass.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ class InstanceKlass: public Klass {
12281228
virtual void remove_java_mirror();
12291229
void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, PackageEntry* pkg_entry, TRAPS);
12301230
void init_shared_package_entry();
1231-
bool has_old_class_version() const;
1231+
bool can_be_verified_at_dumptime() const;
12321232

12331233
jint compute_modifier_flags() const;
12341234

src/hotspot/share/oops/klassVtable.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,8 @@ void itableMethodEntry::initialize(InstanceKlass* klass, Method* m) {
10941094
#ifdef ASSERT
10951095
if (MetaspaceShared::is_in_shared_metaspace((void*)&_method) &&
10961096
!MetaspaceShared::remapped_readwrite() &&
1097-
!m->method_holder()->has_old_class_version() &&
1098-
!klass->has_old_class_version()) {
1097+
!m->method_holder()->can_be_verified_at_dumptime() &&
1098+
!klass->can_be_verified_at_dumptime()) {
10991099
// At runtime initialize_itable is rerun as part of link_class_impl()
11001100
// for a shared class loaded by the non-boot loader.
11011101
// The dumptime itable method entry should be the same as the runtime entry.

0 commit comments

Comments
 (0)