Skip to content

Commit d4dfa01

Browse files
author
Matias Saavedra Silva
committed
8338530: CDS warning Skipping java/lang/invoke/BoundMethodHandle$Species_LLLL
Reviewed-by: iklam, ccheung
1 parent b8d560b commit d4dfa01

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/hotspot/share/classfile/systemDictionaryShared.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,16 @@ bool SystemDictionaryShared::check_for_exclusion_impl(InstanceKlass* k) {
274274
return warn_excluded(k, "Has been redefined");
275275
}
276276
if (!k->is_hidden() && k->shared_classpath_index() < 0 && is_builtin(k)) {
277-
// These are classes loaded from unsupported locations (such as those loaded by JVMTI native
278-
// agent during dump time).
279-
return warn_excluded(k, "Unsupported location");
277+
if (k->name()->starts_with("java/lang/invoke/BoundMethodHandle$Species_")) {
278+
// This class is dynamically generated by the JDK
279+
ResourceMark rm;
280+
log_info(cds)("Skipping %s because it is dynamically generated", k->name()->as_C_string());
281+
return true; // exclude without warning
282+
} else {
283+
// These are classes loaded from unsupported locations (such as those loaded by JVMTI native
284+
// agent during dump time).
285+
return warn_excluded(k, "Unsupported location");
286+
}
280287
}
281288
if (k->signers() != nullptr) {
282289
// We cannot include signed classes in the archive because the certificates

test/hotspot/jtreg/runtime/cds/appcds/jvmti/dumpingWithAgent/DumpingWithJavaAgent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, 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
@@ -76,6 +76,7 @@ public static void main(String[] args) throws Throwable {
7676
output.shouldContain(warningMessages[0]);
7777
output.shouldContain(warningMessages[1]);
7878
output.shouldContain("inside SimpleAgent");
79+
output.shouldContain("Skipping java/lang/invoke/BoundMethodHandle$Species_LLLL because it is dynamically generated");
7980

8081
// CDS dumping with a java agent with the AllowArchvingWithJavaAgent diagnostic option.
8182
output = TestCommon.testDump(appJar, TestCommon.list("Hello"),

0 commit comments

Comments
 (0)