8149977: DumpLoadedClassList should not include generated classes.
Summary: Exclude anonymous classes from the generated class list.
Reviewed-by: ccheung, iklam, hseigel
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp Tue May 17 17:40:19 2016 +0000
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp Tue May 17 17:42:16 2016 -0400
@@ -5708,8 +5708,10 @@
#if INCLUDE_CDS
if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
- // Only dump the classes that can be stored into CDS archive
- if (SystemDictionaryShared::is_sharing_possible(_loader_data)) {
+ // Only dump the classes that can be stored into CDS archive.
+ // Anonymous classes such as generated LambdaForm classes are also not included.
+ if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
+ _host_klass == NULL) {
ResourceMark rm(THREAD);
classlist_file->print_cr("%s", _class_name->as_C_string());
classlist_file->flush();