diff src/share/vm/opto/parse1.cpp @ 23848:3e1cd663c2d3

8055530: assert(_exits.control()->is_top() || !_gvn.type(ret_phi)->empty()) failed: return value must be well defined Summary: concurrent class loading causes return phi to become top Reviewed-by: kvn
author shshahma
date Fri, 15 Apr 2016 12:02:37 +0530
parents 626f594dffa6
children 09687c445ce1
line wrap: on
line diff
--- a/src/share/vm/opto/parse1.cpp	Thu Apr 21 13:17:25 2016 +0200
+++ b/src/share/vm/opto/parse1.cpp	Fri Apr 15 12:02:37 2016 +0530
@@ -27,6 +27,7 @@
 #include "interpreter/linkResolver.hpp"
 #include "oops/method.hpp"
 #include "opto/addnode.hpp"
+#include "opto/c2compiler.hpp"
 #include "opto/idealGraphPrinter.hpp"
 #include "opto/locknode.hpp"
 #include "opto/memnode.hpp"
@@ -957,7 +958,18 @@
   if (tf()->range()->cnt() > TypeFunc::Parms) {
     const Type* ret_type = tf()->range()->field_at(TypeFunc::Parms);
     Node*       ret_phi  = _gvn.transform( _exits.argument(0) );
-    assert(_exits.control()->is_top() || !_gvn.type(ret_phi)->empty(), "return value must be well defined");
+    if (!_exits.control()->is_top() && _gvn.type(ret_phi)->empty()) {
+      // In case of concurrent class loading, the type we set for the
+      // ret_phi in build_exits() may have been too optimistic and the
+      // ret_phi may be top now.
+#ifdef ASSERT
+      {
+        MutexLockerEx ml(Compile_lock, Mutex::_no_safepoint_check_flag);
+        assert(ret_type->isa_ptr() && C->env()->system_dictionary_modification_counter_changed(), "return value must be well defined");
+      }
+#endif
+      C->record_failure(C2Compiler::retry_class_loading_during_parsing());
+    }
     _exits.push_node(ret_type->basic_type(), ret_phi);
   }