comparison src/share/vm/classfile/classFileParser.cpp @ 14241:715bc50198c1

8031376: TraceClassLoading expects there to be a (Java) caller when you load a class with the bootstrap class loader Reviewed-by: sla, dholmes Contributed-by: jeremymanson@google.com
author sla
date Wed, 08 Jan 2014 08:34:02 +0100
parents 19146c82b6fc
children 2e7b5143763f
comparison
equal deleted inserted replaced
14190:ce86c36b8921 14241:715bc50198c1
4096 // print in a single call to reduce interleaving of output 4096 // print in a single call to reduce interleaving of output
4097 if (cfs->source() != NULL) { 4097 if (cfs->source() != NULL) {
4098 tty->print("[Loaded %s from %s]\n", this_klass->external_name(), 4098 tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4099 cfs->source()); 4099 cfs->source());
4100 } else if (class_loader.is_null()) { 4100 } else if (class_loader.is_null()) {
4101 if (THREAD->is_Java_thread()) { 4101 Klass* caller =
4102 Klass* caller = ((JavaThread*)THREAD)->security_get_caller_class(1); 4102 THREAD->is_Java_thread()
4103 ? ((JavaThread*)THREAD)->security_get_caller_class(1)
4104 : NULL;
4105 // caller can be NULL, for example, during a JVMTI VM_Init hook
4106 if (caller != NULL) {
4103 tty->print("[Loaded %s by instance of %s]\n", 4107 tty->print("[Loaded %s by instance of %s]\n",
4104 this_klass->external_name(), 4108 this_klass->external_name(),
4105 InstanceKlass::cast(caller)->external_name()); 4109 InstanceKlass::cast(caller)->external_name());
4106 } else { 4110 } else {
4107 tty->print("[Loaded %s]\n", this_klass->external_name()); 4111 tty->print("[Loaded %s]\n", this_klass->external_name());