hotspot/src/share/vm/opto/memnode.cpp
changeset 8884 9e2b81253ef9
parent 8879 e6ae9a7aa72a
child 9179 6db9c9dffe1f
child 9327 23532ae85295
equal deleted inserted replaced
8883:5569135acca3 8884:9e2b81253ef9
  2626 // Return a node which is more "ideal" than the current node.  Strip out
  2626 // Return a node which is more "ideal" than the current node.  Strip out
  2627 // control copies
  2627 // control copies
  2628 Node *StrIntrinsicNode::Ideal(PhaseGVN *phase, bool can_reshape) {
  2628 Node *StrIntrinsicNode::Ideal(PhaseGVN *phase, bool can_reshape) {
  2629   if (remove_dead_region(phase, can_reshape)) return this;
  2629   if (remove_dead_region(phase, can_reshape)) return this;
  2630 
  2630 
  2631   Node* mem = phase->transform(in(MemNode::Memory));
  2631   if (can_reshape) {
  2632   // If transformed to a MergeMem, get the desired slice
  2632     Node* mem = phase->transform(in(MemNode::Memory));
  2633   uint alias_idx = phase->C->get_alias_index(adr_type());
  2633     // If transformed to a MergeMem, get the desired slice
  2634   mem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(alias_idx) : mem;
  2634     uint alias_idx = phase->C->get_alias_index(adr_type());
  2635   if (mem != in(MemNode::Memory))
  2635     mem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(alias_idx) : mem;
  2636     set_req(MemNode::Memory, mem);
  2636     if (mem != in(MemNode::Memory)) {
       
  2637       set_req(MemNode::Memory, mem);
       
  2638       return this;
       
  2639     }
       
  2640   }
  2637   return NULL;
  2641   return NULL;
  2638 }
  2642 }
  2639 
  2643 
  2640 //=============================================================================
  2644 //=============================================================================
  2641 MemBarNode::MemBarNode(Compile* C, int alias_idx, Node* precedent)
  2645 MemBarNode::MemBarNode(Compile* C, int alias_idx, Node* precedent)