< prev index next >

src/share/vm/classfile/classFileParser.cpp

Print this page
rev 13288 : imported patch 8181917-refactor-ul-logstream


  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"


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     if (log_is_enabled(Debug, class, preorder)){

5917       ResourceMark rm(THREAD);
5918       outputStream* log = Log(class, preorder)::debug_stream();
5919       log->print("%s", _class_name->as_klass_external_name());
5920       if (stream->source() != NULL) {
5921         log->print(" source: %s", stream->source());
5922       }
5923       log->cr();
5924     }
5925 
5926 #if INCLUDE_CDS
5927     if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
5928       // Only dump the classes that can be stored into CDS archive.
5929       // Anonymous classes such as generated LambdaForm classes are also not included.
5930       if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
5931           _host_klass == NULL) {
5932         oop class_loader = _loader_data->class_loader();
5933         ResourceMark rm(THREAD);
5934         // For the boot and platform class loaders, check if the class is not found in the
5935         // java runtime image. Additional check for the boot class loader is if the class
5936         // is not found in the boot loader's appended entries. This indicates that the class
5937         // is not useable during run time, such as the ones found in the --patch-module entries,
5938         // so it should not be included in the classlist file.
5939         if (((class_loader == NULL && !ClassLoader::contains_append_entry(stream->source())) ||
5940              SystemDictionary::is_platform_class_loader(class_loader)) &&
5941             !ClassLoader::is_jrt(stream->source())) {
5942           tty->print_cr("skip writing class %s from source %s to classlist file",
5943             _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"


5897       vmSymbols::java_lang_NoClassDefFoundError(),
5898       "%s (wrong name: %s)",
5899       _class_name->as_C_string(),
5900       _requested_name != NULL ? _requested_name->as_C_string() : "NoName"
5901     );
5902     return;
5903   }
5904 
5905   // if this is an anonymous class fix up its name if it's in the unnamed
5906   // package.  Otherwise, throw IAE if it is in a different package than
5907   // its host class.
5908   if (_host_klass != NULL) {
5909     fix_anonymous_class_name(CHECK);
5910   }
5911 
5912   // Verification prevents us from creating names with dots in them, this
5913   // asserts that that's the case.
5914   assert(is_internal_format(_class_name), "external class name format used internally");
5915 
5916   if (!is_internal()) {
5917     LogTarget(Debug, class, preorder) lt;
5918     if (lt.is_enabled()){
5919       ResourceMark rm(THREAD);
5920       LogStream ls(lt);
5921       ls.print("%s", _class_name->as_klass_external_name());
5922       if (stream->source() != NULL) {
5923         ls.print(" source: %s", stream->source());
5924       }
5925       ls.cr();
5926     }
5927 
5928 #if INCLUDE_CDS
5929     if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
5930       // Only dump the classes that can be stored into CDS archive.
5931       // Anonymous classes such as generated LambdaForm classes are also not included.
5932       if (SystemDictionaryShared::is_sharing_possible(_loader_data) &&
5933           _host_klass == NULL) {
5934         oop class_loader = _loader_data->class_loader();
5935         ResourceMark rm(THREAD);
5936         // For the boot and platform class loaders, check if the class is not found in the
5937         // java runtime image. Additional check for the boot class loader is if the class
5938         // is not found in the boot loader's appended entries. This indicates that the class
5939         // is not useable during run time, such as the ones found in the --patch-module entries,
5940         // so it should not be included in the classlist file.
5941         if (((class_loader == NULL && !ClassLoader::contains_append_entry(stream->source())) ||
5942              SystemDictionary::is_platform_class_loader(class_loader)) &&
5943             !ClassLoader::is_jrt(stream->source())) {
5944           tty->print_cr("skip writing class %s from source %s to classlist file",
5945             _class_name->as_C_string(), stream->source());


< prev index next >