< prev index next >
src/share/vm/classfile/classFileParser.cpp
Print this page
*** 5400,5409 ****
--- 5400,5419 ----
set_klass(ik);
debug_only(ik->verify();)
}
+ static bool relax_format_check_for(oop loader, bool boot_loader) {
+ bool trusted = boot_loader || SystemDictionary::is_platform_class_loader(loader);
+ bool need_verify =
+ // verifyAll
+ (BytecodeVerificationLocal && BytecodeVerificationRemote) ||
+ // verifyRemote
+ (!BytecodeVerificationLocal && BytecodeVerificationRemote && !trusted);
+ return !need_verify;
+ }
+
ClassFileParser::ClassFileParser(ClassFileStream* stream,
Symbol* name,
ClassLoaderData* loader_data,
Handle protection_domain,
const Klass* host_klass,
*** 5488,5498 ****
// synch back verification state to stream
stream->set_verify(_need_verify);
// Check if verification needs to be relaxed for this class file
// Do not restrict it to jdk1.0 or jdk1.1 to maintain backward compatibility (4982376)
! _relax_verify = Verifier::relax_verify_for(_loader_data->class_loader());
parse_stream(stream, CHECK);
post_process_parsed_stream(stream, _cp, CHECK);
}
--- 5498,5509 ----
// synch back verification state to stream
stream->set_verify(_need_verify);
// Check if verification needs to be relaxed for this class file
// Do not restrict it to jdk1.0 or jdk1.1 to maintain backward compatibility (4982376)
! _relax_verify = relax_format_check_for(_loader_data->class_loader(),
! _loader_data->is_the_null_class_loader_data());
parse_stream(stream, CHECK);
post_process_parsed_stream(stream, _cp, CHECK);
}
< prev index next >