src/cpu/x86/vm/templateInterpreter_x86_64.cpp

Print this page
rev 4376 : 8010460: Interpreter on some platforms loads ConstMethod::_max_stack and misses extra stack slots for JSR 292
Summary: ConstMethod::max_stack() doesn't account for JSR 292 appendix.
Reviewed-by:


1567     case Interpreter::java_lang_math_sqrt    : // fall thru
1568     case Interpreter::java_lang_math_pow     : // fall thru
1569     case Interpreter::java_lang_math_exp     :
1570       return false;
1571     default:
1572       return true;
1573   }
1574 }
1575 
1576 // How much stack a method activation needs in words.
1577 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
1578   const int entry_size = frame::interpreter_frame_monitor_size();
1579 
1580   // total overhead size: entry_size + (saved rbp thru expr stack
1581   // bottom).  be sure to change this if you add/subtract anything
1582   // to/from the overhead area
1583   const int overhead_size =
1584     -(frame::interpreter_frame_initial_sp_offset) + entry_size;
1585 
1586   const int stub_code = frame::entry_frame_after_call_words;
1587   const int extra_stack = Method::extra_stack_entries();
1588   const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
1589                            Interpreter::stackElementWords;
1590   return (overhead_size + method_stack + stub_code);
1591 }
1592 
1593 int AbstractInterpreter::layout_activation(Method* method,
1594                                            int tempcount,
1595                                            int popframe_extra_args,
1596                                            int moncount,
1597                                            int caller_actual_parameters,
1598                                            int callee_param_count,
1599                                            int callee_locals,
1600                                            frame* caller,
1601                                            frame* interpreter_frame,
1602                                            bool is_top_frame,
1603                                            bool is_bottom_frame) {
1604   // Note: This calculation must exactly parallel the frame setup
1605   // in AbstractInterpreterGenerator::generate_method_entry.
1606   // If interpreter_frame!=NULL, set up the method, locals, and monitors.
1607   // The frame interpreter_frame, if not NULL, is guaranteed to be the
1608   // right size, as determined by a previous call to this method.




1567     case Interpreter::java_lang_math_sqrt    : // fall thru
1568     case Interpreter::java_lang_math_pow     : // fall thru
1569     case Interpreter::java_lang_math_exp     :
1570       return false;
1571     default:
1572       return true;
1573   }
1574 }
1575 
1576 // How much stack a method activation needs in words.
1577 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
1578   const int entry_size = frame::interpreter_frame_monitor_size();
1579 
1580   // total overhead size: entry_size + (saved rbp thru expr stack
1581   // bottom).  be sure to change this if you add/subtract anything
1582   // to/from the overhead area
1583   const int overhead_size =
1584     -(frame::interpreter_frame_initial_sp_offset) + entry_size;
1585 
1586   const int stub_code = frame::entry_frame_after_call_words;
1587   const int method_stack = (method->max_locals() + method->max_stack()) *

1588                            Interpreter::stackElementWords;
1589   return (overhead_size + method_stack + stub_code);
1590 }
1591 
1592 int AbstractInterpreter::layout_activation(Method* method,
1593                                            int tempcount,
1594                                            int popframe_extra_args,
1595                                            int moncount,
1596                                            int caller_actual_parameters,
1597                                            int callee_param_count,
1598                                            int callee_locals,
1599                                            frame* caller,
1600                                            frame* interpreter_frame,
1601                                            bool is_top_frame,
1602                                            bool is_bottom_frame) {
1603   // Note: This calculation must exactly parallel the frame setup
1604   // in AbstractInterpreterGenerator::generate_method_entry.
1605   // If interpreter_frame!=NULL, set up the method, locals, and monitors.
1606   // The frame interpreter_frame, if not NULL, is guaranteed to be the
1607   // right size, as determined by a previous call to this method.