992 Universe::preallocated_out_of_memory_errors()->obj_at_put(i, err_h()); 993 } 994 Universe::_preallocated_out_of_memory_error_avail_count = (jint)len; 995 } 996 997 998 // Setup static method for registering finalizers 999 // The finalizer klass must be linked before looking up the method, in 1000 // case it needs to get rewritten. 1001 InstanceKlass::cast(SystemDictionary::Finalizer_klass())->link_class(CHECK_false); 1002 Method* m = InstanceKlass::cast(SystemDictionary::Finalizer_klass())->find_method( 1003 vmSymbols::register_method_name(), 1004 vmSymbols::register_method_signature()); 1005 if (m == NULL || !m->is_static()) { 1006 tty->print_cr("Unable to link/verify Finalizer.register method"); 1007 return false; // initialization failed (cannot throw exception yet) 1008 } 1009 Universe::_finalizer_register_cache->init( 1010 SystemDictionary::Finalizer_klass(), m); 1011 1012 InstanceKlass::cast(SystemDictionary::misc_Unsafe_klass())->link_class(CHECK_false); 1013 m = InstanceKlass::cast(SystemDictionary::misc_Unsafe_klass())->find_method( 1014 vmSymbols::throwIllegalAccessError_name(), 1015 vmSymbols::void_method_signature()); 1016 if (m != NULL && !m->is_static()) { 1017 // Note null is okay; this method is used in itables, and if it is null, 1018 // then AbstractMethodError is thrown instead. 1019 tty->print_cr("Unable to link/verify Unsafe.throwIllegalAccessError method"); 1020 return false; // initialization failed (cannot throw exception yet) 1021 } 1022 Universe::_throw_illegal_access_error_cache->init( 1023 SystemDictionary::misc_Unsafe_klass(), m); 1024 1025 // Setup method for registering loaded classes in class loader vector 1026 InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false); 1027 m = InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature()); 1028 if (m == NULL || m->is_static()) { 1029 tty->print_cr("Unable to link/verify ClassLoader.addClass method"); 1030 return false; // initialization failed (cannot throw exception yet) 1031 } 1032 Universe::_loader_addClass_cache->init( 1033 SystemDictionary::ClassLoader_klass(), m); 1034 1035 // Setup method for checking protection domain 1036 InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->link_class(CHECK_false); 1037 m = InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())-> 1038 find_method(vmSymbols::impliesCreateAccessControlContext_name(), 1039 vmSymbols::void_boolean_signature()); 1040 // Allow NULL which should only happen with bootstrapping. 1041 if (m != NULL) { 1042 if (m->is_static()) { 1043 // NoSuchMethodException doesn't actually work because it tries to run the | 992 Universe::preallocated_out_of_memory_errors()->obj_at_put(i, err_h()); 993 } 994 Universe::_preallocated_out_of_memory_error_avail_count = (jint)len; 995 } 996 997 998 // Setup static method for registering finalizers 999 // The finalizer klass must be linked before looking up the method, in 1000 // case it needs to get rewritten. 1001 InstanceKlass::cast(SystemDictionary::Finalizer_klass())->link_class(CHECK_false); 1002 Method* m = InstanceKlass::cast(SystemDictionary::Finalizer_klass())->find_method( 1003 vmSymbols::register_method_name(), 1004 vmSymbols::register_method_signature()); 1005 if (m == NULL || !m->is_static()) { 1006 tty->print_cr("Unable to link/verify Finalizer.register method"); 1007 return false; // initialization failed (cannot throw exception yet) 1008 } 1009 Universe::_finalizer_register_cache->init( 1010 SystemDictionary::Finalizer_klass(), m); 1011 1012 InstanceKlass::cast(SystemDictionary::internal_Unsafe_klass())->link_class(CHECK_false); 1013 m = InstanceKlass::cast(SystemDictionary::internal_Unsafe_klass())->find_method( 1014 vmSymbols::throwIllegalAccessError_name(), 1015 vmSymbols::void_method_signature()); 1016 if (m != NULL && !m->is_static()) { 1017 // Note null is okay; this method is used in itables, and if it is null, 1018 // then AbstractMethodError is thrown instead. 1019 tty->print_cr("Unable to link/verify Unsafe.throwIllegalAccessError method"); 1020 return false; // initialization failed (cannot throw exception yet) 1021 } 1022 Universe::_throw_illegal_access_error_cache->init( 1023 SystemDictionary::internal_Unsafe_klass(), m); 1024 1025 // Setup method for registering loaded classes in class loader vector 1026 InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false); 1027 m = InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature()); 1028 if (m == NULL || m->is_static()) { 1029 tty->print_cr("Unable to link/verify ClassLoader.addClass method"); 1030 return false; // initialization failed (cannot throw exception yet) 1031 } 1032 Universe::_loader_addClass_cache->init( 1033 SystemDictionary::ClassLoader_klass(), m); 1034 1035 // Setup method for checking protection domain 1036 InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())->link_class(CHECK_false); 1037 m = InstanceKlass::cast(SystemDictionary::ProtectionDomain_klass())-> 1038 find_method(vmSymbols::impliesCreateAccessControlContext_name(), 1039 vmSymbols::void_boolean_signature()); 1040 // Allow NULL which should only happen with bootstrapping. 1041 if (m != NULL) { 1042 if (m->is_static()) { 1043 // NoSuchMethodException doesn't actually work because it tries to run the |