10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "ci/ciMethod.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "runtime/frame.inline.hpp" 29 30 #ifndef CC_INTERP 31 32 // asm based interpreter deoptimization helpers 33 int AbstractInterpreter::size_activation(int max_stack, 34 int temps, 35 int extra_args, 36 int monitors, 37 int callee_params, 38 int callee_locals, 39 bool is_top_frame) { 40 // Note: This calculation must exactly parallel the frame setup 41 // in InterpreterGenerator::generate_fixed_frame. 42 43 // fixed size of an interpreter frame: 44 int overhead = frame::sender_sp_offset - 45 frame::interpreter_frame_initial_sp_offset; 46 // Our locals were accounted for by the caller (or last_frame_adjust 47 // on the transistion) Since the callee parameters already account 48 // for the callee's params we only need to account for the extra 49 // locals. 50 int size = overhead + 51 (callee_locals - callee_params)*Interpreter::stackElementWords + 52 monitors * frame::interpreter_frame_monitor_size() + 53 temps* Interpreter::stackElementWords + extra_args; 54 55 return size; 56 } 57 58 void AbstractInterpreter::layout_activation(Method* method, 59 int tempcount, 60 int popframe_extra_args, 61 int moncount, 181 // How much stack a method activation needs in words. 182 int AbstractInterpreter::size_top_interpreter_activation(Method* method) { 183 const int entry_size = frame::interpreter_frame_monitor_size(); 184 185 // total overhead size: entry_size + (saved rbp thru expr stack 186 // bottom). be sure to change this if you add/subtract anything 187 // to/from the overhead area 188 const int overhead_size = 189 -(frame::interpreter_frame_initial_sp_offset) + entry_size; 190 191 #ifndef _LP64 192 const int stub_code = 4; // see generate_call_stub 193 #else 194 const int stub_code = frame::entry_frame_after_call_words; 195 #endif 196 197 const int method_stack = (method->max_locals() + method->max_stack()) * 198 Interpreter::stackElementWords; 199 return (overhead_size + method_stack + stub_code); 200 } 201 202 #endif // CC_INTERP | 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "ci/ciMethod.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "runtime/frame.inline.hpp" 29 30 // Size of interpreter code. Increase if too small. Interpreter will 31 // fail with a guarantee ("not enough space for interpreter generation"); 32 // if too small. 33 // Run with +PrintInterpreter to get the VM to print out the size. 34 // Max size with JVMTI 35 #ifdef AMD64 36 int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; 37 #else 38 int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; 39 #endif // AMD64 40 41 // asm based interpreter deoptimization helpers 42 int AbstractInterpreter::size_activation(int max_stack, 43 int temps, 44 int extra_args, 45 int monitors, 46 int callee_params, 47 int callee_locals, 48 bool is_top_frame) { 49 // Note: This calculation must exactly parallel the frame setup 50 // in TemplateInterpreterGenerator::generate_fixed_frame. 51 52 // fixed size of an interpreter frame: 53 int overhead = frame::sender_sp_offset - 54 frame::interpreter_frame_initial_sp_offset; 55 // Our locals were accounted for by the caller (or last_frame_adjust 56 // on the transistion) Since the callee parameters already account 57 // for the callee's params we only need to account for the extra 58 // locals. 59 int size = overhead + 60 (callee_locals - callee_params)*Interpreter::stackElementWords + 61 monitors * frame::interpreter_frame_monitor_size() + 62 temps* Interpreter::stackElementWords + extra_args; 63 64 return size; 65 } 66 67 void AbstractInterpreter::layout_activation(Method* method, 68 int tempcount, 69 int popframe_extra_args, 70 int moncount, 190 // How much stack a method activation needs in words. 191 int AbstractInterpreter::size_top_interpreter_activation(Method* method) { 192 const int entry_size = frame::interpreter_frame_monitor_size(); 193 194 // total overhead size: entry_size + (saved rbp thru expr stack 195 // bottom). be sure to change this if you add/subtract anything 196 // to/from the overhead area 197 const int overhead_size = 198 -(frame::interpreter_frame_initial_sp_offset) + entry_size; 199 200 #ifndef _LP64 201 const int stub_code = 4; // see generate_call_stub 202 #else 203 const int stub_code = frame::entry_frame_after_call_words; 204 #endif 205 206 const int method_stack = (method->max_locals() + method->max_stack()) * 207 Interpreter::stackElementWords; 208 return (overhead_size + method_stack + stub_code); 209 } |