< prev index next >

src/hotspot/share/opto/node.cpp

Print this page

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

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

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



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

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



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

  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/shared/barrierSet.hpp"
  27 #include "gc/shared/c2/barrierSetC2.hpp"
  28 #include "libadt/vectset.hpp"
  29 #include "memory/allocation.inline.hpp"
  30 #include "memory/resourceArea.hpp"
  31 #include "opto/ad.hpp"
  32 #include "opto/callGenerator.hpp"
  33 #include "opto/castnode.hpp"
  34 #include "opto/cfgnode.hpp"
  35 #include "opto/connode.hpp"
  36 #include "opto/inlinetypenode.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   if (n->is_InlineType()) {
 564     C->add_inline_type(n);
 565   }
 566   Compile::current()->record_modified_node(n);
 567   return n;                     // Return the clone
 568 }
 569 
 570 //---------------------------setup_is_top--------------------------------------
 571 // Call this when changing the top node, to reassert the invariants
 572 // required by Node::is_top.  See Compile::set_cached_top_node.
 573 void Node::setup_is_top() {
 574   if (this == (Node*)Compile::current()->top()) {
 575     // This node has just become top.  Kill its out array.
 576     _outcnt = _outmax = 0;
 577     _out = nullptr;                           // marker value for top
 578     assert(is_top(), "must be top");
 579   } else {
 580     if (_out == nullptr)  _out = NO_OUT_ARRAY;
 581     assert(!is_top(), "must not be top");
 582   }
 583 }
 584 
 585 //------------------------------~Node------------------------------------------

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