changeset 11259:3a09628e0316

8149977: DumpLoadedClassList should not include generated classes. Summary: Exclude anonymous classes from the generated class list. Reviewed-by: ccheung, iklam, hseigel
author jiangli
date Tue, 17 May 2016 17:42:16 -0400
parents 890d81d31ea1
children 9a9e0c3725ee 51d42ae63fe5
files src/share/vm/classfile/classFileParser.cpp
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/classFileParser.cpp	Tue May 17 17:40:19 2016 +0000
+++ b/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();