diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp index f3142ce..32e8118 100644 --- a/src/hotspot/share/opto/node.cpp +++ b/src/hotspot/share/opto/node.cpp @@ -23,6 +23,8 @@ */ #include "precompiled.hpp" +#include "gc/shared/barrierSet.hpp" +#include "gc/shared/c2/barrierSetC2.hpp" #include "libadt/vectset.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" @@ -37,6 +39,7 @@ #include "opto/regmask.hpp" #include "opto/type.hpp" #include "utilities/copy.hpp" +#include "utilities/macros.hpp" class RegMask; // #include "phase.hpp" @@ -499,6 +502,8 @@ Node *Node::clone() const { C->add_macro_node(n); if (is_expensive()) C->add_expensive_node(n); + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + bs->register_potential_barrier_node(n); // If the cloned node is a range check dependent CastII, add it to the list. CastIINode* cast = n->isa_CastII(); if (cast != NULL && cast->has_range_check()) { @@ -622,6 +627,8 @@ void Node::destruct() { if (is_SafePoint()) { as_SafePoint()->delete_replaced_nodes(); } + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + bs->unregister_potential_barrier_node(this); #ifdef ASSERT // We will not actually delete the storage, but we'll make the node unusable. *(address*)this = badAddress; // smash the C++ vtbl, probably @@ -1361,6 +1368,8 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { if (dead->Opcode() == Op_Opaque4) { igvn->C->remove_range_check_cast(dead); } + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + bs->unregister_potential_barrier_node(dead); igvn->C->record_dead_node(dead->_idx); // Kill all inputs to the dead guy for (uint i=0; i < dead->req(); i++) { @@ -1379,6 +1388,8 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { // The restriction (outcnt() <= 2) is the same as in set_req_X() // and remove_globally_dead_node(). igvn->add_users_to_worklist( n ); + } else { + BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn->_worklist, n); } } }