Skip to content

Commit 61f6cd2

Browse files
committedFeb 13, 2025
Reinstated ArchiveLoaderLookupCache after merging JEP 483 from mainline
1 parent 79f7e61 commit 61f6cd2

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed
 

‎src/hotspot/share/cds/cdsConfig.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,6 @@ bool CDSConfig::check_vm_args_consistency(bool patch_mod_javabase, bool mode_fla
589589
FLAG_SET_ERGO_IF_DEFAULT(ArchivePackages, true);
590590
FLAG_SET_ERGO_IF_DEFAULT(ArchiveProtectionDomains, true);
591591
FLAG_SET_ERGO_IF_DEFAULT(ArchiveReflectionData, true);
592-
593-
FLAG_SET_ERGO(ArchiveLoaderLookupCache, false); // FIXME -- leyden+JEP483 merge
594592
} else {
595593
// All of these *might* depend on AOTClassLinking. Better be safe than sorry.
596594
// TODO: more fine-grained handling.

‎src/hotspot/share/classfile/systemDictionaryShared.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
338338
}
339339
}
340340

341-
if (!CDSConfig::preserve_all_dumptime_verification_states(k)) {
342341
if (!k->is_linked()) {
343342
if (has_class_failed_verification(k)) {
344343
return warn_excluded(k, "Failed verification");
@@ -351,7 +350,7 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
351350
return warn_excluded(k, "Unlinked class not supported by AOTClassLinking");
352351
}
353352
} else {
354-
if (!k->can_be_verified_at_dumptime()) {
353+
if (!k->can_be_verified_at_dumptime() && !CDSConfig::preserve_all_dumptime_verification_states(k)) {
355354
// We have an old class that has been linked (e.g., it's been executed during
356355
// dump time). This class has been verified using the old verifier, which
357356
// doesn't save the verification constraints, so check_verification_constraints()
@@ -361,7 +360,6 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
361360
return warn_excluded(k, "Old class has been linked");
362361
}
363362
}
364-
}
365363

366364
InstanceKlass* super = k->java_super();
367365
if (super != nullptr && check_for_exclusion(super, nullptr)) {

‎test/hotspot/jtreg/runtime/cds/appcds/aotClassLinking/AOTClassLinkingVerification.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -99,7 +99,7 @@ public static void main(String[] args) throws Exception {
9999
app1Jar = new File(args[0]);
100100
assertNotShared(UnlinkedSub.class);
101101
assertShared(UnlinkedSuper.class);
102-
assertShared(Unlinked.class);
102+
assertNotShared(Unlinked.class); // failed verification during dump time
103103
assertNotShared(Foo.class);
104104
assertNotShared(NotFoo.class);
105105
String s = Unlinked.doit();
@@ -108,28 +108,28 @@ public static void main(String[] args) throws Exception {
108108
}
109109

110110
Class cls_BadOldClass = Class.forName("BadOldClass", false, classLoader);
111-
assertShared(cls_BadOldClass);
111+
assertNotShared(cls_BadOldClass); // failed verification during dump time
112112
try {
113113
cls_BadOldClass.newInstance();
114114
throw new RuntimeException("BadOldClass cannot be verified");
115115
} catch (VerifyError expected) {}
116116

117117
Class cls_BadOldClass2 = Class.forName("BadOldClass2", false, classLoader);
118-
assertShared(cls_BadOldClass2);
118+
assertNotShared(cls_BadOldClass2); // failed verification during dump time
119119
try {
120120
cls_BadOldClass2.newInstance();
121121
throw new RuntimeException("BadOldClass2 cannot be verified");
122122
} catch (VerifyError expected) {}
123123

124124
Class cls_BadNewClass = Class.forName("BadNewClass", false, classLoader);
125-
assertShared(cls_BadNewClass);
125+
assertNotShared(cls_BadNewClass); // failed verification during dump time
126126
try {
127127
cls_BadNewClass.newInstance();
128128
throw new RuntimeException("BadNewClass cannot be verified");
129129
} catch (VerifyError expected) {}
130130

131131
Class cls_BadNewClass2 = Class.forName("BadNewClass2", false, classLoader);
132-
assertShared(cls_BadNewClass2);
132+
assertNotShared(cls_BadNewClass2); // failed verification during dump time
133133
try {
134134
cls_BadNewClass2.newInstance();
135135
throw new RuntimeException("BadNewClass2 cannot be verified");

0 commit comments

Comments
 (0)
Please sign in to comment.