< prev index next >

src/hotspot/share/interpreter/templateTable.cpp

Print this page




   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 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 "gc/shared/collectedHeap.hpp"
  27 #include "interpreter/interp_masm.hpp"
  28 #include "interpreter/templateTable.hpp"
  29 #include "runtime/timerTrace.hpp"
  30 
  31 #ifdef CC_INTERP
  32 
  33 void templateTable_init() {
  34 }
  35 
  36 #else
  37 
  38 //----------------------------------------------------------------------------------------------------
  39 // Implementation of Template
  40 
  41 
  42 void Template::initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg) {
  43   _flags   = flags;
  44   _tos_in  = tos_in;
  45   _tos_out = tos_out;
  46   _gen     = gen;


 230 // when called from interpreterRuntime.resolve_invoke().
 231 //
 232   #define iload  TemplateTable::iload
 233   #define lload  TemplateTable::lload
 234   #define fload  TemplateTable::fload
 235   #define dload  TemplateTable::dload
 236   #define aload  TemplateTable::aload
 237   #define istore TemplateTable::istore
 238   #define lstore TemplateTable::lstore
 239   #define fstore TemplateTable::fstore
 240   #define dstore TemplateTable::dstore
 241   #define astore TemplateTable::astore
 242 #endif // TEMPLATE_TABLE_BUG
 243 
 244 void TemplateTable::initialize() {
 245   if (_is_initialized) return;
 246 
 247   // Initialize table
 248   TraceTime timer("TemplateTable initialization", TRACETIME_LOG(Info, startuptime));
 249 
 250   _bs = Universe::heap()->barrier_set();
 251 
 252   // For better readability
 253   const char _    = ' ';
 254   const int  ____ = 0;
 255   const int  ubcp = 1 << Template::uses_bcp_bit;
 256   const int  disp = 1 << Template::does_dispatch_bit;
 257   const int  clvm = 1 << Template::calls_vm_bit;
 258   const int  iswd = 1 << Template::wide_bit;
 259   //                                    interpr. templates
 260   // Java spec bytecodes                ubcp|disp|clvm|iswd  in    out   generator             argument
 261   def(Bytecodes::_nop                 , ____|____|____|____, vtos, vtos, nop                 ,  _           );
 262   def(Bytecodes::_aconst_null         , ____|____|____|____, vtos, atos, aconst_null         ,  _           );
 263   def(Bytecodes::_iconst_m1           , ____|____|____|____, vtos, itos, iconst              , -1           );
 264   def(Bytecodes::_iconst_0            , ____|____|____|____, vtos, itos, iconst              ,  0           );
 265   def(Bytecodes::_iconst_1            , ____|____|____|____, vtos, itos, iconst              ,  1           );
 266   def(Bytecodes::_iconst_2            , ____|____|____|____, vtos, itos, iconst              ,  2           );
 267   def(Bytecodes::_iconst_3            , ____|____|____|____, vtos, itos, iconst              ,  3           );
 268   def(Bytecodes::_iconst_4            , ____|____|____|____, vtos, itos, iconst              ,  4           );
 269   def(Bytecodes::_iconst_5            , ____|____|____|____, vtos, itos, iconst              ,  5           );
 270   def(Bytecodes::_lconst_0            , ____|____|____|____, vtos, ltos, lconst              ,  0           );




   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 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 "gc/shared/barrierSet.hpp"
  27 #include "interpreter/interp_masm.hpp"
  28 #include "interpreter/templateTable.hpp"
  29 #include "runtime/timerTrace.hpp"
  30 
  31 #ifdef CC_INTERP
  32 
  33 void templateTable_init() {
  34 }
  35 
  36 #else
  37 
  38 //----------------------------------------------------------------------------------------------------
  39 // Implementation of Template
  40 
  41 
  42 void Template::initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg) {
  43   _flags   = flags;
  44   _tos_in  = tos_in;
  45   _tos_out = tos_out;
  46   _gen     = gen;


 230 // when called from interpreterRuntime.resolve_invoke().
 231 //
 232   #define iload  TemplateTable::iload
 233   #define lload  TemplateTable::lload
 234   #define fload  TemplateTable::fload
 235   #define dload  TemplateTable::dload
 236   #define aload  TemplateTable::aload
 237   #define istore TemplateTable::istore
 238   #define lstore TemplateTable::lstore
 239   #define fstore TemplateTable::fstore
 240   #define dstore TemplateTable::dstore
 241   #define astore TemplateTable::astore
 242 #endif // TEMPLATE_TABLE_BUG
 243 
 244 void TemplateTable::initialize() {
 245   if (_is_initialized) return;
 246 
 247   // Initialize table
 248   TraceTime timer("TemplateTable initialization", TRACETIME_LOG(Info, startuptime));
 249 
 250   _bs = BarrierSet::barrier_set();
 251 
 252   // For better readability
 253   const char _    = ' ';
 254   const int  ____ = 0;
 255   const int  ubcp = 1 << Template::uses_bcp_bit;
 256   const int  disp = 1 << Template::does_dispatch_bit;
 257   const int  clvm = 1 << Template::calls_vm_bit;
 258   const int  iswd = 1 << Template::wide_bit;
 259   //                                    interpr. templates
 260   // Java spec bytecodes                ubcp|disp|clvm|iswd  in    out   generator             argument
 261   def(Bytecodes::_nop                 , ____|____|____|____, vtos, vtos, nop                 ,  _           );
 262   def(Bytecodes::_aconst_null         , ____|____|____|____, vtos, atos, aconst_null         ,  _           );
 263   def(Bytecodes::_iconst_m1           , ____|____|____|____, vtos, itos, iconst              , -1           );
 264   def(Bytecodes::_iconst_0            , ____|____|____|____, vtos, itos, iconst              ,  0           );
 265   def(Bytecodes::_iconst_1            , ____|____|____|____, vtos, itos, iconst              ,  1           );
 266   def(Bytecodes::_iconst_2            , ____|____|____|____, vtos, itos, iconst              ,  2           );
 267   def(Bytecodes::_iconst_3            , ____|____|____|____, vtos, itos, iconst              ,  3           );
 268   def(Bytecodes::_iconst_4            , ____|____|____|____, vtos, itos, iconst              ,  4           );
 269   def(Bytecodes::_iconst_5            , ____|____|____|____, vtos, itos, iconst              ,  5           );
 270   def(Bytecodes::_lconst_0            , ____|____|____|____, vtos, ltos, lconst              ,  0           );


< prev index next >