1.1 --- a/src/share/vm/opto/callnode.cpp Mon Jun 09 15:42:31 2014 -0700 1.2 +++ b/src/share/vm/opto/callnode.cpp Tue Apr 01 09:36:49 2014 +0200 1.3 @@ -607,6 +607,39 @@ 1.4 } 1.5 } 1.6 1.7 +// Mirror the stack size calculation in the deopt code 1.8 +// How much stack space would we need at this point in the program in 1.9 +// case of deoptimization? 1.10 +int JVMState::interpreter_frame_size() const { 1.11 + const JVMState* jvms = this; 1.12 + int size = 0; 1.13 + int callee_parameters = 0; 1.14 + int callee_locals = 0; 1.15 + int extra_args = method()->max_stack() - stk_size(); 1.16 + 1.17 + while (jvms != NULL) { 1.18 + int locks = jvms->nof_monitors(); 1.19 + int temps = jvms->stk_size(); 1.20 + bool is_top_frame = (jvms == this); 1.21 + ciMethod* method = jvms->method(); 1.22 + 1.23 + int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(), 1.24 + temps + callee_parameters, 1.25 + extra_args, 1.26 + locks, 1.27 + callee_parameters, 1.28 + callee_locals, 1.29 + is_top_frame); 1.30 + size += frame_size; 1.31 + 1.32 + callee_parameters = method->size_of_parameters(); 1.33 + callee_locals = method->max_locals(); 1.34 + extra_args = 0; 1.35 + jvms = jvms->caller(); 1.36 + } 1.37 + return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord; 1.38 +} 1.39 + 1.40 //============================================================================= 1.41 uint CallNode::cmp( const Node &n ) const 1.42 { return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; }