Skip to content

Commit 3a21e1d

Browse files
author
Nils Eliasson
committed
8260653: Unreachable nodes keep speculative types alive
Reviewed-by: vlivanov, thartmann
1 parent b695c7e commit 3a21e1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/hotspot/share/opto/phaseX.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,15 @@ void NodeHash::remove_useless_nodes(VectorSet &useful) {
330330
void NodeHash::check_no_speculative_types() {
331331
#ifdef ASSERT
332332
uint max = size();
333+
Unique_Node_List live_nodes;
334+
Compile::current()->identify_useful_nodes(live_nodes);
333335
Node *sentinel_node = sentinel();
334336
for (uint i = 0; i < max; ++i) {
335337
Node *n = at(i);
336-
if(n != NULL && n != sentinel_node && n->is_Type() && n->outcnt() > 0) {
338+
if (n != NULL &&
339+
n != sentinel_node &&
340+
n->is_Type() &&
341+
live_nodes.member(n)) {
337342
TypeNode* tn = n->as_Type();
338343
const Type* t = tn->type();
339344
const Type* t_no_spec = t->remove_speculative();

0 commit comments

Comments
 (0)