src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8074457 Sdiff src/cpu/aarch64/vm

src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp

Print this page




  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "oops/constMethod.hpp"
  29 #include "oops/method.hpp"
  30 #include "runtime/frame.inline.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/macros.hpp"
  33 






  34 
  35 int AbstractInterpreter::BasicType_as_index(BasicType type) {
  36   int i = 0;
  37   switch (type) {
  38     case T_BOOLEAN: i = 0; break;
  39     case T_CHAR   : i = 1; break;
  40     case T_BYTE   : i = 2; break;
  41     case T_SHORT  : i = 3; break;
  42     case T_INT    : i = 4; break;
  43     case T_LONG   : i = 5; break;
  44     case T_VOID   : i = 6; break;
  45     case T_FLOAT  : i = 7; break;
  46     case T_DOUBLE : i = 8; break;
  47     case T_OBJECT : i = 9; break;
  48     case T_ARRAY  : i = 9; break;
  49     default       : ShouldNotReachHere();
  50   }
  51   assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
  52          "index out of bounds");
  53   return i;


  80   // bottom).  be sure to change this if you add/subtract anything
  81   // to/from the overhead area
  82   const int overhead_size =
  83     -(frame::interpreter_frame_initial_sp_offset) + entry_size;
  84 
  85   const int stub_code = frame::entry_frame_after_call_words;
  86   const int method_stack = (method->max_locals() + method->max_stack()) *
  87                            Interpreter::stackElementWords;
  88   return (overhead_size + method_stack + stub_code);
  89 }
  90 
  91 // asm based interpreter deoptimization helpers
  92 int AbstractInterpreter::size_activation(int max_stack,
  93                                          int temps,
  94                                          int extra_args,
  95                                          int monitors,
  96                                          int callee_params,
  97                                          int callee_locals,
  98                                          bool is_top_frame) {
  99   // Note: This calculation must exactly parallel the frame setup
 100   // in InterpreterGenerator::generate_method_entry.
 101 
 102   // fixed size of an interpreter frame:
 103   int overhead = frame::sender_sp_offset -
 104                  frame::interpreter_frame_initial_sp_offset;
 105   // Our locals were accounted for by the caller (or last_frame_adjust
 106   // on the transistion) Since the callee parameters already account
 107   // for the callee's params we only need to account for the extra
 108   // locals.
 109   int size = overhead +
 110          (callee_locals - callee_params)*Interpreter::stackElementWords +
 111          monitors * frame::interpreter_frame_monitor_size() +
 112          temps* Interpreter::stackElementWords + extra_args;
 113 
 114   // On AArch64 we always keep the stack pointer 16-aligned, so we
 115   // must round up here.
 116   size = round_to(size, 2);
 117 
 118   return size;
 119 }
 120 




  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "interpreter/interpreter.hpp"
  28 #include "oops/constMethod.hpp"
  29 #include "oops/method.hpp"
  30 #include "runtime/frame.inline.hpp"
  31 #include "utilities/debug.hpp"
  32 #include "utilities/macros.hpp"
  33 
  34 // Size of interpreter code.  Increase if too small.  Interpreter will
  35 // fail with a guarantee ("not enough space for interpreter generation");
  36 // if too small.
  37 // Run with +PrintInterpreter to get the VM to print out the size.
  38 // Max size with JVMTI
  39 int TemplateInterpreter::InterpreterCodeSize = 200 * 1024;
  40 
  41 int AbstractInterpreter::BasicType_as_index(BasicType type) {
  42   int i = 0;
  43   switch (type) {
  44     case T_BOOLEAN: i = 0; break;
  45     case T_CHAR   : i = 1; break;
  46     case T_BYTE   : i = 2; break;
  47     case T_SHORT  : i = 3; break;
  48     case T_INT    : i = 4; break;
  49     case T_LONG   : i = 5; break;
  50     case T_VOID   : i = 6; break;
  51     case T_FLOAT  : i = 7; break;
  52     case T_DOUBLE : i = 8; break;
  53     case T_OBJECT : i = 9; break;
  54     case T_ARRAY  : i = 9; break;
  55     default       : ShouldNotReachHere();
  56   }
  57   assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers,
  58          "index out of bounds");
  59   return i;


  86   // bottom).  be sure to change this if you add/subtract anything
  87   // to/from the overhead area
  88   const int overhead_size =
  89     -(frame::interpreter_frame_initial_sp_offset) + entry_size;
  90 
  91   const int stub_code = frame::entry_frame_after_call_words;
  92   const int method_stack = (method->max_locals() + method->max_stack()) *
  93                            Interpreter::stackElementWords;
  94   return (overhead_size + method_stack + stub_code);
  95 }
  96 
  97 // asm based interpreter deoptimization helpers
  98 int AbstractInterpreter::size_activation(int max_stack,
  99                                          int temps,
 100                                          int extra_args,
 101                                          int monitors,
 102                                          int callee_params,
 103                                          int callee_locals,
 104                                          bool is_top_frame) {
 105   // Note: This calculation must exactly parallel the frame setup
 106   // in TemplateInterpreterGenerator::generate_method_entry.
 107 
 108   // fixed size of an interpreter frame:
 109   int overhead = frame::sender_sp_offset -
 110                  frame::interpreter_frame_initial_sp_offset;
 111   // Our locals were accounted for by the caller (or last_frame_adjust
 112   // on the transistion) Since the callee parameters already account
 113   // for the callee's params we only need to account for the extra
 114   // locals.
 115   int size = overhead +
 116          (callee_locals - callee_params)*Interpreter::stackElementWords +
 117          monitors * frame::interpreter_frame_monitor_size() +
 118          temps* Interpreter::stackElementWords + extra_args;
 119 
 120   // On AArch64 we always keep the stack pointer 16-aligned, so we
 121   // must round up here.
 122   size = round_to(size, 2);
 123 
 124   return size;
 125 }
 126 


src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File