diff src/share/vm/opto/phaseX.cpp @ 14383:5ec7dace41a6

8027422: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed Summary: type methods shouldn't always operate on speculative part Reviewed-by: kvn, twisti
author roland
date Fri, 24 Jan 2014 09:31:53 +0100
parents de6a9e811145
children 4ca6dc0799b6 968a17f18337 78bbf4d43a14
line wrap: on
line diff
--- a/src/share/vm/opto/phaseX.cpp	Thu Jan 23 01:23:23 2014 +0400
+++ b/src/share/vm/opto/phaseX.cpp	Fri Jan 24 09:31:53 2014 +0100
@@ -323,6 +323,23 @@
   }
 }
 
+
+void NodeHash::check_no_speculative_types() {
+#ifdef ASSERT
+  uint max = size();
+  Node *sentinel_node = sentinel();
+  for (uint i = 0; i < max; ++i) {
+    Node *n = at(i);
+    if(n != NULL && n != sentinel_node && n->is_Type()) {
+      TypeNode* tn = n->as_Type();
+      const Type* t = tn->type();
+      const Type* t_no_spec = t->remove_speculative();
+      assert(t == t_no_spec, "dead node in hash table or missed node during speculative cleanup");
+    }
+  }
+#endif
+}
+
 #ifndef PRODUCT
 //------------------------------dump-------------------------------------------
 // Dump statistics for the hash table
@@ -1392,11 +1409,11 @@
   assert(UseTypeSpeculation, "speculation is off");
   for (uint i = 0; i < _types.Size(); i++)  {
     const Type* t = _types.fast_lookup(i);
-    if (t != NULL && t->isa_oopptr()) {
-      const TypeOopPtr* to = t->is_oopptr();
-      _types.map(i, to->remove_speculative());
+    if (t != NULL) {
+      _types.map(i, t->remove_speculative());
     }
   }
+  _table.check_no_speculative_types();
 }
 
 //=============================================================================