comparison src/share/vm/memory/universe.cpp @ 5699:9d15b81d5d1b

8016839: JSR292: AME instead of IAE when calling a method Summary: Catch missing-because-illegal case for itable entries and use an exception-throwing method instead of null. Reviewed-by: acorn, jrose, coleenp
author drchase
date Tue, 26 Nov 2013 18:16:04 -0500
parents 610be0309a79
children
comparison
equal deleted inserted replaced
98:2faeadc15a2a 99:d08d698edd8a
118 bool Universe::_verify_in_progress = false; 118 bool Universe::_verify_in_progress = false;
119 oop Universe::_null_ptr_exception_instance = NULL; 119 oop Universe::_null_ptr_exception_instance = NULL;
120 oop Universe::_arithmetic_exception_instance = NULL; 120 oop Universe::_arithmetic_exception_instance = NULL;
121 oop Universe::_virtual_machine_error_instance = NULL; 121 oop Universe::_virtual_machine_error_instance = NULL;
122 oop Universe::_vm_exception = NULL; 122 oop Universe::_vm_exception = NULL;
123 Method* Universe::_throw_illegal_access_error = NULL;
123 Array<int>* Universe::_the_empty_int_array = NULL; 124 Array<int>* Universe::_the_empty_int_array = NULL;
124 Array<u2>* Universe::_the_empty_short_array = NULL; 125 Array<u2>* Universe::_the_empty_short_array = NULL;
125 Array<Klass*>* Universe::_the_empty_klass_array = NULL; 126 Array<Klass*>* Universe::_the_empty_klass_array = NULL;
126 Array<Method*>* Universe::_the_empty_method_array = NULL; 127 Array<Method*>* Universe::_the_empty_method_array = NULL;
127 128
1094 return false; // initialization failed (cannot throw exception yet) 1095 return false; // initialization failed (cannot throw exception yet)
1095 } 1096 }
1096 Universe::_finalizer_register_cache->init( 1097 Universe::_finalizer_register_cache->init(
1097 SystemDictionary::Finalizer_klass(), m); 1098 SystemDictionary::Finalizer_klass(), m);
1098 1099
1100 InstanceKlass::cast(SystemDictionary::misc_Unsafe_klass())->link_class(CHECK_false);
1101 m = InstanceKlass::cast(SystemDictionary::misc_Unsafe_klass())->find_method(
1102 vmSymbols::throwIllegalAccessError_name(),
1103 vmSymbols::void_method_signature());
1104 if (m != NULL && !m->is_static()) {
1105 // Note null is okay; this method is used in itables, and if it is null,
1106 // then AbstractMethodError is thrown instead.
1107 tty->print_cr("Unable to link/verify Unsafe.throwIllegalAccessError method");
1108 return false; // initialization failed (cannot throw exception yet)
1109 }
1110 Universe::_throw_illegal_access_error = m;
1111
1099 // Setup method for registering loaded classes in class loader vector 1112 // Setup method for registering loaded classes in class loader vector
1100 InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false); 1113 InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false);
1101 m = InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature()); 1114 m = InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature());
1102 if (m == NULL || m->is_static()) { 1115 if (m == NULL || m->is_static()) {
1103 tty->print_cr("Unable to link/verify ClassLoader.addClass method"); 1116 tty->print_cr("Unable to link/verify ClassLoader.addClass method");