< prev index next >

src/share/vm/opto/arraycopynode.cpp

Print this page
rev 8739 : 8004073: Implement C2 Ideal node specific dump() method
Summary: add Node::dump_rel() to dump a node and its related nodes (the notion of "related" depends on the node at hand); add Node::dump_comp() to dump a node in compact representation; add Node::dump_rel_comp() to dump a node and its related nodes in compact representation; add the required machinery; extend some C2 IR nodes with compact and related dumping
Reviewed-by:


  62   ac->init_req(ArrayCopyNode::DestKlass, dest_klass);
  63 
  64   if (may_throw) {
  65     ac->set_req(TypeFunc::I_O , kit->i_o());
  66     kit->add_safepoint_edges(ac, false);
  67   }
  68 
  69   return ac;
  70 }
  71 
  72 void ArrayCopyNode::connect_outputs(GraphKit* kit) {
  73   kit->set_all_memory_call(this, true);
  74   kit->set_control(kit->gvn().transform(new ProjNode(this,TypeFunc::Control)));
  75   kit->set_i_o(kit->gvn().transform(new ProjNode(this, TypeFunc::I_O)));
  76   kit->make_slow_call_ex(this, kit->env()->Throwable_klass(), true);
  77   kit->set_all_memory_call(this);
  78 }
  79 
  80 #ifndef PRODUCT
  81 const char* ArrayCopyNode::_kind_names[] = {"arraycopy", "arraycopy, validated arguments", "clone", "oop array clone", "CopyOf", "CopyOfRange"};

  82 void ArrayCopyNode::dump_spec(outputStream *st) const {
  83   CallNode::dump_spec(st);
  84   st->print(" (%s%s)", _kind_names[_kind], _alloc_tightly_coupled ? ", tightly coupled allocation" : "");
  85 }




  86 #endif
  87 
  88 intptr_t ArrayCopyNode::get_length_if_constant(PhaseGVN *phase) const {
  89   // check that length is constant
  90   Node* length = in(ArrayCopyNode::Length);
  91   const Type* length_type = phase->type(length);
  92 
  93   if (length_type == Type::TOP) {
  94     return -1;
  95   }
  96 
  97   assert(is_clonebasic() || is_arraycopy() || is_copyof() || is_copyofrange(), "unexpected array copy type");
  98 
  99   return is_clonebasic() ? length->find_intptr_t_con(-1) : length->find_int_con(-1);
 100 }
 101 
 102 int ArrayCopyNode::get_count(PhaseGVN *phase) const {
 103   Node* src = in(ArrayCopyNode::Src);
 104   const Type* src_type = phase->type(src);
 105 




  62   ac->init_req(ArrayCopyNode::DestKlass, dest_klass);
  63 
  64   if (may_throw) {
  65     ac->set_req(TypeFunc::I_O , kit->i_o());
  66     kit->add_safepoint_edges(ac, false);
  67   }
  68 
  69   return ac;
  70 }
  71 
  72 void ArrayCopyNode::connect_outputs(GraphKit* kit) {
  73   kit->set_all_memory_call(this, true);
  74   kit->set_control(kit->gvn().transform(new ProjNode(this,TypeFunc::Control)));
  75   kit->set_i_o(kit->gvn().transform(new ProjNode(this, TypeFunc::I_O)));
  76   kit->make_slow_call_ex(this, kit->env()->Throwable_klass(), true);
  77   kit->set_all_memory_call(this);
  78 }
  79 
  80 #ifndef PRODUCT
  81 const char* ArrayCopyNode::_kind_names[] = {"arraycopy", "arraycopy, validated arguments", "clone", "oop array clone", "CopyOf", "CopyOfRange"};
  82 
  83 void ArrayCopyNode::dump_spec(outputStream *st) const {
  84   CallNode::dump_spec(st);
  85   st->print(" (%s%s)", _kind_names[_kind], _alloc_tightly_coupled ? ", tightly coupled allocation" : "");
  86 }
  87 
  88 void ArrayCopyNode::dump_comp_spec(outputStream* st) const {
  89   st->print("%s%s", _kind_names[_kind], _alloc_tightly_coupled ? ",tight" : "");
  90 }
  91 #endif
  92 
  93 intptr_t ArrayCopyNode::get_length_if_constant(PhaseGVN *phase) const {
  94   // check that length is constant
  95   Node* length = in(ArrayCopyNode::Length);
  96   const Type* length_type = phase->type(length);
  97 
  98   if (length_type == Type::TOP) {
  99     return -1;
 100   }
 101 
 102   assert(is_clonebasic() || is_arraycopy() || is_copyof() || is_copyofrange(), "unexpected array copy type");
 103 
 104   return is_clonebasic() ? length->find_intptr_t_con(-1) : length->find_int_con(-1);
 105 }
 106 
 107 int ArrayCopyNode::get_count(PhaseGVN *phase) const {
 108   Node* src = in(ArrayCopyNode::Src);
 109   const Type* src_type = phase->type(src);
 110 


< prev index next >