< prev index next >

src/hotspot/share/opto/arraycopynode.cpp

Print this page
rev 53029 : Proper fix for C2-unrolled-clone with Shenandoah LRB


 137       // clone passes a length as a rounded number of longs. If we're
 138       // cloning an array we'll do it element by element. If the
 139       // length input to ArrayCopyNode is constant, length of input
 140       // array must be too.
 141 
 142       assert((get_length_if_constant(phase) == -1) == !ary_src->size()->is_con() ||
 143              phase->is_IterGVN(), "inconsistent");
 144 
 145       if (ary_src->size()->is_con()) {
 146         return ary_src->size()->get_con();
 147       }
 148       return -1;
 149     }
 150   }
 151 
 152   return get_length_if_constant(phase);
 153 }
 154 
 155 #if INCLUDE_SHENANDOAHGC
 156 Node* ArrayCopyNode::shenandoah_add_storeval_barrier(PhaseGVN *phase, bool can_reshape, Node* v, MergeMemNode* mem, Node*& ctl) {



 157   if (ShenandoahStoreValEnqueueBarrier) {
 158     return phase->transform(new ShenandoahEnqueueBarrierNode(v));
 159   }
 160   return v;
 161 }
 162 #endif
 163 
 164 Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int count) {
 165   if (!is_clonebasic()) {
 166     return NULL;
 167   }
 168 
 169   Node* src = in(ArrayCopyNode::Src);
 170   Node* dest = in(ArrayCopyNode::Dest);
 171   Node* ctl = in(TypeFunc::Control);
 172   Node* in_mem = in(TypeFunc::Memory);
 173 
 174   const Type* src_type = phase->type(src);
 175 
 176   assert(src->is_AddP(), "should be base + off");




 137       // clone passes a length as a rounded number of longs. If we're
 138       // cloning an array we'll do it element by element. If the
 139       // length input to ArrayCopyNode is constant, length of input
 140       // array must be too.
 141 
 142       assert((get_length_if_constant(phase) == -1) == !ary_src->size()->is_con() ||
 143              phase->is_IterGVN(), "inconsistent");
 144 
 145       if (ary_src->size()->is_con()) {
 146         return ary_src->size()->get_con();
 147       }
 148       return -1;
 149     }
 150   }
 151 
 152   return get_length_if_constant(phase);
 153 }
 154 
 155 #if INCLUDE_SHENANDOAHGC
 156 Node* ArrayCopyNode::shenandoah_add_storeval_barrier(PhaseGVN *phase, bool can_reshape, Node* v, MergeMemNode* mem, Node*& ctl) {
 157   if (ShenandoahLoadRefBarrier) {
 158     return phase->transform(new ShenandoahLoadReferenceBarrierNode(NULL, v));
 159   }
 160   if (ShenandoahStoreValEnqueueBarrier) {
 161     return phase->transform(new ShenandoahEnqueueBarrierNode(v));
 162   }
 163   return v;
 164 }
 165 #endif
 166 
 167 Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int count) {
 168   if (!is_clonebasic()) {
 169     return NULL;
 170   }
 171 
 172   Node* src = in(ArrayCopyNode::Src);
 173   Node* dest = in(ArrayCopyNode::Dest);
 174   Node* ctl = in(TypeFunc::Control);
 175   Node* in_mem = in(TypeFunc::Memory);
 176 
 177   const Type* src_type = phase->type(src);
 178 
 179   assert(src->is_AddP(), "should be base + off");


< prev index next >