comparison src/share/vm/runtime/deoptimization.cpp @ 6911:d2582a08fa5d

Merge
author asaha
date Thu, 18 Oct 2012 21:58:55 -0700
parents d804e148cff8
children 18fb7da42534
comparison
equal deleted inserted replaced
6910:6ba00f89fbe1 6911:d2582a08fa5d
231 oop result = deoptee.saved_oop_result(&map); 231 oop result = deoptee.saved_oop_result(&map);
232 assert(result == NULL || result->is_oop(), "must be oop"); 232 assert(result == NULL || result->is_oop(), "must be oop");
233 return_value = Handle(thread, result); 233 return_value = Handle(thread, result);
234 assert(Universe::heap()->is_in_or_null(result), "must be heap pointer"); 234 assert(Universe::heap()->is_in_or_null(result), "must be heap pointer");
235 if (TraceDeoptimization) { 235 if (TraceDeoptimization) {
236 ttyLocker ttyl;
236 tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, result, thread); 237 tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, result, thread);
237 } 238 }
238 } 239 }
239 bool reallocated = false; 240 bool reallocated = false;
240 if (objects != NULL) { 241 if (objects != NULL) {
491 // correct (initial fp value, unextended sp, ...) 492 // correct (initial fp value, unextended sp, ...)
492 info->set_initial_info((intptr_t) array->sender().initial_deoptimization_info()); 493 info->set_initial_info((intptr_t) array->sender().initial_deoptimization_info());
493 494
494 if (array->frames() > 1) { 495 if (array->frames() > 1) {
495 if (VerifyStack && TraceDeoptimization) { 496 if (VerifyStack && TraceDeoptimization) {
497 ttyLocker ttyl;
496 tty->print_cr("Deoptimizing method containing inlining"); 498 tty->print_cr("Deoptimizing method containing inlining");
497 } 499 }
498 } 500 }
499 501
500 array->set_unroll_block(info); 502 array->set_unroll_block(info);
571 // must point to the vframeArray for the unpack frame. 573 // must point to the vframeArray for the unpack frame.
572 vframeArray* array = thread->vframe_array_head(); 574 vframeArray* array = thread->vframe_array_head();
573 575
574 #ifndef PRODUCT 576 #ifndef PRODUCT
575 if (TraceDeoptimization) { 577 if (TraceDeoptimization) {
578 ttyLocker ttyl;
576 tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d", thread, array, exec_mode); 579 tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d", thread, array, exec_mode);
577 } 580 }
578 #endif 581 #endif
579 Events::log(thread, "DEOPT UNPACKING pc=" INTPTR_FORMAT " sp=" INTPTR_FORMAT " mode %d", 582 Events::log(thread, "DEOPT UNPACKING pc=" INTPTR_FORMAT " sp=" INTPTR_FORMAT " mode %d",
580 stub_frame.pc(), stub_frame.sp(), exec_mode); 583 stub_frame.pc(), stub_frame.sp(), exec_mode);
753 756
754 if (k->oop_is_instance()) { 757 if (k->oop_is_instance()) {
755 InstanceKlass* ik = InstanceKlass::cast(k()); 758 InstanceKlass* ik = InstanceKlass::cast(k());
756 obj = ik->allocate_instance(CHECK_(false)); 759 obj = ik->allocate_instance(CHECK_(false));
757 } else if (k->oop_is_typeArray()) { 760 } else if (k->oop_is_typeArray()) {
758 typeArrayKlass* ak = typeArrayKlass::cast(k()); 761 TypeArrayKlass* ak = TypeArrayKlass::cast(k());
759 assert(sv->field_size() % type2size[ak->element_type()] == 0, "non-integral array length"); 762 assert(sv->field_size() % type2size[ak->element_type()] == 0, "non-integral array length");
760 int len = sv->field_size() / type2size[ak->element_type()]; 763 int len = sv->field_size() / type2size[ak->element_type()];
761 obj = ak->allocate(len, CHECK_(false)); 764 obj = ak->allocate(len, CHECK_(false));
762 } else if (k->oop_is_objArray()) { 765 } else if (k->oop_is_objArray()) {
763 objArrayKlass* ak = objArrayKlass::cast(k()); 766 ObjArrayKlass* ak = ObjArrayKlass::cast(k());
764 obj = ak->allocate(sv->field_size(), CHECK_(false)); 767 obj = ak->allocate(sv->field_size(), CHECK_(false));
765 } 768 }
766 769
767 assert(obj != NULL, "allocation failed"); 770 assert(obj != NULL, "allocation failed");
768 assert(sv->value().is_null(), "redundant reallocation"); 771 assert(sv->value().is_null(), "redundant reallocation");
921 if (k->oop_is_instance()) { 924 if (k->oop_is_instance()) {
922 InstanceKlass* ik = InstanceKlass::cast(k()); 925 InstanceKlass* ik = InstanceKlass::cast(k());
923 FieldReassigner reassign(fr, reg_map, sv, obj()); 926 FieldReassigner reassign(fr, reg_map, sv, obj());
924 ik->do_nonstatic_fields(&reassign); 927 ik->do_nonstatic_fields(&reassign);
925 } else if (k->oop_is_typeArray()) { 928 } else if (k->oop_is_typeArray()) {
926 typeArrayKlass* ak = typeArrayKlass::cast(k()); 929 TypeArrayKlass* ak = TypeArrayKlass::cast(k());
927 reassign_type_array_elements(fr, reg_map, sv, (typeArrayOop) obj(), ak->element_type()); 930 reassign_type_array_elements(fr, reg_map, sv, (typeArrayOop) obj(), ak->element_type());
928 } else if (k->oop_is_objArray()) { 931 } else if (k->oop_is_objArray()) {
929 reassign_object_array_elements(fr, reg_map, sv, (objArrayOop) obj()); 932 reassign_object_array_elements(fr, reg_map, sv, (objArrayOop) obj());
930 } 933 }
931 } 934 }
1320 xtty->end_head(); 1323 xtty->end_head();
1321 } 1324 }
1322 if (TraceDeoptimization) { // make noise on the tty 1325 if (TraceDeoptimization) { // make noise on the tty
1323 tty->print("Uncommon trap occurred in"); 1326 tty->print("Uncommon trap occurred in");
1324 nm->method()->print_short_name(tty); 1327 nm->method()->print_short_name(tty);
1325 tty->print(" (@" INTPTR_FORMAT ") thread=%d reason=%s action=%s unloaded_class_index=%d", 1328 tty->print(" (@" INTPTR_FORMAT ") thread=" UINTX_FORMAT " reason=%s action=%s unloaded_class_index=%d",
1326 fr.pc(), 1329 fr.pc(),
1327 (int) os::current_thread_id(), 1330 os::current_thread_id(),
1328 trap_reason_name(reason), 1331 trap_reason_name(reason),
1329 trap_action_name(action), 1332 trap_action_name(action),
1330 unloaded_class_index); 1333 unloaded_class_index);
1331 if (class_name != NULL) { 1334 if (class_name != NULL) {
1332 tty->print(unresolved ? " unresolved class: " : " symbol: "); 1335 tty->print(unresolved ? " unresolved class: " : " symbol: ");