< prev index next >

src/share/vm/opto/memnode.cpp

Print this page
rev 12113 : 8166561: [s390] Adaptions needed for s390 port in C1 and C2.


2700 const TypePtr* ClearArrayNode::adr_type() const {
2701   Node *adr = in(3);
2702   if (adr == NULL)  return NULL; // node is dead
2703   return MemNode::calculate_adr_type(adr->bottom_type());
2704 }
2705 
2706 //------------------------------match_edge-------------------------------------
2707 // Do we Match on this edge index or not?  Do not match memory
2708 uint ClearArrayNode::match_edge(uint idx) const {
2709   return idx > 1;
2710 }
2711 
2712 //------------------------------Identity---------------------------------------
2713 // Clearing a zero length array does nothing
2714 Node* ClearArrayNode::Identity(PhaseGVN* phase) {
2715   return phase->type(in(2))->higher_equal(TypeX::ZERO)  ? in(1) : this;
2716 }
2717 
2718 //------------------------------Idealize---------------------------------------
2719 // Clearing a short array is faster with stores
2720 Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape){
2721   // Already know this is a large node, do not try to ideal it
2722   if (_is_large) return NULL;
2723 
2724   const int unit = BytesPerLong;
2725   const TypeX* t = phase->type(in(2))->isa_intptr_t();
2726   if (!t)  return NULL;
2727   if (!t->is_con())  return NULL;
2728   intptr_t raw_count = t->get_con();
2729   intptr_t size = raw_count;
2730   if (!Matcher::init_array_count_is_in_bytes) size *= unit;
2731   // Clearing nothing uses the Identity call.
2732   // Negative clears are possible on dead ClearArrays
2733   // (see jck test stmt114.stmt11402.val).
2734   if (size <= 0 || size % unit != 0)  return NULL;
2735   intptr_t count = size / unit;
2736   // Length too long; communicate this to matchers and assemblers.
2737   // Assemblers are responsible to produce fast hardware clears for it.
2738   if (size > InitArrayShortSize) {
2739     return new ClearArrayNode(in(0), in(1), in(2), in(3), true);
2740   }
2741   Node *mem = in(1);
2742   if( phase->type(mem)==Type::TOP ) return NULL;




2700 const TypePtr* ClearArrayNode::adr_type() const {
2701   Node *adr = in(3);
2702   if (adr == NULL)  return NULL; // node is dead
2703   return MemNode::calculate_adr_type(adr->bottom_type());
2704 }
2705 
2706 //------------------------------match_edge-------------------------------------
2707 // Do we Match on this edge index or not?  Do not match memory
2708 uint ClearArrayNode::match_edge(uint idx) const {
2709   return idx > 1;
2710 }
2711 
2712 //------------------------------Identity---------------------------------------
2713 // Clearing a zero length array does nothing
2714 Node* ClearArrayNode::Identity(PhaseGVN* phase) {
2715   return phase->type(in(2))->higher_equal(TypeX::ZERO)  ? in(1) : this;
2716 }
2717 
2718 //------------------------------Idealize---------------------------------------
2719 // Clearing a short array is faster with stores
2720 Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
2721   // Already know this is a large node, do not try to ideal it
2722   if (!IdealizeClearArrayNode || _is_large) return NULL;
2723 
2724   const int unit = BytesPerLong;
2725   const TypeX* t = phase->type(in(2))->isa_intptr_t();
2726   if (!t)  return NULL;
2727   if (!t->is_con())  return NULL;
2728   intptr_t raw_count = t->get_con();
2729   intptr_t size = raw_count;
2730   if (!Matcher::init_array_count_is_in_bytes) size *= unit;
2731   // Clearing nothing uses the Identity call.
2732   // Negative clears are possible on dead ClearArrays
2733   // (see jck test stmt114.stmt11402.val).
2734   if (size <= 0 || size % unit != 0)  return NULL;
2735   intptr_t count = size / unit;
2736   // Length too long; communicate this to matchers and assemblers.
2737   // Assemblers are responsible to produce fast hardware clears for it.
2738   if (size > InitArrayShortSize) {
2739     return new ClearArrayNode(in(0), in(1), in(2), in(3), true);
2740   }
2741   Node *mem = in(1);
2742   if( phase->type(mem)==Type::TOP ) return NULL;


< prev index next >