< prev index next >

src/share/vm/memory/universe.cpp

Print this page

        

*** 482,494 **** int list_length = list->length(); for (int i = 0; i < list_length; i++) { Klass* k = list->at(i); assert(k->is_klass(), "List should only hold classes"); EXCEPTION_MARK; ! KlassHandle kh(THREAD, k); ! java_lang_Class::fixup_mirror(kh, CATCH); ! } delete java_lang_Class::fixup_mirror_list(); java_lang_Class::set_fixup_mirror_list(NULL); } #define assert_pll_locked(test) \ --- 482,493 ---- int list_length = list->length(); for (int i = 0; i < list_length; i++) { Klass* k = list->at(i); assert(k->is_klass(), "List should only hold classes"); EXCEPTION_MARK; ! java_lang_Class::fixup_mirror(k, CATCH); ! } delete java_lang_Class::fixup_mirror_list(); java_lang_Class::set_fixup_mirror_list(NULL); } #define assert_pll_locked(test) \
*** 528,538 **** // Called on VM exit. This ought to be run in a separate thread. log_trace(ref)("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; ! KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); JavaValue result(T_VOID); JavaCalls::call_static( &result, finalizer_klass, vmSymbols::run_finalizers_on_exit_name(), --- 527,537 ---- // Called on VM exit. This ought to be run in a separate thread. log_trace(ref)("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; ! Klass* finalizer_klass = SystemDictionary::Finalizer_klass(); JavaValue result(T_VOID); JavaCalls::call_static( &result, finalizer_klass, vmSymbols::run_finalizers_on_exit_name(),
*** 547,566 **** // initialize_vtable could cause gc if // 1) we specified true to initialize_vtable and // 2) this ran after gc was enabled // In case those ever change we use handles for oops ! void Universe::reinitialize_vtable_of(KlassHandle k_h, TRAPS) { // init vtable of k and all subclasses - Klass* ko = k_h(); klassVtable* vt = ko->vtable(); if (vt) vt->initialize_vtable(false, CHECK); if (ko->is_instance_klass()) { ! for (KlassHandle s_h(THREAD, ko->subklass()); ! s_h() != NULL; ! s_h = KlassHandle(THREAD, s_h()->next_sibling())) { ! reinitialize_vtable_of(s_h, CHECK); } } } --- 546,564 ---- // initialize_vtable could cause gc if // 1) we specified true to initialize_vtable and // 2) this ran after gc was enabled // In case those ever change we use handles for oops ! void Universe::reinitialize_vtable_of(Klass* ko, TRAPS) { // init vtable of k and all subclasses klassVtable* vt = ko->vtable(); if (vt) vt->initialize_vtable(false, CHECK); if (ko->is_instance_klass()) { ! for (Klass* sk = ko->subklass(); ! sk != NULL; ! sk = sk->next_sibling()) { ! reinitialize_vtable_of(sk, CHECK); } } }
*** 986,1017 **** EXCEPTION_MARK; { ResourceMark rm; Interpreter::initialize(); // needed for interpreter entry points if (!UseSharedSpaces) { HandleMark hm(THREAD); ! KlassHandle ok_h(THREAD, SystemDictionary::Object_klass()); ! Universe::reinitialize_vtable_of(ok_h, CHECK_false); Universe::reinitialize_itables(CHECK_false); } } HandleMark hm(THREAD); - Klass* k; - instanceKlassHandle k_h; // Setup preallocated empty java.lang.Class array Universe::_the_empty_class_klass_array = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_false); // Setup preallocated OutOfMemoryError errors ! k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_OutOfMemoryError(), true, CHECK_false); ! k_h = instanceKlassHandle(THREAD, k); ! Universe::_out_of_memory_error_java_heap = k_h->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_metaspace = k_h->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_class_metaspace = k_h->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_array_size = k_h->allocate_instance(CHECK_false); Universe::_out_of_memory_error_gc_overhead_limit = ! k_h->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_realloc_objects = k_h->allocate_instance(CHECK_false); // Setup preallocated cause message for delayed StackOverflowError if (StackReservedPages > 0) { Universe::_delayed_stack_overflow_error_message = java_lang_String::create_oop_from_str("Delayed StackOverflowError due to ReservedStackAccess annotated method", CHECK_false); --- 984,1013 ---- EXCEPTION_MARK; { ResourceMark rm; Interpreter::initialize(); // needed for interpreter entry points if (!UseSharedSpaces) { HandleMark hm(THREAD); ! Klass* ok = SystemDictionary::Object_klass(); ! Universe::reinitialize_vtable_of(ok, CHECK_false); Universe::reinitialize_itables(CHECK_false); } } HandleMark hm(THREAD); // Setup preallocated empty java.lang.Class array Universe::_the_empty_class_klass_array = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_false); // Setup preallocated OutOfMemoryError errors ! Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_OutOfMemoryError(), true, CHECK_false); ! InstanceKlass* ik = InstanceKlass::cast(k); ! Universe::_out_of_memory_error_java_heap = ik->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_metaspace = ik->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_class_metaspace = ik->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_array_size = ik->allocate_instance(CHECK_false); Universe::_out_of_memory_error_gc_overhead_limit = ! ik->allocate_instance(CHECK_false); ! Universe::_out_of_memory_error_realloc_objects = ik->allocate_instance(CHECK_false); // Setup preallocated cause message for delayed StackOverflowError if (StackReservedPages > 0) { Universe::_delayed_stack_overflow_error_message = java_lang_String::create_oop_from_str("Delayed StackOverflowError due to ReservedStackAccess annotated method", CHECK_false);
*** 1062,1077 **** java_lang_Throwable::set_message(Universe::_arithmetic_exception_instance, msg()); // Setup the array of errors that have preallocated backtrace k = Universe::_out_of_memory_error_java_heap->klass(); assert(k->name() == vmSymbols::java_lang_OutOfMemoryError(), "should be out of memory error"); ! k_h = instanceKlassHandle(THREAD, k); int len = (StackTraceInThrowable) ? (int)PreallocatedOutOfMemoryErrorCount : 0; ! Universe::_preallocated_out_of_memory_error_array = oopFactory::new_objArray(k_h(), len, CHECK_false); for (int i=0; i<len; i++) { ! oop err = k_h->allocate_instance(CHECK_false); Handle err_h = Handle(THREAD, err); java_lang_Throwable::allocate_backtrace(err_h, CHECK_false); Universe::preallocated_out_of_memory_errors()->obj_at_put(i, err_h()); } Universe::_preallocated_out_of_memory_error_avail_count = (jint)len; --- 1058,1073 ---- java_lang_Throwable::set_message(Universe::_arithmetic_exception_instance, msg()); // Setup the array of errors that have preallocated backtrace k = Universe::_out_of_memory_error_java_heap->klass(); assert(k->name() == vmSymbols::java_lang_OutOfMemoryError(), "should be out of memory error"); ! ik = InstanceKlass::cast(k); int len = (StackTraceInThrowable) ? (int)PreallocatedOutOfMemoryErrorCount : 0; ! Universe::_preallocated_out_of_memory_error_array = oopFactory::new_objArray(ik, len, CHECK_false); for (int i=0; i<len; i++) { ! oop err = ik->allocate_instance(CHECK_false); Handle err_h = Handle(THREAD, err); java_lang_Throwable::allocate_backtrace(err_h, CHECK_false); Universe::preallocated_out_of_memory_errors()->obj_at_put(i, err_h()); } Universe::_preallocated_out_of_memory_error_avail_count = (jint)len;
< prev index next >