640 }
641 }
642 return false;
643 }
644
645 bool ArrayCopyNode::may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTransform *phase, ArrayCopyNode*& ac) {
646 Node* mem = mb->in(TypeFunc::Memory);
647
648 if (mem->is_MergeMem()) {
649 Node* n = mem->as_MergeMem()->memory_at(Compile::AliasIdxRaw);
650 if (may_modify_helper(t_oop, n, phase, ac)) {
651 return true;
652 } else if (n->is_Phi()) {
653 for (uint i = 1; i < n->req(); i++) {
654 if (n->in(i) != NULL) {
655 if (may_modify_helper(t_oop, n->in(i), phase, ac)) {
656 return true;
657 }
658 }
659 }
660 } else if (n->Opcode() == Op_StoreCM) {
661 // Ignore card mark stores
662 return may_modify_helper(t_oop, n->in(MemNode::Memory), phase, ac);
663 }
664 }
665
666 return false;
667 }
668
669 // Does this array copy modify offsets between offset_lo and offset_hi
670 // in the destination array
671 // if must_modify is false, return true if the copy could write
672 // between offset_lo and offset_hi
673 // if must_modify is true, return true if the copy is guaranteed to
674 // write between offset_lo and offset_hi
675 bool ArrayCopyNode::modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase, bool must_modify) {
676 assert(_kind == ArrayCopy || _kind == CopyOf || _kind == CopyOfRange, "only for real array copies");
677
678 Node* dest = in(ArrayCopyNode::Dest);
679 Node* src_pos = in(ArrayCopyNode::SrcPos);
680 Node* dest_pos = in(ArrayCopyNode::DestPos);
|
640 }
641 }
642 return false;
643 }
644
645 bool ArrayCopyNode::may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTransform *phase, ArrayCopyNode*& ac) {
646 Node* mem = mb->in(TypeFunc::Memory);
647
648 if (mem->is_MergeMem()) {
649 Node* n = mem->as_MergeMem()->memory_at(Compile::AliasIdxRaw);
650 if (may_modify_helper(t_oop, n, phase, ac)) {
651 return true;
652 } else if (n->is_Phi()) {
653 for (uint i = 1; i < n->req(); i++) {
654 if (n->in(i) != NULL) {
655 if (may_modify_helper(t_oop, n->in(i), phase, ac)) {
656 return true;
657 }
658 }
659 }
660 } else if (n->Opcode() == Opcodes::Op_StoreCM) {
661 // Ignore card mark stores
662 return may_modify_helper(t_oop, n->in(MemNode::Memory), phase, ac);
663 }
664 }
665
666 return false;
667 }
668
669 // Does this array copy modify offsets between offset_lo and offset_hi
670 // in the destination array
671 // if must_modify is false, return true if the copy could write
672 // between offset_lo and offset_hi
673 // if must_modify is true, return true if the copy is guaranteed to
674 // write between offset_lo and offset_hi
675 bool ArrayCopyNode::modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase, bool must_modify) {
676 assert(_kind == ArrayCopy || _kind == CopyOf || _kind == CopyOfRange, "only for real array copies");
677
678 Node* dest = in(ArrayCopyNode::Dest);
679 Node* src_pos = in(ArrayCopyNode::SrcPos);
680 Node* dest_pos = in(ArrayCopyNode::DestPos);
|