src/share/vm/interpreter/templateTable.cpp

changeset 0
f90c822e73f8
child 6876
710a3c8b516e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/vm/interpreter/templateTable.cpp	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,548 @@
     1.4 +/*
     1.5 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.
    1.11 + *
    1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 + * version 2 for more details (a copy is included in the LICENSE file that
    1.16 + * accompanied this code).
    1.17 + *
    1.18 + * You should have received a copy of the GNU General Public License version
    1.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 + *
    1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.23 + * or visit www.oracle.com if you need additional information or have any
    1.24 + * questions.
    1.25 + *
    1.26 + */
    1.27 +
    1.28 +#include "precompiled.hpp"
    1.29 +#include "gc_interface/collectedHeap.hpp"
    1.30 +#include "interpreter/templateTable.hpp"
    1.31 +#include "runtime/timer.hpp"
    1.32 +
    1.33 +
    1.34 +#ifdef CC_INTERP
    1.35 +
    1.36 +void templateTable_init() {
    1.37 +}
    1.38 +
    1.39 +#else
    1.40 +
    1.41 +//----------------------------------------------------------------------------------------------------
    1.42 +// Implementation of Template
    1.43 +
    1.44 +
    1.45 +void Template::initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg) {
    1.46 +  _flags   = flags;
    1.47 +  _tos_in  = tos_in;
    1.48 +  _tos_out = tos_out;
    1.49 +  _gen     = gen;
    1.50 +  _arg     = arg;
    1.51 +}
    1.52 +
    1.53 +
    1.54 +Bytecodes::Code Template::bytecode() const {
    1.55 +  int i = this - TemplateTable::_template_table;
    1.56 +  if (i < 0 || i >= Bytecodes::number_of_codes) i = this - TemplateTable::_template_table_wide;
    1.57 +  return Bytecodes::cast(i);
    1.58 +}
    1.59 +
    1.60 +
    1.61 +void Template::generate(InterpreterMacroAssembler* masm) {
    1.62 +  // parameter passing
    1.63 +  TemplateTable::_desc = this;
    1.64 +  TemplateTable::_masm = masm;
    1.65 +  // code generation
    1.66 +  _gen(_arg);
    1.67 +  masm->flush();
    1.68 +}
    1.69 +
    1.70 +
    1.71 +//----------------------------------------------------------------------------------------------------
    1.72 +// Implementation of TemplateTable: Platform-independent helper routines
    1.73 +
    1.74 +void TemplateTable::call_VM(Register oop_result, address entry_point) {
    1.75 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
    1.76 +  _masm->call_VM(oop_result, entry_point);
    1.77 +}
    1.78 +
    1.79 +
    1.80 +void TemplateTable::call_VM(Register oop_result, address entry_point, Register arg_1) {
    1.81 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
    1.82 +  _masm->call_VM(oop_result, entry_point, arg_1);
    1.83 +}
    1.84 +
    1.85 +
    1.86 +void TemplateTable::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2) {
    1.87 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
    1.88 +  _masm->call_VM(oop_result, entry_point, arg_1, arg_2);
    1.89 +}
    1.90 +
    1.91 +
    1.92 +void TemplateTable::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3) {
    1.93 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
    1.94 +  _masm->call_VM(oop_result, entry_point, arg_1, arg_2, arg_3);
    1.95 +}
    1.96 +
    1.97 +
    1.98 +void TemplateTable::call_VM(Register oop_result, Register last_java_sp, address entry_point) {
    1.99 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
   1.100 +  _masm->call_VM(oop_result, last_java_sp, entry_point);
   1.101 +}
   1.102 +
   1.103 +
   1.104 +void TemplateTable::call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1) {
   1.105 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
   1.106 +  _masm->call_VM(oop_result, last_java_sp, entry_point, arg_1);
   1.107 +}
   1.108 +
   1.109 +
   1.110 +void TemplateTable::call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2) {
   1.111 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
   1.112 +  _masm->call_VM(oop_result, last_java_sp, entry_point, arg_1, arg_2);
   1.113 +}
   1.114 +
   1.115 +
   1.116 +void TemplateTable::call_VM(Register oop_result, Register last_java_sp, address entry_point, Register arg_1, Register arg_2, Register arg_3) {
   1.117 +  assert(_desc->calls_vm(), "inconsistent calls_vm information");
   1.118 +  _masm->call_VM(oop_result, last_java_sp, entry_point, arg_1, arg_2, arg_3);
   1.119 +}
   1.120 +
   1.121 +
   1.122 +//----------------------------------------------------------------------------------------------------
   1.123 +// Implementation of TemplateTable: Platform-independent bytecodes
   1.124 +
   1.125 +void TemplateTable::float_cmp(int unordered_result) {
   1.126 +  transition(ftos, itos);
   1.127 +  float_cmp(true, unordered_result);
   1.128 +}
   1.129 +
   1.130 +
   1.131 +void TemplateTable::double_cmp(int unordered_result) {
   1.132 +  transition(dtos, itos);
   1.133 +  float_cmp(false, unordered_result);
   1.134 +}
   1.135 +
   1.136 +
   1.137 +void TemplateTable::_goto() {
   1.138 +  transition(vtos, vtos);
   1.139 +  branch(false, false);
   1.140 +}
   1.141 +
   1.142 +
   1.143 +void TemplateTable::goto_w() {
   1.144 +  transition(vtos, vtos);
   1.145 +  branch(false, true);
   1.146 +}
   1.147 +
   1.148 +
   1.149 +void TemplateTable::jsr_w() {
   1.150 +  transition(vtos, vtos);       // result is not an oop, so do not transition to atos
   1.151 +  branch(true, true);
   1.152 +}
   1.153 +
   1.154 +
   1.155 +void TemplateTable::jsr() {
   1.156 +  transition(vtos, vtos);       // result is not an oop, so do not transition to atos
   1.157 +  branch(true, false);
   1.158 +}
   1.159 +
   1.160 +
   1.161 +
   1.162 +//----------------------------------------------------------------------------------------------------
   1.163 +// Implementation of TemplateTable: Debugging
   1.164 +
   1.165 +void TemplateTable::transition(TosState tos_in, TosState tos_out) {
   1.166 +  assert(_desc->tos_in()  == tos_in , "inconsistent tos_in  information");
   1.167 +  assert(_desc->tos_out() == tos_out, "inconsistent tos_out information");
   1.168 +}
   1.169 +
   1.170 +
   1.171 +//----------------------------------------------------------------------------------------------------
   1.172 +// Implementation of TemplateTable: Initialization
   1.173 +
   1.174 +bool                       TemplateTable::_is_initialized = false;
   1.175 +Template                   TemplateTable::_template_table     [Bytecodes::number_of_codes];
   1.176 +Template                   TemplateTable::_template_table_wide[Bytecodes::number_of_codes];
   1.177 +
   1.178 +Template*                  TemplateTable::_desc;
   1.179 +InterpreterMacroAssembler* TemplateTable::_masm;
   1.180 +BarrierSet*                TemplateTable::_bs;
   1.181 +
   1.182 +
   1.183 +void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(), char filler) {
   1.184 +  assert(filler == ' ', "just checkin'");
   1.185 +  def(code, flags, in, out, (Template::generator)gen, 0);
   1.186 +}
   1.187 +
   1.188 +
   1.189 +void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(int arg), int arg) {
   1.190 +  // should factor out these constants
   1.191 +  const int ubcp = 1 << Template::uses_bcp_bit;
   1.192 +  const int disp = 1 << Template::does_dispatch_bit;
   1.193 +  const int clvm = 1 << Template::calls_vm_bit;
   1.194 +  const int iswd = 1 << Template::wide_bit;
   1.195 +  // determine which table to use
   1.196 +  bool is_wide = (flags & iswd) != 0;
   1.197 +  // make sure that wide instructions have a vtos entry point
   1.198 +  // (since they are executed extremely rarely, it doesn't pay out to have an
   1.199 +  // extra set of 5 dispatch tables for the wide instructions - for simplicity
   1.200 +  // they all go with one table)
   1.201 +  assert(in == vtos || !is_wide, "wide instructions have vtos entry point only");
   1.202 +  Template* t = is_wide ? template_for_wide(code) : template_for(code);
   1.203 +  // setup entry
   1.204 +  t->initialize(flags, in, out, gen, arg);
   1.205 +  assert(t->bytecode() == code, "just checkin'");
   1.206 +}
   1.207 +
   1.208 +
   1.209 +void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Operation op), Operation op) {
   1.210 +  def(code, flags, in, out, (Template::generator)gen, (int)op);
   1.211 +}
   1.212 +
   1.213 +
   1.214 +void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(bool arg    ), bool arg) {
   1.215 +  def(code, flags, in, out, (Template::generator)gen, (int)arg);
   1.216 +}
   1.217 +
   1.218 +
   1.219 +void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(TosState tos), TosState tos) {
   1.220 +  def(code, flags, in, out, (Template::generator)gen, (int)tos);
   1.221 +}
   1.222 +
   1.223 +
   1.224 +void TemplateTable::def(Bytecodes::Code code, int flags, TosState in, TosState out, void (*gen)(Condition cc), Condition cc) {
   1.225 +  def(code, flags, in, out, (Template::generator)gen, (int)cc);
   1.226 +}
   1.227 +
   1.228 +#if defined(TEMPLATE_TABLE_BUG)
   1.229 +//
   1.230 +// It appears that gcc (version 2.91) generates bad code for the template
   1.231 +// table init if this macro is not defined.  My symptom was an assertion
   1.232 +// assert(Universe::heap()->is_in(obj), "sanity check") in handles.cpp line 24.
   1.233 +// when called from interpreterRuntime.resolve_invoke().
   1.234 +//
   1.235 +  #define iload  TemplateTable::iload
   1.236 +  #define lload  TemplateTable::lload
   1.237 +  #define fload  TemplateTable::fload
   1.238 +  #define dload  TemplateTable::dload
   1.239 +  #define aload  TemplateTable::aload
   1.240 +  #define istore TemplateTable::istore
   1.241 +  #define lstore TemplateTable::lstore
   1.242 +  #define fstore TemplateTable::fstore
   1.243 +  #define dstore TemplateTable::dstore
   1.244 +  #define astore TemplateTable::astore
   1.245 +#endif // TEMPLATE_TABLE_BUG
   1.246 +
   1.247 +void TemplateTable::initialize() {
   1.248 +  if (_is_initialized) return;
   1.249 +
   1.250 +  // Initialize table
   1.251 +  TraceTime timer("TemplateTable initialization", TraceStartupTime);
   1.252 +
   1.253 +  _bs = Universe::heap()->barrier_set();
   1.254 +
   1.255 +  // For better readability
   1.256 +  const char _    = ' ';
   1.257 +  const int  ____ = 0;
   1.258 +  const int  ubcp = 1 << Template::uses_bcp_bit;
   1.259 +  const int  disp = 1 << Template::does_dispatch_bit;
   1.260 +  const int  clvm = 1 << Template::calls_vm_bit;
   1.261 +  const int  iswd = 1 << Template::wide_bit;
   1.262 +  //                                    interpr. templates
   1.263 +  // Java spec bytecodes                ubcp|disp|clvm|iswd  in    out   generator             argument
   1.264 +  def(Bytecodes::_nop                 , ____|____|____|____, vtos, vtos, nop                 ,  _           );
   1.265 +  def(Bytecodes::_aconst_null         , ____|____|____|____, vtos, atos, aconst_null         ,  _           );
   1.266 +  def(Bytecodes::_iconst_m1           , ____|____|____|____, vtos, itos, iconst              , -1           );
   1.267 +  def(Bytecodes::_iconst_0            , ____|____|____|____, vtos, itos, iconst              ,  0           );
   1.268 +  def(Bytecodes::_iconst_1            , ____|____|____|____, vtos, itos, iconst              ,  1           );
   1.269 +  def(Bytecodes::_iconst_2            , ____|____|____|____, vtos, itos, iconst              ,  2           );
   1.270 +  def(Bytecodes::_iconst_3            , ____|____|____|____, vtos, itos, iconst              ,  3           );
   1.271 +  def(Bytecodes::_iconst_4            , ____|____|____|____, vtos, itos, iconst              ,  4           );
   1.272 +  def(Bytecodes::_iconst_5            , ____|____|____|____, vtos, itos, iconst              ,  5           );
   1.273 +  def(Bytecodes::_lconst_0            , ____|____|____|____, vtos, ltos, lconst              ,  0           );
   1.274 +  def(Bytecodes::_lconst_1            , ____|____|____|____, vtos, ltos, lconst              ,  1           );
   1.275 +  def(Bytecodes::_fconst_0            , ____|____|____|____, vtos, ftos, fconst              ,  0           );
   1.276 +  def(Bytecodes::_fconst_1            , ____|____|____|____, vtos, ftos, fconst              ,  1           );
   1.277 +  def(Bytecodes::_fconst_2            , ____|____|____|____, vtos, ftos, fconst              ,  2           );
   1.278 +  def(Bytecodes::_dconst_0            , ____|____|____|____, vtos, dtos, dconst              ,  0           );
   1.279 +  def(Bytecodes::_dconst_1            , ____|____|____|____, vtos, dtos, dconst              ,  1           );
   1.280 +  def(Bytecodes::_bipush              , ubcp|____|____|____, vtos, itos, bipush              ,  _           );
   1.281 +  def(Bytecodes::_sipush              , ubcp|____|____|____, vtos, itos, sipush              ,  _           );
   1.282 +  def(Bytecodes::_ldc                 , ubcp|____|clvm|____, vtos, vtos, ldc                 ,  false       );
   1.283 +  def(Bytecodes::_ldc_w               , ubcp|____|clvm|____, vtos, vtos, ldc                 ,  true        );
   1.284 +  def(Bytecodes::_ldc2_w              , ubcp|____|____|____, vtos, vtos, ldc2_w              ,  _           );
   1.285 +  def(Bytecodes::_iload               , ubcp|____|clvm|____, vtos, itos, iload               ,  _           );
   1.286 +  def(Bytecodes::_lload               , ubcp|____|____|____, vtos, ltos, lload               ,  _           );
   1.287 +  def(Bytecodes::_fload               , ubcp|____|____|____, vtos, ftos, fload               ,  _           );
   1.288 +  def(Bytecodes::_dload               , ubcp|____|____|____, vtos, dtos, dload               ,  _           );
   1.289 +  def(Bytecodes::_aload               , ubcp|____|clvm|____, vtos, atos, aload               ,  _           );
   1.290 +  def(Bytecodes::_iload_0             , ____|____|____|____, vtos, itos, iload               ,  0           );
   1.291 +  def(Bytecodes::_iload_1             , ____|____|____|____, vtos, itos, iload               ,  1           );
   1.292 +  def(Bytecodes::_iload_2             , ____|____|____|____, vtos, itos, iload               ,  2           );
   1.293 +  def(Bytecodes::_iload_3             , ____|____|____|____, vtos, itos, iload               ,  3           );
   1.294 +  def(Bytecodes::_lload_0             , ____|____|____|____, vtos, ltos, lload               ,  0           );
   1.295 +  def(Bytecodes::_lload_1             , ____|____|____|____, vtos, ltos, lload               ,  1           );
   1.296 +  def(Bytecodes::_lload_2             , ____|____|____|____, vtos, ltos, lload               ,  2           );
   1.297 +  def(Bytecodes::_lload_3             , ____|____|____|____, vtos, ltos, lload               ,  3           );
   1.298 +  def(Bytecodes::_fload_0             , ____|____|____|____, vtos, ftos, fload               ,  0           );
   1.299 +  def(Bytecodes::_fload_1             , ____|____|____|____, vtos, ftos, fload               ,  1           );
   1.300 +  def(Bytecodes::_fload_2             , ____|____|____|____, vtos, ftos, fload               ,  2           );
   1.301 +  def(Bytecodes::_fload_3             , ____|____|____|____, vtos, ftos, fload               ,  3           );
   1.302 +  def(Bytecodes::_dload_0             , ____|____|____|____, vtos, dtos, dload               ,  0           );
   1.303 +  def(Bytecodes::_dload_1             , ____|____|____|____, vtos, dtos, dload               ,  1           );
   1.304 +  def(Bytecodes::_dload_2             , ____|____|____|____, vtos, dtos, dload               ,  2           );
   1.305 +  def(Bytecodes::_dload_3             , ____|____|____|____, vtos, dtos, dload               ,  3           );
   1.306 +  def(Bytecodes::_aload_0             , ubcp|____|clvm|____, vtos, atos, aload_0             ,  _           );
   1.307 +  def(Bytecodes::_aload_1             , ____|____|____|____, vtos, atos, aload               ,  1           );
   1.308 +  def(Bytecodes::_aload_2             , ____|____|____|____, vtos, atos, aload               ,  2           );
   1.309 +  def(Bytecodes::_aload_3             , ____|____|____|____, vtos, atos, aload               ,  3           );
   1.310 +  def(Bytecodes::_iaload              , ____|____|____|____, itos, itos, iaload              ,  _           );
   1.311 +  def(Bytecodes::_laload              , ____|____|____|____, itos, ltos, laload              ,  _           );
   1.312 +  def(Bytecodes::_faload              , ____|____|____|____, itos, ftos, faload              ,  _           );
   1.313 +  def(Bytecodes::_daload              , ____|____|____|____, itos, dtos, daload              ,  _           );
   1.314 +  def(Bytecodes::_aaload              , ____|____|____|____, itos, atos, aaload              ,  _           );
   1.315 +  def(Bytecodes::_baload              , ____|____|____|____, itos, itos, baload              ,  _           );
   1.316 +  def(Bytecodes::_caload              , ____|____|____|____, itos, itos, caload              ,  _           );
   1.317 +  def(Bytecodes::_saload              , ____|____|____|____, itos, itos, saload              ,  _           );
   1.318 +  def(Bytecodes::_istore              , ubcp|____|clvm|____, itos, vtos, istore              ,  _           );
   1.319 +  def(Bytecodes::_lstore              , ubcp|____|____|____, ltos, vtos, lstore              ,  _           );
   1.320 +  def(Bytecodes::_fstore              , ubcp|____|____|____, ftos, vtos, fstore              ,  _           );
   1.321 +  def(Bytecodes::_dstore              , ubcp|____|____|____, dtos, vtos, dstore              ,  _           );
   1.322 +  def(Bytecodes::_astore              , ubcp|____|clvm|____, vtos, vtos, astore              ,  _           );
   1.323 +  def(Bytecodes::_istore_0            , ____|____|____|____, itos, vtos, istore              ,  0           );
   1.324 +  def(Bytecodes::_istore_1            , ____|____|____|____, itos, vtos, istore              ,  1           );
   1.325 +  def(Bytecodes::_istore_2            , ____|____|____|____, itos, vtos, istore              ,  2           );
   1.326 +  def(Bytecodes::_istore_3            , ____|____|____|____, itos, vtos, istore              ,  3           );
   1.327 +  def(Bytecodes::_lstore_0            , ____|____|____|____, ltos, vtos, lstore              ,  0           );
   1.328 +  def(Bytecodes::_lstore_1            , ____|____|____|____, ltos, vtos, lstore              ,  1           );
   1.329 +  def(Bytecodes::_lstore_2            , ____|____|____|____, ltos, vtos, lstore              ,  2           );
   1.330 +  def(Bytecodes::_lstore_3            , ____|____|____|____, ltos, vtos, lstore              ,  3           );
   1.331 +  def(Bytecodes::_fstore_0            , ____|____|____|____, ftos, vtos, fstore              ,  0           );
   1.332 +  def(Bytecodes::_fstore_1            , ____|____|____|____, ftos, vtos, fstore              ,  1           );
   1.333 +  def(Bytecodes::_fstore_2            , ____|____|____|____, ftos, vtos, fstore              ,  2           );
   1.334 +  def(Bytecodes::_fstore_3            , ____|____|____|____, ftos, vtos, fstore              ,  3           );
   1.335 +  def(Bytecodes::_dstore_0            , ____|____|____|____, dtos, vtos, dstore              ,  0           );
   1.336 +  def(Bytecodes::_dstore_1            , ____|____|____|____, dtos, vtos, dstore              ,  1           );
   1.337 +  def(Bytecodes::_dstore_2            , ____|____|____|____, dtos, vtos, dstore              ,  2           );
   1.338 +  def(Bytecodes::_dstore_3            , ____|____|____|____, dtos, vtos, dstore              ,  3           );
   1.339 +  def(Bytecodes::_astore_0            , ____|____|____|____, vtos, vtos, astore              ,  0           );
   1.340 +  def(Bytecodes::_astore_1            , ____|____|____|____, vtos, vtos, astore              ,  1           );
   1.341 +  def(Bytecodes::_astore_2            , ____|____|____|____, vtos, vtos, astore              ,  2           );
   1.342 +  def(Bytecodes::_astore_3            , ____|____|____|____, vtos, vtos, astore              ,  3           );
   1.343 +  def(Bytecodes::_iastore             , ____|____|____|____, itos, vtos, iastore             ,  _           );
   1.344 +  def(Bytecodes::_lastore             , ____|____|____|____, ltos, vtos, lastore             ,  _           );
   1.345 +  def(Bytecodes::_fastore             , ____|____|____|____, ftos, vtos, fastore             ,  _           );
   1.346 +  def(Bytecodes::_dastore             , ____|____|____|____, dtos, vtos, dastore             ,  _           );
   1.347 +  def(Bytecodes::_aastore             , ____|____|clvm|____, vtos, vtos, aastore             ,  _           );
   1.348 +  def(Bytecodes::_bastore             , ____|____|____|____, itos, vtos, bastore             ,  _           );
   1.349 +  def(Bytecodes::_castore             , ____|____|____|____, itos, vtos, castore             ,  _           );
   1.350 +  def(Bytecodes::_sastore             , ____|____|____|____, itos, vtos, sastore             ,  _           );
   1.351 +  def(Bytecodes::_pop                 , ____|____|____|____, vtos, vtos, pop                 ,  _           );
   1.352 +  def(Bytecodes::_pop2                , ____|____|____|____, vtos, vtos, pop2                ,  _           );
   1.353 +  def(Bytecodes::_dup                 , ____|____|____|____, vtos, vtos, dup                 ,  _           );
   1.354 +  def(Bytecodes::_dup_x1              , ____|____|____|____, vtos, vtos, dup_x1              ,  _           );
   1.355 +  def(Bytecodes::_dup_x2              , ____|____|____|____, vtos, vtos, dup_x2              ,  _           );
   1.356 +  def(Bytecodes::_dup2                , ____|____|____|____, vtos, vtos, dup2                ,  _           );
   1.357 +  def(Bytecodes::_dup2_x1             , ____|____|____|____, vtos, vtos, dup2_x1             ,  _           );
   1.358 +  def(Bytecodes::_dup2_x2             , ____|____|____|____, vtos, vtos, dup2_x2             ,  _           );
   1.359 +  def(Bytecodes::_swap                , ____|____|____|____, vtos, vtos, swap                ,  _           );
   1.360 +  def(Bytecodes::_iadd                , ____|____|____|____, itos, itos, iop2                , add          );
   1.361 +  def(Bytecodes::_ladd                , ____|____|____|____, ltos, ltos, lop2                , add          );
   1.362 +  def(Bytecodes::_fadd                , ____|____|____|____, ftos, ftos, fop2                , add          );
   1.363 +  def(Bytecodes::_dadd                , ____|____|____|____, dtos, dtos, dop2                , add          );
   1.364 +  def(Bytecodes::_isub                , ____|____|____|____, itos, itos, iop2                , sub          );
   1.365 +  def(Bytecodes::_lsub                , ____|____|____|____, ltos, ltos, lop2                , sub          );
   1.366 +  def(Bytecodes::_fsub                , ____|____|____|____, ftos, ftos, fop2                , sub          );
   1.367 +  def(Bytecodes::_dsub                , ____|____|____|____, dtos, dtos, dop2                , sub          );
   1.368 +  def(Bytecodes::_imul                , ____|____|____|____, itos, itos, iop2                , mul          );
   1.369 +  def(Bytecodes::_lmul                , ____|____|____|____, ltos, ltos, lmul                ,  _           );
   1.370 +  def(Bytecodes::_fmul                , ____|____|____|____, ftos, ftos, fop2                , mul          );
   1.371 +  def(Bytecodes::_dmul                , ____|____|____|____, dtos, dtos, dop2                , mul          );
   1.372 +  def(Bytecodes::_idiv                , ____|____|____|____, itos, itos, idiv                ,  _           );
   1.373 +  def(Bytecodes::_ldiv                , ____|____|____|____, ltos, ltos, ldiv                ,  _           );
   1.374 +  def(Bytecodes::_fdiv                , ____|____|____|____, ftos, ftos, fop2                , div          );
   1.375 +  def(Bytecodes::_ddiv                , ____|____|____|____, dtos, dtos, dop2                , div          );
   1.376 +  def(Bytecodes::_irem                , ____|____|____|____, itos, itos, irem                ,  _           );
   1.377 +  def(Bytecodes::_lrem                , ____|____|____|____, ltos, ltos, lrem                ,  _           );
   1.378 +  def(Bytecodes::_frem                , ____|____|____|____, ftos, ftos, fop2                , rem          );
   1.379 +  def(Bytecodes::_drem                , ____|____|____|____, dtos, dtos, dop2                , rem          );
   1.380 +  def(Bytecodes::_ineg                , ____|____|____|____, itos, itos, ineg                ,  _           );
   1.381 +  def(Bytecodes::_lneg                , ____|____|____|____, ltos, ltos, lneg                ,  _           );
   1.382 +  def(Bytecodes::_fneg                , ____|____|____|____, ftos, ftos, fneg                ,  _           );
   1.383 +  def(Bytecodes::_dneg                , ____|____|____|____, dtos, dtos, dneg                ,  _           );
   1.384 +  def(Bytecodes::_ishl                , ____|____|____|____, itos, itos, iop2                , shl          );
   1.385 +  def(Bytecodes::_lshl                , ____|____|____|____, itos, ltos, lshl                ,  _           );
   1.386 +  def(Bytecodes::_ishr                , ____|____|____|____, itos, itos, iop2                , shr          );
   1.387 +  def(Bytecodes::_lshr                , ____|____|____|____, itos, ltos, lshr                ,  _           );
   1.388 +  def(Bytecodes::_iushr               , ____|____|____|____, itos, itos, iop2                , ushr         );
   1.389 +  def(Bytecodes::_lushr               , ____|____|____|____, itos, ltos, lushr               ,  _           );
   1.390 +  def(Bytecodes::_iand                , ____|____|____|____, itos, itos, iop2                , _and         );
   1.391 +  def(Bytecodes::_land                , ____|____|____|____, ltos, ltos, lop2                , _and         );
   1.392 +  def(Bytecodes::_ior                 , ____|____|____|____, itos, itos, iop2                , _or          );
   1.393 +  def(Bytecodes::_lor                 , ____|____|____|____, ltos, ltos, lop2                , _or          );
   1.394 +  def(Bytecodes::_ixor                , ____|____|____|____, itos, itos, iop2                , _xor         );
   1.395 +  def(Bytecodes::_lxor                , ____|____|____|____, ltos, ltos, lop2                , _xor         );
   1.396 +  def(Bytecodes::_iinc                , ubcp|____|clvm|____, vtos, vtos, iinc                ,  _           );
   1.397 +  def(Bytecodes::_i2l                 , ____|____|____|____, itos, ltos, convert             ,  _           );
   1.398 +  def(Bytecodes::_i2f                 , ____|____|____|____, itos, ftos, convert             ,  _           );
   1.399 +  def(Bytecodes::_i2d                 , ____|____|____|____, itos, dtos, convert             ,  _           );
   1.400 +  def(Bytecodes::_l2i                 , ____|____|____|____, ltos, itos, convert             ,  _           );
   1.401 +  def(Bytecodes::_l2f                 , ____|____|____|____, ltos, ftos, convert             ,  _           );
   1.402 +  def(Bytecodes::_l2d                 , ____|____|____|____, ltos, dtos, convert             ,  _           );
   1.403 +  def(Bytecodes::_f2i                 , ____|____|____|____, ftos, itos, convert             ,  _           );
   1.404 +  def(Bytecodes::_f2l                 , ____|____|____|____, ftos, ltos, convert             ,  _           );
   1.405 +  def(Bytecodes::_f2d                 , ____|____|____|____, ftos, dtos, convert             ,  _           );
   1.406 +  def(Bytecodes::_d2i                 , ____|____|____|____, dtos, itos, convert             ,  _           );
   1.407 +  def(Bytecodes::_d2l                 , ____|____|____|____, dtos, ltos, convert             ,  _           );
   1.408 +  def(Bytecodes::_d2f                 , ____|____|____|____, dtos, ftos, convert             ,  _           );
   1.409 +  def(Bytecodes::_i2b                 , ____|____|____|____, itos, itos, convert             ,  _           );
   1.410 +  def(Bytecodes::_i2c                 , ____|____|____|____, itos, itos, convert             ,  _           );
   1.411 +  def(Bytecodes::_i2s                 , ____|____|____|____, itos, itos, convert             ,  _           );
   1.412 +  def(Bytecodes::_lcmp                , ____|____|____|____, ltos, itos, lcmp                ,  _           );
   1.413 +  def(Bytecodes::_fcmpl               , ____|____|____|____, ftos, itos, float_cmp           , -1           );
   1.414 +  def(Bytecodes::_fcmpg               , ____|____|____|____, ftos, itos, float_cmp           ,  1           );
   1.415 +  def(Bytecodes::_dcmpl               , ____|____|____|____, dtos, itos, double_cmp          , -1           );
   1.416 +  def(Bytecodes::_dcmpg               , ____|____|____|____, dtos, itos, double_cmp          ,  1           );
   1.417 +  def(Bytecodes::_ifeq                , ubcp|____|clvm|____, itos, vtos, if_0cmp             , equal        );
   1.418 +  def(Bytecodes::_ifne                , ubcp|____|clvm|____, itos, vtos, if_0cmp             , not_equal    );
   1.419 +  def(Bytecodes::_iflt                , ubcp|____|clvm|____, itos, vtos, if_0cmp             , less         );
   1.420 +  def(Bytecodes::_ifge                , ubcp|____|clvm|____, itos, vtos, if_0cmp             , greater_equal);
   1.421 +  def(Bytecodes::_ifgt                , ubcp|____|clvm|____, itos, vtos, if_0cmp             , greater      );
   1.422 +  def(Bytecodes::_ifle                , ubcp|____|clvm|____, itos, vtos, if_0cmp             , less_equal   );
   1.423 +  def(Bytecodes::_if_icmpeq           , ubcp|____|clvm|____, itos, vtos, if_icmp             , equal        );
   1.424 +  def(Bytecodes::_if_icmpne           , ubcp|____|clvm|____, itos, vtos, if_icmp             , not_equal    );
   1.425 +  def(Bytecodes::_if_icmplt           , ubcp|____|clvm|____, itos, vtos, if_icmp             , less         );
   1.426 +  def(Bytecodes::_if_icmpge           , ubcp|____|clvm|____, itos, vtos, if_icmp             , greater_equal);
   1.427 +  def(Bytecodes::_if_icmpgt           , ubcp|____|clvm|____, itos, vtos, if_icmp             , greater      );
   1.428 +  def(Bytecodes::_if_icmple           , ubcp|____|clvm|____, itos, vtos, if_icmp             , less_equal   );
   1.429 +  def(Bytecodes::_if_acmpeq           , ubcp|____|clvm|____, atos, vtos, if_acmp             , equal        );
   1.430 +  def(Bytecodes::_if_acmpne           , ubcp|____|clvm|____, atos, vtos, if_acmp             , not_equal    );
   1.431 +  def(Bytecodes::_goto                , ubcp|disp|clvm|____, vtos, vtos, _goto               ,  _           );
   1.432 +  def(Bytecodes::_jsr                 , ubcp|disp|____|____, vtos, vtos, jsr                 ,  _           ); // result is not an oop, so do not transition to atos
   1.433 +  def(Bytecodes::_ret                 , ubcp|disp|____|____, vtos, vtos, ret                 ,  _           );
   1.434 +  def(Bytecodes::_tableswitch         , ubcp|disp|____|____, itos, vtos, tableswitch         ,  _           );
   1.435 +  def(Bytecodes::_lookupswitch        , ubcp|disp|____|____, itos, itos, lookupswitch        ,  _           );
   1.436 +  def(Bytecodes::_ireturn             , ____|disp|clvm|____, itos, itos, _return             , itos         );
   1.437 +  def(Bytecodes::_lreturn             , ____|disp|clvm|____, ltos, ltos, _return             , ltos         );
   1.438 +  def(Bytecodes::_freturn             , ____|disp|clvm|____, ftos, ftos, _return             , ftos         );
   1.439 +  def(Bytecodes::_dreturn             , ____|disp|clvm|____, dtos, dtos, _return             , dtos         );
   1.440 +  def(Bytecodes::_areturn             , ____|disp|clvm|____, atos, atos, _return             , atos         );
   1.441 +  def(Bytecodes::_return              , ____|disp|clvm|____, vtos, vtos, _return             , vtos         );
   1.442 +  def(Bytecodes::_getstatic           , ubcp|____|clvm|____, vtos, vtos, getstatic           , f1_byte      );
   1.443 +  def(Bytecodes::_putstatic           , ubcp|____|clvm|____, vtos, vtos, putstatic           , f2_byte      );
   1.444 +  def(Bytecodes::_getfield            , ubcp|____|clvm|____, vtos, vtos, getfield            , f1_byte      );
   1.445 +  def(Bytecodes::_putfield            , ubcp|____|clvm|____, vtos, vtos, putfield            , f2_byte      );
   1.446 +  def(Bytecodes::_invokevirtual       , ubcp|disp|clvm|____, vtos, vtos, invokevirtual       , f2_byte      );
   1.447 +  def(Bytecodes::_invokespecial       , ubcp|disp|clvm|____, vtos, vtos, invokespecial       , f1_byte      );
   1.448 +  def(Bytecodes::_invokestatic        , ubcp|disp|clvm|____, vtos, vtos, invokestatic        , f1_byte      );
   1.449 +  def(Bytecodes::_invokeinterface     , ubcp|disp|clvm|____, vtos, vtos, invokeinterface     , f1_byte      );
   1.450 +  def(Bytecodes::_invokedynamic       , ubcp|disp|clvm|____, vtos, vtos, invokedynamic       , f1_byte      );
   1.451 +  def(Bytecodes::_new                 , ubcp|____|clvm|____, vtos, atos, _new                ,  _           );
   1.452 +  def(Bytecodes::_newarray            , ubcp|____|clvm|____, itos, atos, newarray            ,  _           );
   1.453 +  def(Bytecodes::_anewarray           , ubcp|____|clvm|____, itos, atos, anewarray           ,  _           );
   1.454 +  def(Bytecodes::_arraylength         , ____|____|____|____, atos, itos, arraylength         ,  _           );
   1.455 +  def(Bytecodes::_athrow              , ____|disp|____|____, atos, vtos, athrow              ,  _           );
   1.456 +  def(Bytecodes::_checkcast           , ubcp|____|clvm|____, atos, atos, checkcast           ,  _           );
   1.457 +  def(Bytecodes::_instanceof          , ubcp|____|clvm|____, atos, itos, instanceof          ,  _           );
   1.458 +  def(Bytecodes::_monitorenter        , ____|disp|clvm|____, atos, vtos, monitorenter        ,  _           );
   1.459 +  def(Bytecodes::_monitorexit         , ____|____|clvm|____, atos, vtos, monitorexit         ,  _           );
   1.460 +  def(Bytecodes::_wide                , ubcp|disp|____|____, vtos, vtos, wide                ,  _           );
   1.461 +  def(Bytecodes::_multianewarray      , ubcp|____|clvm|____, vtos, atos, multianewarray      ,  _           );
   1.462 +  def(Bytecodes::_ifnull              , ubcp|____|clvm|____, atos, vtos, if_nullcmp          , equal        );
   1.463 +  def(Bytecodes::_ifnonnull           , ubcp|____|clvm|____, atos, vtos, if_nullcmp          , not_equal    );
   1.464 +  def(Bytecodes::_goto_w              , ubcp|____|clvm|____, vtos, vtos, goto_w              ,  _           );
   1.465 +  def(Bytecodes::_jsr_w               , ubcp|____|____|____, vtos, vtos, jsr_w               ,  _           );
   1.466 +
   1.467 +  // wide Java spec bytecodes
   1.468 +  def(Bytecodes::_iload               , ubcp|____|____|iswd, vtos, itos, wide_iload          ,  _           );
   1.469 +  def(Bytecodes::_lload               , ubcp|____|____|iswd, vtos, ltos, wide_lload          ,  _           );
   1.470 +  def(Bytecodes::_fload               , ubcp|____|____|iswd, vtos, ftos, wide_fload          ,  _           );
   1.471 +  def(Bytecodes::_dload               , ubcp|____|____|iswd, vtos, dtos, wide_dload          ,  _           );
   1.472 +  def(Bytecodes::_aload               , ubcp|____|____|iswd, vtos, atos, wide_aload          ,  _           );
   1.473 +  def(Bytecodes::_istore              , ubcp|____|____|iswd, vtos, vtos, wide_istore         ,  _           );
   1.474 +  def(Bytecodes::_lstore              , ubcp|____|____|iswd, vtos, vtos, wide_lstore         ,  _           );
   1.475 +  def(Bytecodes::_fstore              , ubcp|____|____|iswd, vtos, vtos, wide_fstore         ,  _           );
   1.476 +  def(Bytecodes::_dstore              , ubcp|____|____|iswd, vtos, vtos, wide_dstore         ,  _           );
   1.477 +  def(Bytecodes::_astore              , ubcp|____|____|iswd, vtos, vtos, wide_astore         ,  _           );
   1.478 +  def(Bytecodes::_iinc                , ubcp|____|____|iswd, vtos, vtos, wide_iinc           ,  _           );
   1.479 +  def(Bytecodes::_ret                 , ubcp|disp|____|iswd, vtos, vtos, wide_ret            ,  _           );
   1.480 +  def(Bytecodes::_breakpoint          , ubcp|disp|clvm|____, vtos, vtos, _breakpoint         ,  _           );
   1.481 +
   1.482 +  // JVM bytecodes
   1.483 +  def(Bytecodes::_fast_agetfield      , ubcp|____|____|____, atos, atos, fast_accessfield    ,  atos        );
   1.484 +  def(Bytecodes::_fast_bgetfield      , ubcp|____|____|____, atos, itos, fast_accessfield    ,  itos        );
   1.485 +  def(Bytecodes::_fast_cgetfield      , ubcp|____|____|____, atos, itos, fast_accessfield    ,  itos        );
   1.486 +  def(Bytecodes::_fast_dgetfield      , ubcp|____|____|____, atos, dtos, fast_accessfield    ,  dtos        );
   1.487 +  def(Bytecodes::_fast_fgetfield      , ubcp|____|____|____, atos, ftos, fast_accessfield    ,  ftos        );
   1.488 +  def(Bytecodes::_fast_igetfield      , ubcp|____|____|____, atos, itos, fast_accessfield    ,  itos        );
   1.489 +  def(Bytecodes::_fast_lgetfield      , ubcp|____|____|____, atos, ltos, fast_accessfield    ,  ltos        );
   1.490 +  def(Bytecodes::_fast_sgetfield      , ubcp|____|____|____, atos, itos, fast_accessfield    ,  itos        );
   1.491 +
   1.492 +  def(Bytecodes::_fast_aputfield      , ubcp|____|____|____, atos, vtos, fast_storefield ,   atos        );
   1.493 +  def(Bytecodes::_fast_bputfield      , ubcp|____|____|____, itos, vtos, fast_storefield ,   itos        );
   1.494 +  def(Bytecodes::_fast_cputfield      , ubcp|____|____|____, itos, vtos, fast_storefield  ,  itos        );
   1.495 +  def(Bytecodes::_fast_dputfield      , ubcp|____|____|____, dtos, vtos, fast_storefield  ,  dtos        );
   1.496 +  def(Bytecodes::_fast_fputfield      , ubcp|____|____|____, ftos, vtos, fast_storefield  ,  ftos        );
   1.497 +  def(Bytecodes::_fast_iputfield      , ubcp|____|____|____, itos, vtos, fast_storefield  ,  itos        );
   1.498 +  def(Bytecodes::_fast_lputfield      , ubcp|____|____|____, ltos, vtos, fast_storefield  ,  ltos        );
   1.499 +  def(Bytecodes::_fast_sputfield      , ubcp|____|____|____, itos, vtos, fast_storefield  ,  itos        );
   1.500 +
   1.501 +  def(Bytecodes::_fast_aload_0        , ____|____|____|____, vtos, atos, aload               ,  0           );
   1.502 +  def(Bytecodes::_fast_iaccess_0      , ubcp|____|____|____, vtos, itos, fast_xaccess        ,  itos        );
   1.503 +  def(Bytecodes::_fast_aaccess_0      , ubcp|____|____|____, vtos, atos, fast_xaccess        ,  atos        );
   1.504 +  def(Bytecodes::_fast_faccess_0      , ubcp|____|____|____, vtos, ftos, fast_xaccess        ,  ftos        );
   1.505 +
   1.506 +  def(Bytecodes::_fast_iload          , ubcp|____|____|____, vtos, itos, fast_iload          ,  _       );
   1.507 +  def(Bytecodes::_fast_iload2         , ubcp|____|____|____, vtos, itos, fast_iload2         ,  _       );
   1.508 +  def(Bytecodes::_fast_icaload        , ubcp|____|____|____, vtos, itos, fast_icaload        ,  _       );
   1.509 +
   1.510 +  def(Bytecodes::_fast_invokevfinal   , ubcp|disp|clvm|____, vtos, vtos, fast_invokevfinal   , f2_byte      );
   1.511 +
   1.512 +  def(Bytecodes::_fast_linearswitch   , ubcp|disp|____|____, itos, vtos, fast_linearswitch   ,  _           );
   1.513 +  def(Bytecodes::_fast_binaryswitch   , ubcp|disp|____|____, itos, vtos, fast_binaryswitch   ,  _           );
   1.514 +
   1.515 +  def(Bytecodes::_fast_aldc           , ubcp|____|clvm|____, vtos, atos, fast_aldc           ,  false       );
   1.516 +  def(Bytecodes::_fast_aldc_w         , ubcp|____|clvm|____, vtos, atos, fast_aldc           ,  true        );
   1.517 +
   1.518 +  def(Bytecodes::_return_register_finalizer , ____|disp|clvm|____, vtos, vtos, _return       ,  vtos        );
   1.519 +
   1.520 +  def(Bytecodes::_invokehandle        , ubcp|disp|clvm|____, vtos, vtos, invokehandle        , f1_byte      );
   1.521 +
   1.522 +  def(Bytecodes::_shouldnotreachhere   , ____|____|____|____, vtos, vtos, shouldnotreachhere ,  _           );
   1.523 +  // platform specific bytecodes
   1.524 +  pd_initialize();
   1.525 +
   1.526 +  _is_initialized = true;
   1.527 +}
   1.528 +
   1.529 +#if defined(TEMPLATE_TABLE_BUG)
   1.530 +  #undef iload
   1.531 +  #undef lload
   1.532 +  #undef fload
   1.533 +  #undef dload
   1.534 +  #undef aload
   1.535 +  #undef istore
   1.536 +  #undef lstore
   1.537 +  #undef fstore
   1.538 +  #undef dstore
   1.539 +  #undef astore
   1.540 +#endif // TEMPLATE_TABLE_BUG
   1.541 +
   1.542 +
   1.543 +void templateTable_init() {
   1.544 +  TemplateTable::initialize();
   1.545 +}
   1.546 +
   1.547 +
   1.548 +void TemplateTable::unimplemented_bc() {
   1.549 +  _masm->unimplemented( Bytecodes::name(_desc->bytecode()));
   1.550 +}
   1.551 +#endif /* !CC_INTERP */

mercurial