src/share/vm/interpreter/templateTable.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8148630.01 Sdiff src/share/vm/interpreter

src/share/vm/interpreter/templateTable.cpp

Print this page




   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/timer.hpp"
  30 
  31 
  32 #ifdef CC_INTERP
  33 
  34 void templateTable_init() {
  35 }
  36 
  37 #else
  38 
  39 //----------------------------------------------------------------------------------------------------
  40 // Implementation of Template
  41 
  42 
  43 void Template::initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg) {
  44   _flags   = flags;
  45   _tos_in  = tos_in;
  46   _tos_out = tos_out;
  47   _gen     = gen;
  48   _arg     = arg;
  49 }
  50 


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




   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/logTimer.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;
  47   _arg     = arg;
  48 }
  49 


 228 // table init if this macro is not defined.  My symptom was an assertion
 229 // assert(Universe::heap()->is_in(obj), "sanity check") in handles.cpp line 24.
 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   TraceStartupTime timer("TemplateTable initialization");
 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           );


src/share/vm/interpreter/templateTable.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File