--- a/hotspot/src/share/vm/opto/phaseX.cpp Thu Jan 23 01:23:23 2014 +0400
+++ b/hotspot/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();
}
//=============================================================================