< prev index next >
src/hotspot/share/interpreter/linkResolver.cpp
Print this page
rev 50260 : 8199940: Print more information about class loaders in IllegalAccessErrors.
ReviewedBy: lfoltan
*** 216,226 ****
break;
default:
fatal("Unexpected call kind %d", call_kind());
}
}
! #endif //ASSERT
#ifndef PRODUCT
void CallInfo::print() {
ResourceMark rm;
const char* kindstr;
--- 216,226 ----
break;
default:
fatal("Unexpected call kind %d", call_kind());
}
}
! #endif // ASSERT
#ifndef PRODUCT
void CallInfo::print() {
ResourceMark rm;
const char* kindstr;
*** 292,302 ****
if (fold_type_to_class) {
if (sel_klass->is_objArray_klass()) {
base_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass();
}
// The element type could be a typeArray - we only need the access
! // check if it is an reference to another class.
if (!base_klass->is_instance_klass()) {
return; // no relevant check to do
}
}
Reflection::VerifyClassAccessResults vca_result =
--- 292,302 ----
if (fold_type_to_class) {
if (sel_klass->is_objArray_klass()) {
base_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass();
}
// The element type could be a typeArray - we only need the access
! // check if it is a reference to another class.
if (!base_klass->is_instance_klass()) {
return; // no relevant check to do
}
}
Reflection::VerifyClassAccessResults vca_result =
*** 309,320 ****
if (msg == NULL) {
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
"failed to access class %s from class %s",
! base_klass->external_name(),
! ref_klass->external_name());
} else {
// Use module specific message returned by verify_class_access_msg().
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
--- 309,320 ----
if (msg == NULL) {
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
"failed to access class %s from class %s",
! base_klass->class_loader_and_module_name(),
! ref_klass->class_loader_and_module_name());
} else {
// Use module specific message returned by verify_class_access_msg().
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
*** 541,551 ****
tty->print_cr("*** result for %s: ", vmIntrinsics::name_at(iid));
result->print();
}
assert(actual_size_of_params == expected_size_of_params,
"%d != %d", actual_size_of_params, expected_size_of_params);
! #endif //ASSERT
assert(appendix_result_or_null != NULL, "");
(*appendix_result_or_null) = appendix;
(*method_type_result) = method_type;
}
--- 541,551 ----
tty->print_cr("*** result for %s: ", vmIntrinsics::name_at(iid));
result->print();
}
assert(actual_size_of_params == expected_size_of_params,
"%d != %d", actual_size_of_params, expected_size_of_params);
! #endif // ASSERT
assert(appendix_result_or_null != NULL, "");
(*appendix_result_or_null) = appendix;
(*method_type_result) = method_type;
}
*** 589,604 ****
true)) {
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
! "tried to access method %s.%s%s from class %s",
! sel_klass->external_name(),
sel_method->name()->as_C_string(),
sel_method->signature()->as_C_string(),
! ref_klass->external_name()
! );
return;
}
}
methodHandle LinkResolver::resolve_method_statically(Bytecodes::Code code,
--- 589,606 ----
true)) {
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
! "tried to access %s%s%smethod %s.%s%s from class %s",
! sel_method->is_abstract() ? "abstract " : "",
! sel_method->is_protected() ? "protected " : "",
! sel_method->is_private() ? "private " : "",
! sel_klass->class_loader_and_module_name(),
sel_method->name()->as_C_string(),
sel_method->signature()->as_C_string(),
! ref_klass->class_loader_and_module_name());
return;
}
}
methodHandle LinkResolver::resolve_method_statically(Bytecodes::Code code,
*** 911,925 ****
true)) {
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
! "tried to access field %s.%s from class %s",
! sel_klass->external_name(),
fd.name()->as_C_string(),
! ref_klass->external_name()
! );
return;
}
}
void LinkResolver::resolve_field_access(fieldDescriptor& fd, const constantPoolHandle& pool, int index, const methodHandle& method, Bytecodes::Code byte, TRAPS) {
--- 913,928 ----
true)) {
ResourceMark rm(THREAD);
Exceptions::fthrow(
THREAD_AND_LOCATION,
vmSymbols::java_lang_IllegalAccessError(),
! "tried to access %s%sfield %s.%s from class %s",
! fd.is_protected() ? "protected " : "",
! fd.is_private() ? "private " : "",
! sel_klass->class_loader_and_module_name(),
fd.name()->as_C_string(),
! ref_klass->class_loader_and_module_name());
return;
}
}
void LinkResolver::resolve_field_access(fieldDescriptor& fd, const constantPoolHandle& pool, int index, const methodHandle& method, Bytecodes::Code byte, TRAPS) {
< prev index next >