提交 efa8e575 编写于 作者: S sla

8031376: TraceClassLoading expects there to be a (Java) caller when you load a...

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
上级 7cd059e8
...@@ -4165,8 +4165,12 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, ...@@ -4165,8 +4165,12 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
tty->print("[Loaded %s from %s]\n", this_klass->external_name(), tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
cfs->source()); cfs->source());
} else if (class_loader.is_null()) { } else if (class_loader.is_null()) {
if (THREAD->is_Java_thread()) { Klass* caller =
Klass* caller = ((JavaThread*)THREAD)->security_get_caller_class(1); THREAD->is_Java_thread()
? ((JavaThread*)THREAD)->security_get_caller_class(1)
: NULL;
// caller can be NULL, for example, during a JVMTI VM_Init hook
if (caller != NULL) {
tty->print("[Loaded %s by instance of %s]\n", tty->print("[Loaded %s by instance of %s]\n",
this_klass->external_name(), this_klass->external_name(),
InstanceKlass::cast(caller)->external_name()); InstanceKlass::cast(caller)->external_name());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册