changeset 13392:9f87e6962c0d mvt

8185453: [MVT] Crash with "assert(number_of_codes <= 256) failed: too many bytecodes" Reviewed-by: mcimadamore, acorn
author thartmann
date Fri, 28 Jul 2017 14:52:47 +0200
parents d792261d52f2
children e6b97a7f1d8f
files src/share/vm/interpreter/bytecodes.cpp src/share/vm/interpreter/bytecodes.hpp src/share/vm/interpreter/templateTable.cpp src/share/vm/oops/generateOopMap.cpp src/share/vm/oops/generateOopMap.hpp src/share/vm/opto/parse.hpp src/share/vm/opto/parse2.cpp src/share/vm/opto/parse3.cpp
diffstat 8 files changed, 24 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/interpreter/bytecodes.cpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/interpreter/bytecodes.cpp	Fri Jul 28 14:52:47 2017 +0200
@@ -486,7 +486,6 @@
   def(_vaload              , "vaload"              , "b"    , NULL    , T_VALUETYPE, -1, true);
   def(_vastore             , "vastore"             , "b"    , NULL    , T_VOID   , -3, true );
   def(_vreturn             , "vreturn"             , "b"    , NULL    , T_VALUETYPE, -1, true);
-  def(_vgetfield           , "vgetfield"           , "bJJ"  , NULL    , T_ILLEGAL,  0, true );
   def(_vbox                , "vbox"                , "bkk"  , NULL    , T_OBJECT ,  0, true );
   def(_vunbox              , "vunbox"              , "bkk"  , NULL    , T_VALUETYPE,0, true );
   def(_vdefault            , "vdefault"            , "bkk"  , NULL    , T_VALUETYPE, 1, true);
@@ -543,6 +542,7 @@
 
   def(_nofast_aload_0      , "nofast_aload_0"      , "b"    , NULL    , T_ILLEGAL,  1, true , _aload_0        );
   def(_nofast_iload        , "nofast_iload"        , "bi"   , NULL    , T_ILLEGAL,  1, false, _iload          );
+  def(_vgetfield           , "vgetfield"           , "bJJ"  , NULL    , T_ILLEGAL,  0, true , _getfield       );
 
   def(_shouldnotreachhere  , "_shouldnotreachhere" , "b"    , NULL    , T_VOID   ,  0, false);
 
--- a/src/share/vm/interpreter/bytecodes.hpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/interpreter/bytecodes.hpp	Fri Jul 28 14:52:47 2017 +0200
@@ -248,11 +248,11 @@
     _vstore               = 204, // 0xcc
     _vaload               = 205, // 0xcd
     _vastore              = 206, // 0xce
-    _vreturn              = 210, // 0xd2
-    _vdefault             = 214, // 0xd6
-    _vwithfield           = 215, // 0xd7
-    _vbox                 = 216, // 0xd6
-    _vunbox               = 217, // 0xd7
+    _vreturn              = 207, // 0xcf
+    _vdefault             = 208, // 0xd0
+    _vwithfield           = 209, // 0xd1
+    _vbox                 = 210, // 0xd2
+    _vunbox               = 211, // 0xd3
 
     number_of_java_codes,
 
--- a/src/share/vm/interpreter/templateTable.cpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/interpreter/templateTable.cpp	Fri Jul 28 14:52:47 2017 +0200
@@ -466,7 +466,6 @@
   def(Bytecodes::_vaload              , ____|____|clvm|____, itos, qtos, vaload              ,  _           );
   def(Bytecodes::_vastore             , ____|____|clvm|____, vtos, vtos, vastore             ,  _           );
   def(Bytecodes::_vreturn             , ____|disp|clvm|____, qtos, qtos, _return             , qtos         );
-  def(Bytecodes::_vgetfield           , ubcp|____|clvm|____, vtos, vtos, vgetfield           , _            );
   def(Bytecodes::_vdefault            , ubcp|____|clvm|____, vtos, qtos, vdefault            , _            );
   def(Bytecodes::_vwithfield          , ubcp|____|clvm|____, vtos, qtos, vwithfield          , _            );
   def(Bytecodes::_vbox                , ubcp|____|clvm|____, qtos, atos, _vbox               , _            );
@@ -538,6 +537,8 @@
   def(Bytecodes::_nofast_aload_0      , ____|____|clvm|____, vtos, atos, nofast_aload_0      ,  _           );
   def(Bytecodes::_nofast_iload        , ubcp|____|clvm|____, vtos, itos, nofast_iload        ,  _           );
 
+  def(Bytecodes::_vgetfield           , ubcp|____|clvm|____, vtos, vtos, vgetfield           , _            );
+
   def(Bytecodes::_shouldnotreachhere   , ____|____|____|____, vtos, vtos, shouldnotreachhere ,  _           );
   // platform specific bytecodes
   pd_initialize();
