hotspot/src/share/vm/opto/node.cpp
changeset 35574 2b25eb88c8d6
parent 35551 36ef3841fb34
child 36336 7006dd73b206
equal deleted inserted replaced
35573:e6c6e7a3b036 35574:2b25eb88c8d6
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "libadt/vectset.hpp"
    26 #include "libadt/vectset.hpp"
    27 #include "memory/allocation.inline.hpp"
    27 #include "memory/allocation.inline.hpp"
       
    28 #include "opto/castnode.hpp"
    28 #include "opto/cfgnode.hpp"
    29 #include "opto/cfgnode.hpp"
    29 #include "opto/connode.hpp"
    30 #include "opto/connode.hpp"
    30 #include "opto/loopnode.hpp"
    31 #include "opto/loopnode.hpp"
    31 #include "opto/machnode.hpp"
    32 #include "opto/machnode.hpp"
    32 #include "opto/matcher.hpp"
    33 #include "opto/matcher.hpp"
   514   }
   515   }
   515   if (is_macro())
   516   if (is_macro())
   516     C->add_macro_node(n);
   517     C->add_macro_node(n);
   517   if (is_expensive())
   518   if (is_expensive())
   518     C->add_expensive_node(n);
   519     C->add_expensive_node(n);
       
   520   // If the cloned node is a range check dependent CastII, add it to the list.
       
   521   CastIINode* cast = n->isa_CastII();
       
   522   if (cast != NULL && cast->has_range_check()) {
       
   523     C->add_range_check_cast(cast);
       
   524   }
   519 
   525 
   520   n->set_idx(C->next_unique()); // Get new unique index as well
   526   n->set_idx(C->next_unique()); // Get new unique index as well
   521   debug_only( n->verify_construction() );
   527   debug_only( n->verify_construction() );
   522   NOT_PRODUCT(nodes_created++);
   528   NOT_PRODUCT(nodes_created++);
   523   // Do not patch over the debug_idx of a clone, because it makes it
   529   // Do not patch over the debug_idx of a clone, because it makes it
   642     compile->remove_macro_node(this);
   648     compile->remove_macro_node(this);
   643   }
   649   }
   644   if (is_expensive()) {
   650   if (is_expensive()) {
   645     compile->remove_expensive_node(this);
   651     compile->remove_expensive_node(this);
   646   }
   652   }
       
   653   CastIINode* cast = isa_CastII();
       
   654   if (cast != NULL && cast->has_range_check()) {
       
   655     compile->remove_range_check_cast(cast);
       
   656   }
       
   657 
   647   if (is_SafePoint()) {
   658   if (is_SafePoint()) {
   648     as_SafePoint()->delete_replaced_nodes();
   659     as_SafePoint()->delete_replaced_nodes();
   649   }
   660   }
   650 #ifdef ASSERT
   661 #ifdef ASSERT
   651   // We will not actually delete the storage, but we'll make the node unusable.
   662   // We will not actually delete the storage, but we'll make the node unusable.
  1377         igvn->C->remove_macro_node(dead);
  1388         igvn->C->remove_macro_node(dead);
  1378       }
  1389       }
  1379       if (dead->is_expensive()) {
  1390       if (dead->is_expensive()) {
  1380         igvn->C->remove_expensive_node(dead);
  1391         igvn->C->remove_expensive_node(dead);
  1381       }
  1392       }
       
  1393       CastIINode* cast = dead->isa_CastII();
       
  1394       if (cast != NULL && cast->has_range_check()) {
       
  1395         igvn->C->remove_range_check_cast(cast);
       
  1396       }
  1382       igvn->C->record_dead_node(dead->_idx);
  1397       igvn->C->record_dead_node(dead->_idx);
  1383       // Kill all inputs to the dead guy
  1398       // Kill all inputs to the dead guy
  1384       for (uint i=0; i < dead->req(); i++) {
  1399       for (uint i=0; i < dead->req(); i++) {
  1385         Node *n = dead->in(i);      // Get input to dead guy
  1400         Node *n = dead->in(i);      // Get input to dead guy
  1386         if (n != NULL && !n->is_top()) { // Input is valid?
  1401         if (n != NULL && !n->is_top()) { // Input is valid?