src/share/vm/classfile/classFileParser.cpp

Print this page
rev 9502 : imported patch 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"


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







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




  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"


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 (log_is_enabled(Debug, classload)) {
4332       this_klass()->print_loading_log(LogLevel::Debug, loader_data, cfs);
4333     }
4334     if (log_is_enabled(Trace, classload)) {
4335       this_klass()->print_loading_log(LogLevel::Trace, loader_data, cfs);
4336     }
4337 
4338     if (TraceClassResolution) {
4339       ResourceMark rm;
4340       // print out the superclass.
4341       const char * from = this_klass()->external_name();
4342       if (this_klass->java_super() != NULL) {
4343         tty->print("RESOLVE %s %s (super)\n", from, this_klass->java_super()->external_name());
4344       }
4345       // print out each of the interface classes referred to by this class.
4346       Array<Klass*>* local_interfaces = this_klass->local_interfaces();
4347       if (local_interfaces != NULL) {
4348         int length = local_interfaces->length();
4349         for (int i = 0; i < length; i++) {
4350           Klass* k = local_interfaces->at(i);
4351           const char * to = k->external_name();
4352           tty->print("RESOLVE %s %s (interface)\n", from, to);
4353         }
4354       }
4355     }