src/share/vm/classfile/classFileParser.cpp

Print this page
rev 9245 : [mq]: class_loading_log


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classFileParser.hpp"
  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/classLoaderData.inline.hpp"
  29 #include "classfile/defaultMethods.hpp"
  30 #include "classfile/javaClasses.inline.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "classfile/verificationType.hpp"
  34 #include "classfile/verifier.hpp"
  35 #include "classfile/vmSymbols.hpp"
  36 #include "gc/shared/gcLocker.hpp"

  37 #include "memory/allocation.hpp"
  38 #include "memory/metadataFactory.hpp"
  39 #include "memory/oopFactory.hpp"
  40 #include "memory/referenceType.hpp"
  41 #include "memory/resourceArea.hpp"
  42 #include "memory/universe.inline.hpp"
  43 #include "oops/constantPool.hpp"
  44 #include "oops/fieldStreams.hpp"
  45 #include "oops/instanceKlass.hpp"
  46 #include "oops/instanceMirrorKlass.hpp"
  47 #include "oops/klass.inline.hpp"
  48 #include "oops/klassVtable.hpp"
  49 #include "oops/method.hpp"
  50 #include "oops/symbol.hpp"
  51 #include "prims/jvm.h"
  52 #include "prims/jvmtiExport.hpp"
  53 #include "prims/jvmtiThreadState.hpp"
  54 #include "runtime/javaCalls.hpp"
  55 #include "runtime/perfData.hpp"
  56 #include "runtime/reflection.hpp"


4309       if (cfs->source() != NULL) {
4310         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4311                    cfs->source());
4312       } else if (class_loader.is_null()) {
4313         Klass* caller =
4314             THREAD->is_Java_thread()
4315                 ? ((JavaThread*)THREAD)->security_get_caller_class(1)
4316                 : NULL;
4317         // caller can be NULL, for example, during a JVMTI VM_Init hook
4318         if (caller != NULL) {
4319           tty->print("[Loaded %s by instance of %s]\n",
4320                      this_klass->external_name(),
4321                      caller->external_name());
4322         } else {
4323           tty->print("[Loaded %s]\n", this_klass->external_name());
4324         }
4325       } else {
4326         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4327                    class_loader->klass()->external_name());
4328       }







4329     }
4330 
4331     if (TraceClassResolution) {
4332       ResourceMark rm;
4333       // print out the superclass.
4334       const char * from = this_klass()->external_name();
4335       if (this_klass->java_super() != NULL) {
4336         tty->print("RESOLVE %s %s (super)\n", from, this_klass->java_super()->external_name());
4337       }
4338       // print out each of the interface classes referred to by this class.
4339       Array<Klass*>* local_interfaces = this_klass->local_interfaces();
4340       if (local_interfaces != NULL) {
4341         int length = local_interfaces->length();
4342         for (int i = 0; i < length; i++) {
4343           Klass* k = local_interfaces->at(i);
4344           const char * to = k->external_name();
4345           tty->print("RESOLVE %s %s (interface)\n", from, to);
4346         }
4347       }
4348     }




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classFileParser.hpp"
  27 #include "classfile/classLoader.hpp"
  28 #include "classfile/classLoaderData.inline.hpp"
  29 #include "classfile/defaultMethods.hpp"
  30 #include "classfile/javaClasses.inline.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "classfile/verificationType.hpp"
  34 #include "classfile/verifier.hpp"
  35 #include "classfile/vmSymbols.hpp"
  36 #include "gc/shared/gcLocker.hpp"
  37 #include "logging/log.hpp"
  38 #include "memory/allocation.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/oopFactory.hpp"
  41 #include "memory/referenceType.hpp"
  42 #include "memory/resourceArea.hpp"
  43 #include "memory/universe.inline.hpp"
  44 #include "oops/constantPool.hpp"
  45 #include "oops/fieldStreams.hpp"
  46 #include "oops/instanceKlass.hpp"
  47 #include "oops/instanceMirrorKlass.hpp"
  48 #include "oops/klass.inline.hpp"
  49 #include "oops/klassVtable.hpp"
  50 #include "oops/method.hpp"
  51 #include "oops/symbol.hpp"
  52 #include "prims/jvm.h"
  53 #include "prims/jvmtiExport.hpp"
  54 #include "prims/jvmtiThreadState.hpp"
  55 #include "runtime/javaCalls.hpp"
  56 #include "runtime/perfData.hpp"
  57 #include "runtime/reflection.hpp"


4310       if (cfs->source() != NULL) {
4311         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4312                    cfs->source());
4313       } else if (class_loader.is_null()) {
4314         Klass* caller =
4315             THREAD->is_Java_thread()
4316                 ? ((JavaThread*)THREAD)->security_get_caller_class(1)
4317                 : NULL;
4318         // caller can be NULL, for example, during a JVMTI VM_Init hook
4319         if (caller != NULL) {
4320           tty->print("[Loaded %s by instance of %s]\n",
4321                      this_klass->external_name(),
4322                      caller->external_name());
4323         } else {
4324           tty->print("[Loaded %s]\n", this_klass->external_name());
4325         }
4326       } else {
4327         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4328                    class_loader->klass()->external_name());
4329       }
4330     }
4331 
4332     if (log_is_enabled(Debug, classload)) {
4333       this_klass()->print_loading_log(LogLevel::Debug, loader_data, cfs);
4334     }
4335     if (log_is_enabled(Trace, classload)) {
4336       this_klass()->print_loading_log(LogLevel::Trace, loader_data, cfs);
4337     }
4338 
4339     if (TraceClassResolution) {
4340       ResourceMark rm;
4341       // print out the superclass.
4342       const char * from = this_klass()->external_name();
4343       if (this_klass->java_super() != NULL) {
4344         tty->print("RESOLVE %s %s (super)\n", from, this_klass->java_super()->external_name());
4345       }
4346       // print out each of the interface classes referred to by this class.
4347       Array<Klass*>* local_interfaces = this_klass->local_interfaces();
4348       if (local_interfaces != NULL) {
4349         int length = local_interfaces->length();
4350         for (int i = 0; i < length; i++) {
4351           Klass* k = local_interfaces->at(i);
4352           const char * to = k->external_name();
4353           tty->print("RESOLVE %s %s (interface)\n", from, to);
4354         }
4355       }
4356     }