src/cpu/x86/vm/templateInterpreter_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6849984 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/templateInterpreter_x86_32.cpp

Print this page


   1 /*
   2  * Copyright 1997-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  *


1414     case Interpreter::accessor               : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry();     break;
1415     case Interpreter::abstract               : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry();     break;
1416     case Interpreter::method_handle          : entry_point = ((InterpreterGenerator*)this)->generate_method_handle_entry(); break;
1417 
1418     case Interpreter::java_lang_math_sin     : // fall thru
1419     case Interpreter::java_lang_math_cos     : // fall thru
1420     case Interpreter::java_lang_math_tan     : // fall thru
1421     case Interpreter::java_lang_math_abs     : // fall thru
1422     case Interpreter::java_lang_math_log     : // fall thru
1423     case Interpreter::java_lang_math_log10   : // fall thru
1424     case Interpreter::java_lang_math_sqrt    : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind);     break;
1425     default                                  : ShouldNotReachHere();                                                       break;
1426   }
1427 
1428   if (entry_point) return entry_point;
1429 
1430   return ((InterpreterGenerator*)this)->generate_normal_entry(synchronized);
1431 
1432 }
1433 

















1434 // How much stack a method activation needs in words.
1435 int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
1436 
1437   const int stub_code = 4;  // see generate_call_stub
1438   // Save space for one monitor to get into the interpreted method in case
1439   // the method is synchronized
1440   int monitor_size    = method->is_synchronized() ?
1441                                 1*frame::interpreter_frame_monitor_size() : 0;
1442 
1443   // total overhead size: entry_size + (saved rbp, thru expr stack bottom).
1444   // be sure to change this if you add/subtract anything to/from the overhead area
1445   const int overhead_size = -frame::interpreter_frame_initial_sp_offset;
1446 
1447   const int extra_stack = methodOopDesc::extra_stack_entries();
1448   const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
1449                            Interpreter::stackElementWords();
1450   return overhead_size + method_stack + stub_code;
1451 }
1452 
1453 // asm based interpreter deoptimization helpers


   1 /*
   2  * Copyright 1997-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  *


1414     case Interpreter::accessor               : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry();     break;
1415     case Interpreter::abstract               : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry();     break;
1416     case Interpreter::method_handle          : entry_point = ((InterpreterGenerator*)this)->generate_method_handle_entry(); break;
1417 
1418     case Interpreter::java_lang_math_sin     : // fall thru
1419     case Interpreter::java_lang_math_cos     : // fall thru
1420     case Interpreter::java_lang_math_tan     : // fall thru
1421     case Interpreter::java_lang_math_abs     : // fall thru
1422     case Interpreter::java_lang_math_log     : // fall thru
1423     case Interpreter::java_lang_math_log10   : // fall thru
1424     case Interpreter::java_lang_math_sqrt    : entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind);     break;
1425     default                                  : ShouldNotReachHere();                                                       break;
1426   }
1427 
1428   if (entry_point) return entry_point;
1429 
1430   return ((InterpreterGenerator*)this)->generate_normal_entry(synchronized);
1431 
1432 }
1433 
1434 // These should never be compiled since the interpreter will prefer
1435 // the compiled version to the intrinsic version.
1436 bool AbstractInterpreter::can_be_compiled(methodHandle m) {
1437   switch (method_kind(m)) {
1438     case Interpreter::java_lang_math_sin     : // fall thru
1439     case Interpreter::java_lang_math_cos     : // fall thru
1440     case Interpreter::java_lang_math_tan     : // fall thru
1441     case Interpreter::java_lang_math_abs     : // fall thru
1442     case Interpreter::java_lang_math_log     : // fall thru
1443     case Interpreter::java_lang_math_log10   : // fall thru
1444     case Interpreter::java_lang_math_sqrt    :
1445       return false;
1446     default:
1447       return true;
1448   }
1449 }
1450 
1451 // How much stack a method activation needs in words.
1452 int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
1453 
1454   const int stub_code = 4;  // see generate_call_stub
1455   // Save space for one monitor to get into the interpreted method in case
1456   // the method is synchronized
1457   int monitor_size    = method->is_synchronized() ?
1458                                 1*frame::interpreter_frame_monitor_size() : 0;
1459 
1460   // total overhead size: entry_size + (saved rbp, thru expr stack bottom).
1461   // be sure to change this if you add/subtract anything to/from the overhead area
1462   const int overhead_size = -frame::interpreter_frame_initial_sp_offset;
1463 
1464   const int extra_stack = methodOopDesc::extra_stack_entries();
1465   const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
1466                            Interpreter::stackElementWords();
1467   return overhead_size + method_stack + stub_code;
1468 }
1469 
1470 // asm based interpreter deoptimization helpers


src/cpu/x86/vm/templateInterpreter_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File