src/cpu/x86/vm/templateInterpreter_x86_32.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:


1551     case Interpreter::java_lang_math_exp     :
1552       return false;
1553     default:
1554       return true;
1555   }
1556 }
1557 
1558 // How much stack a method activation needs in words.
1559 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
1560 
1561   const int stub_code = 4;  // see generate_call_stub
1562   // Save space for one monitor to get into the interpreted method in case
1563   // the method is synchronized
1564   int monitor_size    = method->is_synchronized() ?
1565                                 1*frame::interpreter_frame_monitor_size() : 0;
1566 
1567   // total overhead size: entry_size + (saved rbp, thru expr stack bottom).
1568   // be sure to change this if you add/subtract anything to/from the overhead area
1569   const int overhead_size = -frame::interpreter_frame_initial_sp_offset;
1570 
1571   const int extra_stack = Method::extra_stack_entries();
1572   const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
1573                            Interpreter::stackElementWords;
1574   return overhead_size + method_stack + stub_code;
1575 }
1576 
1577 // asm based interpreter deoptimization helpers
1578 
1579 int AbstractInterpreter::layout_activation(Method* method,
1580                                            int tempcount,
1581                                            int popframe_extra_args,
1582                                            int moncount,
1583                                            int caller_actual_parameters,
1584                                            int callee_param_count,
1585                                            int callee_locals,
1586                                            frame* caller,
1587                                            frame* interpreter_frame,
1588                                            bool is_top_frame,
1589                                            bool is_bottom_frame) {
1590   // Note: This calculation must exactly parallel the frame setup
1591   // in AbstractInterpreterGenerator::generate_method_entry.
1592   // If interpreter_frame!=NULL, set up the method, locals, and monitors.




1551     case Interpreter::java_lang_math_exp     :
1552       return false;
1553     default:
1554       return true;
1555   }
1556 }
1557 
1558 // How much stack a method activation needs in words.
1559 int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
1560 
1561   const int stub_code = 4;  // see generate_call_stub
1562   // Save space for one monitor to get into the interpreted method in case
1563   // the method is synchronized
1564   int monitor_size    = method->is_synchronized() ?
1565                                 1*frame::interpreter_frame_monitor_size() : 0;
1566 
1567   // total overhead size: entry_size + (saved rbp, thru expr stack bottom).
1568   // be sure to change this if you add/subtract anything to/from the overhead area
1569   const int overhead_size = -frame::interpreter_frame_initial_sp_offset;
1570 
1571   const int method_stack = (method->max_locals() + method->max_stack()) *

1572                            Interpreter::stackElementWords;
1573   return overhead_size + method_stack + stub_code;
1574 }
1575 
1576 // asm based interpreter deoptimization helpers
1577 
1578 int AbstractInterpreter::layout_activation(Method* method,
1579                                            int tempcount,
1580                                            int popframe_extra_args,
1581                                            int moncount,
1582                                            int caller_actual_parameters,
1583                                            int callee_param_count,
1584                                            int callee_locals,
1585                                            frame* caller,
1586                                            frame* interpreter_frame,
1587                                            bool is_top_frame,
1588                                            bool is_bottom_frame) {
1589   // Note: This calculation must exactly parallel the frame setup
1590   // in AbstractInterpreterGenerator::generate_method_entry.
1591   // If interpreter_frame!=NULL, set up the method, locals, and monitors.