changeset 12970:09e0f8359f51

Quick fix for invokedirect removal
author fparain
date Tue, 09 May 2017 11:04:18 -0400
parents 1cb1c8adad0f
children ea4e40c96846
files src/share/vm/oops/generateOopMap.cpp src/share/vm/oops/generateOopMap.hpp
diffstat 2 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/oops/generateOopMap.cpp	Thu May 04 12:52:49 2017 +0100
+++ b/src/share/vm/oops/generateOopMap.cpp	Tue May 09 11:04:18 2017 -0400
@@ -131,15 +131,12 @@
   ComputeCallStack(Symbol* signature) : SignatureIterator(signature) {};
 
   // Compute methods
-  int compute_for_parameters(bool is_static, bool is_direct, CellTypeState *effect) {
+  int compute_for_parameters(bool is_static, CellTypeState *effect) {
     _idx    = 0;
     _effect = effect;
 
-    if (is_direct) {
-      effect[_idx++] = CellTypeState::valuetype;
-    }
-    else if (!is_static) {
-      effect[_idx++] = CellTypeState::ref;
+    if (!is_static) {
+      effect[_idx++] = CellTypeState::refOrValueType;
     }
 
     iterate_parameters();
@@ -294,6 +291,7 @@
 CellTypeState CellTypeState::ref         = CellTypeState::make_any(ref_conflict);
 CellTypeState CellTypeState::value       = CellTypeState::make_any(val_value);
 CellTypeState CellTypeState::valuetype   = CellTypeState::make_any(valuetype_conflict);
+CellTypeState CellTypeState::refOrValueType = CellTypeState::make_any(valuetype_conflict | ref_conflict);
 CellTypeState CellTypeState::refUninit   = CellTypeState::make_any(ref_conflict | uninit_value);
 CellTypeState CellTypeState::top         = CellTypeState::make_top();
 CellTypeState CellTypeState::addr        = CellTypeState::make_any(addr_conflict);
@@ -1615,9 +1613,9 @@
 
     case Bytecodes::_invokeinterface:
     case Bytecodes::_invokevirtual:
-    case Bytecodes::_invokespecial:     do_method(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
-    case Bytecodes::_invokestatic:      do_method(true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
-    case Bytecodes::_invokedynamic:     do_method(true,  false, itr->get_index_u4(),         itr->bci()); break;
+    case Bytecodes::_invokespecial:     do_method(false, itr->get_index_u2_cpcache(), itr->bci()); break;
+    case Bytecodes::_invokestatic:      do_method(true , itr->get_index_u2_cpcache(), itr->bci()); break;
+    case Bytecodes::_invokedynamic:     do_method(true , itr->get_index_u4(),         itr->bci()); break;
     case Bytecodes::_newarray:
     case Bytecodes::_anewarray:         pp_new_ref(vCTS, itr->bci()); break;
     case Bytecodes::_checkcast:         do_checkcast(); break;
@@ -1664,6 +1662,9 @@
 
 void GenerateOopMap::check_type(CellTypeState expected, CellTypeState actual) {
   if (!expected.equal_kind(actual)) {
+    // dirty hack for invokevirtual
+    if (expected.equal_kind(CellTypeState::refOrValueType) &&
+        (actual.equal_kind(CellTypeState::ref) || actual.equal_kind(CellTypeState::valuetype))) return;
     verify_error("wrong type on stack (found: %c expected: %c)", actual.to_char(), expected.to_char());
   }
 }
@@ -1999,7 +2000,7 @@
   pp(in, out);
 }
 
-void GenerateOopMap::do_method(int is_static, int is_direct, int idx, int bci) {
+void GenerateOopMap::do_method(int is_static, int idx, int bci) {
  // Dig up signature for field in constant pool
   ConstantPool* cp  = _method->constants();
   Symbol* signature   = cp->signature_ref_at(idx);
@@ -2020,7 +2021,7 @@
   assert(res_length<=4, "max value should be vv");
 
   // Compute arguments
-  int arg_length = cse.compute_for_parameters(is_static != 0, is_direct != 0, in);
+  int arg_length = cse.compute_for_parameters(is_static != 0, in);
   assert(arg_length<=MAXARGSIZE, "too many locals");
 
   // Pop arguments
--- a/src/share/vm/oops/generateOopMap.hpp	Thu May 04 12:52:49 2017 +0100
+++ b/src/share/vm/oops/generateOopMap.hpp	Tue May 09 11:04:18 2017 -0400
@@ -261,6 +261,7 @@
   static CellTypeState ref;
   static CellTypeState value;
   static CellTypeState valuetype;
+  static CellTypeState refOrValueType;
   static CellTypeState refUninit;
   static CellTypeState varUninit;
   static CellTypeState top;
@@ -427,7 +428,7 @@
   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_method                           (int is_static, int is_direct, 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);
   void  do_monitorenter                     (int bci);