< prev index next >

src/hotspot/share/opto/node.cpp

Print this page

  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "gc/shared/barrierSet.hpp"
  28 #include "gc/shared/c2/barrierSetC2.hpp"
  29 #include "libadt/vectset.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "opto/ad.hpp"
  33 #include "opto/callGenerator.hpp"
  34 #include "opto/castnode.hpp"
  35 #include "opto/cfgnode.hpp"
  36 #include "opto/connode.hpp"

  37 #include "opto/loopnode.hpp"
  38 #include "opto/machnode.hpp"
  39 #include "opto/matcher.hpp"
  40 #include "opto/node.hpp"
  41 #include "opto/opcodes.hpp"
  42 #include "opto/regmask.hpp"
  43 #include "opto/rootnode.hpp"
  44 #include "opto/type.hpp"
  45 #include "utilities/copy.hpp"
  46 #include "utilities/macros.hpp"
  47 #include "utilities/powerOfTwo.hpp"
  48 #include "utilities/stringUtils.hpp"
  49 
  50 class RegMask;
  51 // #include "phase.hpp"
  52 class PhaseTransform;
  53 class PhaseGVN;
  54 
  55 // Arena we are currently building Nodes in
  56 const uint Node::NotAMachineReg = 0xffff0000;

 543     }
 544   }
 545   if (n->is_Call()) {
 546     // CallGenerator is linked to the original node.
 547     CallGenerator* cg = n->as_Call()->generator();
 548     if (cg != nullptr) {
 549       CallGenerator* cloned_cg = cg->with_call_node(n->as_Call());
 550       n->as_Call()->set_generator(cloned_cg);
 551 
 552       C->print_inlining_assert_ready();
 553       C->print_inlining_move_to(cg);
 554       C->print_inlining_update(cloned_cg);
 555     }
 556   }
 557   if (n->is_SafePoint()) {
 558     // Scalar replacement and macro expansion might modify the JVMState.
 559     // Clone it to make sure it's not shared between SafePointNodes.
 560     n->as_SafePoint()->clone_jvms(C);
 561     n->as_SafePoint()->clone_replaced_nodes();
 562   }



 563   Compile::current()->record_modified_node(n);
 564   return n;                     // Return the clone
 565 }
 566 
 567 //---------------------------setup_is_top--------------------------------------
 568 // Call this when changing the top node, to reassert the invariants
 569 // required by Node::is_top.  See Compile::set_cached_top_node.
 570 void Node::setup_is_top() {
 571   if (this == (Node*)Compile::current()->top()) {
 572     // This node has just become top.  Kill its out array.
 573     _outcnt = _outmax = 0;
 574     _out = nullptr;                           // marker value for top
 575     assert(is_top(), "must be top");
 576   } else {
 577     if (_out == nullptr)  _out = NO_OUT_ARRAY;
 578     assert(!is_top(), "must not be top");
 579   }
 580 }
 581 
 582 //------------------------------~Node------------------------------------------

 603     set_req(i, nullptr);
 604     //assert(def->out(def->outcnt()-1) == (Node *)this,"bad def-use hacking in reclaim");
 605   }
 606   assert(outcnt() == 0, "deleting a node must not leave a dangling use");
 607 
 608   if (is_macro()) {
 609     compile->remove_macro_node(this);
 610   }
 611   if (is_expensive()) {
 612     compile->remove_expensive_node(this);
 613   }
 614   if (is_Opaque4()) {
 615     compile->remove_template_assertion_predicate_opaq(this);
 616   }
 617   if (is_ParsePredicate()) {
 618     compile->remove_parse_predicate(as_ParsePredicate());
 619   }
 620   if (for_post_loop_opts_igvn()) {
 621     compile->remove_from_post_loop_opts_igvn(this);
 622   }



 623 
 624   if (is_SafePoint()) {
 625     as_SafePoint()->delete_replaced_nodes();
 626 
 627     if (is_CallStaticJava()) {
 628       compile->remove_unstable_if_trap(as_CallStaticJava(), false);
 629     }
 630   }
 631   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
 632   bs->unregister_potential_barrier_node(this);
 633 
 634   // See if the input array was allocated just prior to the object
 635   int edge_size = _max*sizeof(void*);
 636   int out_edge_size = _outmax*sizeof(void*);
 637   char *in_array = ((char*)_in);
 638   char *edge_end = in_array + edge_size;
 639   char *out_array = (char*)(_out == NO_OUT_ARRAY? nullptr: _out);
 640   int node_size = size_of();
 641 
 642 #ifdef ASSERT

  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "gc/shared/barrierSet.hpp"
  28 #include "gc/shared/c2/barrierSetC2.hpp"
  29 #include "libadt/vectset.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/resourceArea.hpp"
  32 #include "opto/ad.hpp"
  33 #include "opto/callGenerator.hpp"
  34 #include "opto/castnode.hpp"
  35 #include "opto/cfgnode.hpp"
  36 #include "opto/connode.hpp"
  37 #include "opto/inlinetypenode.hpp"
  38 #include "opto/loopnode.hpp"
  39 #include "opto/machnode.hpp"
  40 #include "opto/matcher.hpp"
  41 #include "opto/node.hpp"
  42 #include "opto/opcodes.hpp"
  43 #include "opto/regmask.hpp"
  44 #include "opto/rootnode.hpp"
  45 #include "opto/type.hpp"
  46 #include "utilities/copy.hpp"
  47 #include "utilities/macros.hpp"
  48 #include "utilities/powerOfTwo.hpp"
  49 #include "utilities/stringUtils.hpp"
  50 
  51 class RegMask;
  52 // #include "phase.hpp"
  53 class PhaseTransform;
  54 class PhaseGVN;
  55 
  56 // Arena we are currently building Nodes in
  57 const uint Node::NotAMachineReg = 0xffff0000;

 544     }
 545   }
 546   if (n->is_Call()) {
 547     // CallGenerator is linked to the original node.
 548     CallGenerator* cg = n->as_Call()->generator();
 549     if (cg != nullptr) {
 550       CallGenerator* cloned_cg = cg->with_call_node(n->as_Call());
 551       n->as_Call()->set_generator(cloned_cg);
 552 
 553       C->print_inlining_assert_ready();
 554       C->print_inlining_move_to(cg);
 555       C->print_inlining_update(cloned_cg);
 556     }
 557   }
 558   if (n->is_SafePoint()) {
 559     // Scalar replacement and macro expansion might modify the JVMState.
 560     // Clone it to make sure it's not shared between SafePointNodes.
 561     n->as_SafePoint()->clone_jvms(C);
 562     n->as_SafePoint()->clone_replaced_nodes();
 563   }
 564   if (n->is_InlineType()) {
 565     C->add_inline_type(n);
 566   }
 567   Compile::current()->record_modified_node(n);
 568   return n;                     // Return the clone
 569 }
 570 
 571 //---------------------------setup_is_top--------------------------------------
 572 // Call this when changing the top node, to reassert the invariants
 573 // required by Node::is_top.  See Compile::set_cached_top_node.
 574 void Node::setup_is_top() {
 575   if (this == (Node*)Compile::current()->top()) {
 576     // This node has just become top.  Kill its out array.
 577     _outcnt = _outmax = 0;
 578     _out = nullptr;                           // marker value for top
 579     assert(is_top(), "must be top");
 580   } else {
 581     if (_out == nullptr)  _out = NO_OUT_ARRAY;
 582     assert(!is_top(), "must not be top");
 583   }
 584 }
 585 
 586 //------------------------------~Node------------------------------------------

 607     set_req(i, nullptr);
 608     //assert(def->out(def->outcnt()-1) == (Node *)this,"bad def-use hacking in reclaim");
 609   }
 610   assert(outcnt() == 0, "deleting a node must not leave a dangling use");
 611 
 612   if (is_macro()) {
 613     compile->remove_macro_node(this);
 614   }
 615   if (is_expensive()) {
 616     compile->remove_expensive_node(this);
 617   }
 618   if (is_Opaque4()) {
 619     compile->remove_template_assertion_predicate_opaq(this);
 620   }
 621   if (is_ParsePredicate()) {
 622     compile->remove_parse_predicate(as_ParsePredicate());
 623   }
 624   if (for_post_loop_opts_igvn()) {
 625     compile->remove_from_post_loop_opts_igvn(this);
 626   }
 627   if (is_InlineType()) {
 628     compile->remove_inline_type(this);
 629   }
 630 
 631   if (is_SafePoint()) {
 632     as_SafePoint()->delete_replaced_nodes();
 633 
 634     if (is_CallStaticJava()) {
 635       compile->remove_unstable_if_trap(as_CallStaticJava(), false);
 636     }
 637   }
 638   BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
 639   bs->unregister_potential_barrier_node(this);
 640 
 641   // See if the input array was allocated just prior to the object
 642   int edge_size = _max*sizeof(void*);
 643   int out_edge_size = _outmax*sizeof(void*);
 644   char *in_array = ((char*)_in);
 645   char *edge_end = in_array + edge_size;
 646   char *out_array = (char*)(_out == NO_OUT_ARRAY? nullptr: _out);
 647   int node_size = size_of();
 648 
 649 #ifdef ASSERT
< prev index next >