21 * questions.
22 *
23 */
24 #include "precompiled.hpp"
25 #include "aot/aotLoader.hpp"
26 #include "classfile/classFileParser.hpp"
27 #include "classfile/classFileStream.hpp"
28 #include "classfile/classLoader.hpp"
29 #include "classfile/classLoaderData.inline.hpp"
30 #include "classfile/defaultMethods.hpp"
31 #include "classfile/dictionary.hpp"
32 #include "classfile/javaClasses.inline.hpp"
33 #include "classfile/moduleEntry.hpp"
34 #include "classfile/symbolTable.hpp"
35 #include "classfile/systemDictionary.hpp"
36 #include "classfile/verificationType.hpp"
37 #include "classfile/verifier.hpp"
38 #include "classfile/vmSymbols.hpp"
39 #include "gc/shared/gcLocker.hpp"
40 #include "logging/log.hpp"
41 #include "memory/allocation.hpp"
42 #include "memory/metadataFactory.hpp"
43 #include "memory/oopFactory.hpp"
44 #include "memory/resourceArea.hpp"
45 #include "memory/universe.inline.hpp"
46 #include "oops/annotations.hpp"
47 #include "oops/fieldStreams.hpp"
48 #include "oops/instanceKlass.hpp"
49 #include "oops/instanceMirrorKlass.hpp"
50 #include "oops/klass.inline.hpp"
51 #include "oops/klassVtable.hpp"
52 #include "oops/metadata.hpp"
53 #include "oops/method.hpp"
54 #include "oops/oop.inline.hpp"
55 #include "oops/symbol.hpp"
56 #include "prims/jvm.h"
57 #include "prims/jvmtiExport.hpp"
58 #include "prims/jvmtiThreadState.hpp"
59 #include "runtime/javaCalls.hpp"
60 #include "runtime/perfData.hpp"
5895 vmSymbols::java_lang_NoClassDefFoundError(),
5896 "%s (wrong name: %s)",
5897 _class_name->as_C_string(),
5898 _requested_name != NULL ? _requested_name->as_C_string() : "NoName"
5899 );
5900 return;
5901 }
5902
5903 // if this is an anonymous class fix up its name if it's in the unnamed
5904 // package. Otherwise, throw IAE if it is in a different package than
5905 // its host class.
5906 if (_host_klass != NULL) {
5907 fix_anonymous_class_name(CHECK);
5908 }
5909
5910 // Verification prevents us from creating names with dots in them, this
5911 // asserts that that's the case.
5912 assert(is_internal_format(_class_name), "external class name format used internally");
5913
5914 if (!is_internal()) {
5915 if (log_is_enabled(Debug, class, preorder)){
5916 ResourceMark rm(THREAD);
5917 outputStream* log = Log(class, preorder)::debug_stream();
5918 log->print("%s", _class_name->as_klass_external_name());
5919 if (stream->source() != NULL) {
5920 log->print(" source: %s", stream->source());
5921 }
5922 log->cr();
5923 }
5924
5925 #if INCLUDE_CDS
5926 if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
5927 // Only dump the classes that can be stored into CDS archive.
5928 // Anonymous classes such as generated LambdaForm classes are also not included.
5929 if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
5930 _host_klass == NULL) {
5931 oop class_loader = _loader_data->class_loader();
5932 ResourceMark rm(THREAD);
5933 // For the boot and platform class loaders, check if the class is not found in the
5934 // java runtime image. Additional check for the boot class loader is if the class
5935 // is not found in the boot loader's appended entries. This indicates that the class
5936 // is not useable during run time, such as the ones found in the --patch-module entries,
5937 // so it should not be included in the classlist file.
5938 if (((class_loader == NULL && !ClassLoader::contains_append_entry(stream->source())) ||
5939 SystemDictionary::is_platform_class_loader(class_loader)) &&
5940 !ClassLoader::is_jrt(stream->source())) {
5941 tty->print_cr("skip writing class %s from source %s to classlist file",
5942 _class_name->as_C_string(), stream->source());
|
21 * questions.
22 *
23 */
24 #include "precompiled.hpp"
25 #include "aot/aotLoader.hpp"
26 #include "classfile/classFileParser.hpp"
27 #include "classfile/classFileStream.hpp"
28 #include "classfile/classLoader.hpp"
29 #include "classfile/classLoaderData.inline.hpp"
30 #include "classfile/defaultMethods.hpp"
31 #include "classfile/dictionary.hpp"
32 #include "classfile/javaClasses.inline.hpp"
33 #include "classfile/moduleEntry.hpp"
34 #include "classfile/symbolTable.hpp"
35 #include "classfile/systemDictionary.hpp"
36 #include "classfile/verificationType.hpp"
37 #include "classfile/verifier.hpp"
38 #include "classfile/vmSymbols.hpp"
39 #include "gc/shared/gcLocker.hpp"
40 #include "logging/log.hpp"
41 #include "logging/logStream.hpp"
42 #include "memory/allocation.hpp"
43 #include "memory/metadataFactory.hpp"
44 #include "memory/oopFactory.hpp"
45 #include "memory/resourceArea.hpp"
46 #include "memory/universe.inline.hpp"
47 #include "oops/annotations.hpp"
48 #include "oops/fieldStreams.hpp"
49 #include "oops/instanceKlass.hpp"
50 #include "oops/instanceMirrorKlass.hpp"
51 #include "oops/klass.inline.hpp"
52 #include "oops/klassVtable.hpp"
53 #include "oops/metadata.hpp"
54 #include "oops/method.hpp"
55 #include "oops/oop.inline.hpp"
56 #include "oops/symbol.hpp"
57 #include "prims/jvm.h"
58 #include "prims/jvmtiExport.hpp"
59 #include "prims/jvmtiThreadState.hpp"
60 #include "runtime/javaCalls.hpp"
61 #include "runtime/perfData.hpp"
5896 vmSymbols::java_lang_NoClassDefFoundError(),
5897 "%s (wrong name: %s)",
5898 _class_name->as_C_string(),
5899 _requested_name != NULL ? _requested_name->as_C_string() : "NoName"
5900 );
5901 return;
5902 }
5903
5904 // if this is an anonymous class fix up its name if it's in the unnamed
5905 // package. Otherwise, throw IAE if it is in a different package than
5906 // its host class.
5907 if (_host_klass != NULL) {
5908 fix_anonymous_class_name(CHECK);
5909 }
5910
5911 // Verification prevents us from creating names with dots in them, this
5912 // asserts that that's the case.
5913 assert(is_internal_format(_class_name), "external class name format used internally");
5914
5915 if (!is_internal()) {
5916 LogTarget(Debug, class, preorder) lt;
5917 if (lt.is_enabled()){
5918 ResourceMark rm(THREAD);
5919 LogStream ls(lt);
5920 ls.print("%s", _class_name->as_klass_external_name());
5921 if (stream->source() != NULL) {
5922 ls.print(" source: %s", stream->source());
5923 }
5924 ls.cr();
5925 }
5926
5927 #if INCLUDE_CDS
5928 if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
5929 // Only dump the classes that can be stored into CDS archive.
5930 // Anonymous classes such as generated LambdaForm classes are also not included.
5931 if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
5932 _host_klass == NULL) {
5933 oop class_loader = _loader_data->class_loader();
5934 ResourceMark rm(THREAD);
5935 // For the boot and platform class loaders, check if the class is not found in the
5936 // java runtime image. Additional check for the boot class loader is if the class
5937 // is not found in the boot loader's appended entries. This indicates that the class
5938 // is not useable during run time, such as the ones found in the --patch-module entries,
5939 // so it should not be included in the classlist file.
5940 if (((class_loader == NULL && !ClassLoader::contains_append_entry(stream->source())) ||
5941 SystemDictionary::is_platform_class_loader(class_loader)) &&
5942 !ClassLoader::is_jrt(stream->source())) {
5943 tty->print_cr("skip writing class %s from source %s to classlist file",
5944 _class_name->as_C_string(), stream->source());
|