606 jvms->set_scloff(jvms->scloff() + delta); |
606 jvms->set_scloff(jvms->scloff() + delta); |
607 jvms->set_endoff(jvms->endoff() + delta); |
607 jvms->set_endoff(jvms->endoff() + delta); |
608 } |
608 } |
609 } |
609 } |
610 |
610 |
|
611 // Mirror the stack size calculation in the deopt code |
|
612 // How much stack space would we need at this point in the program in |
|
613 // case of deoptimization? |
|
614 int JVMState::interpreter_frame_size() const { |
|
615 const JVMState* jvms = this; |
|
616 int size = 0; |
|
617 int callee_parameters = 0; |
|
618 int callee_locals = 0; |
|
619 int extra_args = method()->max_stack() - stk_size(); |
|
620 |
|
621 while (jvms != NULL) { |
|
622 int locks = jvms->nof_monitors(); |
|
623 int temps = jvms->stk_size(); |
|
624 bool is_top_frame = (jvms == this); |
|
625 ciMethod* method = jvms->method(); |
|
626 |
|
627 int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(), |
|
628 temps + callee_parameters, |
|
629 extra_args, |
|
630 locks, |
|
631 callee_parameters, |
|
632 callee_locals, |
|
633 is_top_frame); |
|
634 size += frame_size; |
|
635 |
|
636 callee_parameters = method->size_of_parameters(); |
|
637 callee_locals = method->max_locals(); |
|
638 extra_args = 0; |
|
639 jvms = jvms->caller(); |
|
640 } |
|
641 return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord; |
|
642 } |
|
643 |
611 //============================================================================= |
644 //============================================================================= |
612 uint CallNode::cmp( const Node &n ) const |
645 uint CallNode::cmp( const Node &n ) const |
613 { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; } |
646 { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; } |
614 #ifndef PRODUCT |
647 #ifndef PRODUCT |
615 void CallNode::dump_req(outputStream *st) const { |
648 void CallNode::dump_req(outputStream *st) const { |