mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8001330: Improve on checking order
Reviewed-by: acorn, hawtin
This commit is contained in:
parent
455fd39d49
commit
6ebc920e1e
6 changed files with 137 additions and 8 deletions
|
@ -108,6 +108,7 @@ oop Universe::_the_null_string = NULL;
|
|||
oop Universe::_the_min_jint_string = NULL;
|
||||
LatestMethodOopCache* Universe::_finalizer_register_cache = NULL;
|
||||
LatestMethodOopCache* Universe::_loader_addClass_cache = NULL;
|
||||
LatestMethodOopCache* Universe::_pd_implies_cache = NULL;
|
||||
ActiveMethodOopsCache* Universe::_reflect_invoke_cache = NULL;
|
||||
oop Universe::_out_of_memory_error_java_heap = NULL;
|
||||
oop Universe::_out_of_memory_error_perm_gen = NULL;
|
||||
|
@ -224,6 +225,7 @@ void Universe::serialize(SerializeClosure* f, bool do_all) {
|
|||
_finalizer_register_cache->serialize(f);
|
||||
_loader_addClass_cache->serialize(f);
|
||||
_reflect_invoke_cache->serialize(f);
|
||||
_pd_implies_cache->serialize(f);
|
||||
}
|
||||
|
||||
void Universe::check_alignment(uintx size, uintx alignment, const char* name) {
|
||||
|
@ -648,6 +650,7 @@ jint universe_init() {
|
|||
// Metaspace::initialize_shared_spaces() tries to populate them.
|
||||
Universe::_finalizer_register_cache = new LatestMethodOopCache();
|
||||
Universe::_loader_addClass_cache = new LatestMethodOopCache();
|
||||
Universe::_pd_implies_cache = new LatestMethodOopCache();
|
||||
Universe::_reflect_invoke_cache = new ActiveMethodOopsCache();
|
||||
|
||||
if (UseSharedSpaces) {
|
||||
|
@ -1082,6 +1085,23 @@ bool universe_post_init() {
|
|||
Universe::_loader_addClass_cache->init(
|
||||
SystemDictionary::ClassLoader_klass(), m, CHECK_false);
|
||||
|
||||
// Setup method for checking protection domain
|
||||
InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->link_class(CHECK_false);
|
||||
m = InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->
|
||||
find_method(vmSymbols::impliesCreateAccessControlContext_name(),
|
||||
vmSymbols::void_boolean_signature());
|
||||
// Allow NULL which should only happen with bootstrapping.
|
||||
if (m != NULL) {
|
||||
if (m->is_static()) {
|
||||
// NoSuchMethodException doesn't actually work because it tries to run the
|
||||
// <init> function before java_lang_Class is linked. Print error and exit.
|
||||
tty->print_cr("ProtectionDomain.impliesCreateAccessControlContext() has the wrong linkage");
|
||||
return false; // initialization failed
|
||||
}
|
||||
Universe::_pd_implies_cache->init(
|
||||
SystemDictionary::ProtectionDomain_klass(), m, CHECK_false);;
|
||||
}
|
||||
|
||||
// The folowing is initializing converter functions for serialization in
|
||||
// JVM.cpp. If we clean up the StrictMath code above we may want to find
|
||||
// a better solution for this as well.
|
||||
|
@ -1497,6 +1517,7 @@ bool ActiveMethodOopsCache::is_same_method(Method* const method) const {
|
|||
|
||||
|
||||
Method* LatestMethodOopCache::get_Method() {
|
||||
if (klass() == NULL) return NULL;
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass());
|
||||
Method* m = ik->method_with_idnum(method_idnum());
|
||||
assert(m != NULL, "sanity check");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue