8149977: DumpLoadedClassList should not include generated classes.
authorjiangli
Tue, 17 May 2016 17:42:16 -0400
changeset 38313 615905db3fe4
parent 38312 78d71e48e040
child 38314 0369cc2a8493
child 38634 176eda5b3359
8149977: DumpLoadedClassList should not include generated classes. Summary: Exclude anonymous classes from the generated class list. Reviewed-by: ccheung, iklam, hseigel
hotspot/src/share/vm/classfile/classFileParser.cpp
--- 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();