1 /*
2 * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
1439 case Interpreter::method_handle : entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();break;
1440
1441 case Interpreter::java_lang_math_sin : // fall thru
1442 case Interpreter::java_lang_math_cos : // fall thru
1443 case Interpreter::java_lang_math_tan : // fall thru
1444 case Interpreter::java_lang_math_abs : // fall thru
1445 case Interpreter::java_lang_math_log : // fall thru
1446 case Interpreter::java_lang_math_log10 : // fall thru
1447 case Interpreter::java_lang_math_sqrt : entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind); break;
1448 default : ShouldNotReachHere(); break;
1449 }
1450
1451 if (entry_point) {
1452 return entry_point;
1453 }
1454
1455 return ((InterpreterGenerator*) this)->
1456 generate_normal_entry(synchronized);
1457 }
1458
1459 // How much stack a method activation needs in words.
1460 int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
1461 const int entry_size = frame::interpreter_frame_monitor_size();
1462
1463 // total overhead size: entry_size + (saved rbp thru expr stack
1464 // bottom). be sure to change this if you add/subtract anything
1465 // to/from the overhead area
1466 const int overhead_size =
1467 -(frame::interpreter_frame_initial_sp_offset) + entry_size;
1468
1469 const int stub_code = frame::entry_frame_after_call_words;
1470 const int extra_stack = methodOopDesc::extra_stack_entries();
1471 const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
1472 Interpreter::stackElementWords();
1473 return (overhead_size + method_stack + stub_code);
1474 }
1475
1476 int AbstractInterpreter::layout_activation(methodOop method,
1477 int tempcount,
1478 int popframe_extra_args,
|
1 /*
2 * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
1439 case Interpreter::method_handle : entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();break;
1440
1441 case Interpreter::java_lang_math_sin : // fall thru
1442 case Interpreter::java_lang_math_cos : // fall thru
1443 case Interpreter::java_lang_math_tan : // fall thru
1444 case Interpreter::java_lang_math_abs : // fall thru
1445 case Interpreter::java_lang_math_log : // fall thru
1446 case Interpreter::java_lang_math_log10 : // fall thru
1447 case Interpreter::java_lang_math_sqrt : entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind); break;
1448 default : ShouldNotReachHere(); break;
1449 }
1450
1451 if (entry_point) {
1452 return entry_point;
1453 }
1454
1455 return ((InterpreterGenerator*) this)->
1456 generate_normal_entry(synchronized);
1457 }
1458
1459 // These should never be compiled since the interpreter will prefer
1460 // the compiled version to the intrinsic version.
1461 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
1462 switch (method_kind(m)) {
1463 case Interpreter::java_lang_math_sin : // fall thru
1464 case Interpreter::java_lang_math_cos : // fall thru
1465 case Interpreter::java_lang_math_tan : // fall thru
1466 case Interpreter::java_lang_math_abs : // fall thru
1467 case Interpreter::java_lang_math_log : // fall thru
1468 case Interpreter::java_lang_math_log10 : // fall thru
1469 case Interpreter::java_lang_math_sqrt :
1470 return false;
1471 default:
1472 return true;
1473 }
1474 }
1475
1476 // How much stack a method activation needs in words.
1477 int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
1478 const int entry_size = frame::interpreter_frame_monitor_size();
1479
1480 // total overhead size: entry_size + (saved rbp thru expr stack
1481 // bottom). be sure to change this if you add/subtract anything
1482 // to/from the overhead area
1483 const int overhead_size =
1484 -(frame::interpreter_frame_initial_sp_offset) + entry_size;
1485
1486 const int stub_code = frame::entry_frame_after_call_words;
1487 const int extra_stack = methodOopDesc::extra_stack_entries();
1488 const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
1489 Interpreter::stackElementWords();
1490 return (overhead_size + method_stack + stub_code);
1491 }
1492
1493 int AbstractInterpreter::layout_activation(methodOop method,
1494 int tempcount,
1495 int popframe_extra_args,
|