5773 if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) { |
5773 if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) { |
5774 // Only dump the classes that can be stored into CDS archive. |
5774 // Only dump the classes that can be stored into CDS archive. |
5775 // Anonymous classes such as generated LambdaForm classes are also not included. |
5775 // Anonymous classes such as generated LambdaForm classes are also not included. |
5776 if (SystemDictionaryShared::is_sharing_possible(_loader_data) && |
5776 if (SystemDictionaryShared::is_sharing_possible(_loader_data) && |
5777 _host_klass == NULL) { |
5777 _host_klass == NULL) { |
|
5778 oop class_loader = _loader_data->class_loader(); |
5778 ResourceMark rm(THREAD); |
5779 ResourceMark rm(THREAD); |
5779 classlist_file->print_cr("%s", _class_name->as_C_string()); |
5780 // For the boot and platform class loaders, check if the class is not found in the |
5780 classlist_file->flush(); |
5781 // java runtime image. Additional check for the boot class loader is if the class |
|
5782 // is not found in the boot loader's appended entries. This indicates that the class |
|
5783 // is not useable during run time, such as the ones found in the --patch-module entries, |
|
5784 // so it should not be included in the classlist file. |
|
5785 if (((class_loader == NULL && !ClassLoader::contains_append_entry(stream->source())) || |
|
5786 SystemDictionary::is_platform_class_loader(class_loader)) && |
|
5787 !ClassLoader::is_jrt(stream->source())) { |
|
5788 tty->print_cr("skip writing class %s from source %s to classlist file", |
|
5789 _class_name->as_C_string(), stream->source()); |
|
5790 } else { |
|
5791 classlist_file->print_cr("%s", _class_name->as_C_string()); |
|
5792 classlist_file->flush(); |
|
5793 } |
5781 } |
5794 } |
5782 } |
5795 } |
5783 #endif |
5796 #endif |
5784 } |
5797 } |
5785 |
5798 |