531 #ifndef CC_INTERP 532 // Regardless of whether we entered this routine with the pending 533 // popframe condition bit set, we should always clear it now 534 thread->clear_popframe_condition(); 535 #else 536 // C++ interpreter will clear has_pending_popframe when it enters 537 // with method_resume. For deopt_resume2 we clear it now. 538 if (thread->popframe_forcing_deopt_reexecution()) 539 thread->clear_popframe_condition(); 540 #endif /* CC_INTERP */ 541 } 542 543 // unpack_frames() is called at the end of the deoptimization handler 544 // and (in C2) at the end of the uncommon trap handler. Note this fact 545 // so that an asynchronous stack walker can work again. This counter is 546 // incremented at the beginning of fetch_unroll_info() and (in C2) at 547 // the beginning of uncommon_trap(). 548 thread->dec_in_deopt_handler(); 549 } 550 551 552 // Return BasicType of value being returned 553 JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_mode)) 554 555 // We are already active int he special DeoptResourceMark any ResourceObj's we 556 // allocate will be freed at the end of the routine. 557 558 // It is actually ok to allocate handles in a leaf method. It causes no safepoints, 559 // but makes the entry a little slower. There is however a little dance we have to 560 // do in debug mode to get around the NoHandleMark code in the JRT_LEAF macro 561 ResetNoHandleMark rnhm; // No-op in release/product versions 562 HandleMark hm; 563 564 frame stub_frame = thread->last_frame(); 565 566 // Since the frame to unpack is the top frame of this thread, the vframe_array_head 567 // must point to the vframeArray for the unpack frame. 568 vframeArray* array = thread->vframe_array_head(); 569 570 #ifndef PRODUCT | 531 #ifndef CC_INTERP 532 // Regardless of whether we entered this routine with the pending 533 // popframe condition bit set, we should always clear it now 534 thread->clear_popframe_condition(); 535 #else 536 // C++ interpreter will clear has_pending_popframe when it enters 537 // with method_resume. For deopt_resume2 we clear it now. 538 if (thread->popframe_forcing_deopt_reexecution()) 539 thread->clear_popframe_condition(); 540 #endif /* CC_INTERP */ 541 } 542 543 // unpack_frames() is called at the end of the deoptimization handler 544 // and (in C2) at the end of the uncommon trap handler. Note this fact 545 // so that an asynchronous stack walker can work again. This counter is 546 // incremented at the beginning of fetch_unroll_info() and (in C2) at 547 // the beginning of uncommon_trap(). 548 thread->dec_in_deopt_handler(); 549 } 550 551 // Moved from cpu directories because none of the cpus has callee save values. 552 // If a cpu implements callee save values, move this to deoptimization_<cpu>.cpp. 553 void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { 554 555 // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in 556 // the days we had adapter frames. When we deoptimize a situation where a 557 // compiled caller calls a compiled caller will have registers it expects 558 // to survive the call to the callee. If we deoptimize the callee the only 559 // way we can restore these registers is to have the oldest interpreter 560 // frame that we create restore these values. That is what this routine 561 // will accomplish. 562 563 // At the moment we have modified c2 to not have any callee save registers 564 // so this problem does not exist and this routine is just a place holder. 565 566 assert(f->is_interpreted_frame(), "must be interpreted"); 567 } 568 569 // Return BasicType of value being returned 570 JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_mode)) 571 572 // We are already active int he special DeoptResourceMark any ResourceObj's we 573 // allocate will be freed at the end of the routine. 574 575 // It is actually ok to allocate handles in a leaf method. It causes no safepoints, 576 // but makes the entry a little slower. There is however a little dance we have to 577 // do in debug mode to get around the NoHandleMark code in the JRT_LEAF macro 578 ResetNoHandleMark rnhm; // No-op in release/product versions 579 HandleMark hm; 580 581 frame stub_frame = thread->last_frame(); 582 583 // Since the frame to unpack is the top frame of this thread, the vframe_array_head 584 // must point to the vframeArray for the unpack frame. 585 vframeArray* array = thread->vframe_array_head(); 586 587 #ifndef PRODUCT |