--- a/src/share/vm/oops/generateOopMap.cpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/oops/generateOopMap.cpp	Fri Jul 28 14:52:47 2017 +0200
@@ -1605,11 +1605,10 @@
 
 
 
-    case Bytecodes::_getstatic:         do_field(true,  true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
-    case Bytecodes::_putstatic:         do_field(false, true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
-    case Bytecodes::_getfield:          do_field(true,  false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
-    case Bytecodes::_putfield:          do_field(false, false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
-    case Bytecodes::_vgetfield:         do_field(true,  false, true , itr->get_index_u2_cpcache(), itr->bci()); break;
+    case Bytecodes::_getstatic:         do_field(true,  true, itr->get_index_u2_cpcache(), itr->bci()); break;
+    case Bytecodes::_putstatic:         do_field(false, true, itr->get_index_u2_cpcache(), itr->bci()); break;
+    case Bytecodes::_getfield:          do_field(true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
+    case Bytecodes::_putfield:          do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
 
     case Bytecodes::_invokeinterface:
     case Bytecodes::_invokevirtual:
@@ -1963,8 +1962,7 @@
   return idx;
 }
 
-void GenerateOopMap::do_field(int is_get, int is_static, int is_valuetype, int idx, int bci) {
-  assert(!(!is_get && is_valuetype), "Invalid configuration: vputfield doesn't exist");
+void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) {
   // Dig up signature for field in constant pool
   ConstantPool* cp     = method()->constants();
   int nameAndTypeIdx     = cp->name_and_type_ref_index_at(idx);
@@ -1989,11 +1987,7 @@
     i   = copy_cts(in, eff);
   }
   if (!is_static) {
-    if (is_valuetype) {
-      in[i++] = CellTypeState::valuetype;
-    } else {
-      in[i++] = CellTypeState::ref;
-    }
+    in[i++] = CellTypeState::refOrValueType;
   }
   in[i] = CellTypeState::bottom;
   assert(i<=3, "sanity check");
--- a/src/share/vm/oops/generateOopMap.hpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/oops/generateOopMap.hpp	Fri Jul 28 14:52:47 2017 +0200
@@ -427,7 +427,7 @@
   void  do_astore                           (int idx);
   void  do_vstore                           (int idx);
   void  do_jsr                              (int delta);
-  void  do_field                            (int is_get, int is_static, int is_valuetype, int idx, int bci);
+  void  do_field                            (int is_get, int is_static, int idx, int bci);
   void  do_method                           (int is_static, int idx, int bci);
   void  do_vwithfield                       (int idx, int bci);
   void  do_multianewarray                   (int dims, int bci);
--- a/src/share/vm/opto/parse.hpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/opto/parse.hpp	Fri Jul 28 14:52:47 2017 +0200
@@ -515,7 +515,6 @@
   // implementation of _get* and _put* bytecodes
   void do_getstatic() { do_field_access(true,  false); }
   void do_getfield () { do_field_access(true,  true); }
-  void do_vgetfield();
   void do_putstatic() { do_field_access(false, false); }
   void do_putfield () { do_field_access(false, true); }
 
--- a/src/share/vm/opto/parse2.cpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/opto/parse2.cpp	Fri Jul 28 14:52:47 2017 +0200
@@ -1801,10 +1801,6 @@
     do_getfield();
     break;
 
-  case Bytecodes::_vgetfield:
-    do_vgetfield();
-    break;
-
   case Bytecodes::_getstatic:
     do_getstatic();
     break;
--- a/src/share/vm/opto/parse3.cpp	Thu Jul 27 17:04:46 2017 -0400
+++ b/src/share/vm/opto/parse3.cpp	Fri Jul 28 14:52:47 2017 +0200
@@ -86,6 +86,15 @@
 
   ciInstanceKlass* field_holder = field->holder();
 
+  if (is_field && field_holder->is_valuetype()) {
+    assert(is_get, "value type field store not supported");
+    BasicType bt = field->layout_type();
+    ValueTypeNode* vt = pop()->as_ValueType();
+    Node* value = vt->field_value_by_offset(field->offset());
+    push_node(bt, value);
+    return;
+  }
+
   if (is_field == field->is_static()) {
     // Interpreter will throw java_lang_IncompatibleClassChangeError
     // Check this before allowing <clinit> methods to access static fields
@@ -146,16 +155,6 @@
   }
 }
 
-void Parse::do_vgetfield() {
-  // fixme null/top check?
-  bool will_link;
-  ciField* field = iter().get_field(will_link);
-  BasicType bt = field->layout_type();
-  ValueTypeNode* vt = pop()->as_ValueType();
-  Node* value = vt->field_value_by_offset(field->offset());
-  push_node(bt, value);
-}
-
 void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
   BasicType bt = field->layout_type();