726 case TypeFunc::ReturnAdr:
727 case TypeFunc::FramePtr:
728 default:
729 ShouldNotReachHere();
730 }
731 return NULL;
732 }
733
734 // Do we Match on this edge index or not? Match no edges
735 uint CallNode::match_edge(uint idx) const {
736 return 0;
737 }
738
739 //
740 // Determine whether the call could modify the field of the specified
741 // instance at the specified offset.
742 //
743 bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
744 assert((t_oop != NULL), "sanity");
745 if (is_call_to_arraycopystub() && strcmp(_name, "unsafe_arraycopy") != 0) {
746 const TypeTuple* args = _tf->domain();
747 Node* dest = NULL;
748 // Stubs that can be called once an ArrayCopyNode is expanded have
749 // different signatures. Look for the second pointer argument,
750 // that is the destination of the copy.
751 for (uint i = TypeFunc::Parms, j = 0; i < args->cnt(); i++) {
752 if (args->field_at(i)->isa_ptr()) {
753 j++;
754 if (j == 2) {
755 dest = in(i);
756 break;
757 }
758 }
759 }
760 if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
761 return true;
762 }
763 return false;
764 }
765 if (t_oop->is_known_instance()) {
766 // The instance_id is set only for scalar-replaceable allocations which
774 Node* proj = proj_out(TypeFunc::Parms);
775 if ((proj == NULL) || (phase->type(proj)->is_instptr()->klass() != boxing_klass)) {
776 return false;
777 }
778 }
779 if (is_CallJava() && as_CallJava()->method() != NULL) {
780 ciMethod* meth = as_CallJava()->method();
781 if (meth->is_getter()) {
782 return false;
783 }
784 // May modify (by reflection) if an boxing object is passed
785 // as argument or returned.
786 if (returns_pointer() && (proj_out(TypeFunc::Parms) != NULL)) {
787 Node* proj = proj_out(TypeFunc::Parms);
788 const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
789 if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
790 (inst_t->klass() == boxing_klass))) {
791 return true;
792 }
793 }
794 const TypeTuple* d = tf()->domain();
795 for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
796 const TypeInstPtr* inst_t = d->field_at(i)->isa_instptr();
797 if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
798 (inst_t->klass() == boxing_klass))) {
799 return true;
800 }
801 }
802 return false;
803 }
804 }
805 return true;
806 }
807
808 // Does this call have a direct reference to n other than debug information?
809 bool CallNode::has_non_debug_use(Node *n) {
810 const TypeTuple * d = tf()->domain();
811 for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
812 Node *arg = in(i);
813 if (arg == n) {
814 return true;
815 }
816 }
817 return false;
818 }
819
820 bool CallNode::has_debug_use(Node *n) {
821 for (uint i = jvms()->debug_start(); i < jvms()->debug_end(); i++) {
822 Node *arg = in(i);
823 if (arg == n) {
824 return true;
825 }
826 }
827 return false;
828 }
829
830 // Returns the unique CheckCastPP of a call
|
726 case TypeFunc::ReturnAdr:
727 case TypeFunc::FramePtr:
728 default:
729 ShouldNotReachHere();
730 }
731 return NULL;
732 }
733
734 // Do we Match on this edge index or not? Match no edges
735 uint CallNode::match_edge(uint idx) const {
736 return 0;
737 }
738
739 //
740 // Determine whether the call could modify the field of the specified
741 // instance at the specified offset.
742 //
743 bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
744 assert((t_oop != NULL), "sanity");
745 if (is_call_to_arraycopystub() && strcmp(_name, "unsafe_arraycopy") != 0) {
746 const TypeTuple* args = _tf->domain_sig();
747 Node* dest = NULL;
748 // Stubs that can be called once an ArrayCopyNode is expanded have
749 // different signatures. Look for the second pointer argument,
750 // that is the destination of the copy.
751 for (uint i = TypeFunc::Parms, j = 0; i < args->cnt(); i++) {
752 if (args->field_at(i)->isa_ptr()) {
753 j++;
754 if (j == 2) {
755 dest = in(i);
756 break;
757 }
758 }
759 }
760 if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
761 return true;
762 }
763 return false;
764 }
765 if (t_oop->is_known_instance()) {
766 // The instance_id is set only for scalar-replaceable allocations which
774 Node* proj = proj_out(TypeFunc::Parms);
775 if ((proj == NULL) || (phase->type(proj)->is_instptr()->klass() != boxing_klass)) {
776 return false;
777 }
778 }
779 if (is_CallJava() && as_CallJava()->method() != NULL) {
780 ciMethod* meth = as_CallJava()->method();
781 if (meth->is_getter()) {
782 return false;
783 }
784 // May modify (by reflection) if an boxing object is passed
785 // as argument or returned.
786 if (returns_pointer() && (proj_out(TypeFunc::Parms) != NULL)) {
787 Node* proj = proj_out(TypeFunc::Parms);
788 const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
789 if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
790 (inst_t->klass() == boxing_klass))) {
791 return true;
792 }
793 }
794 const TypeTuple* d = tf()->domain_cc();
795 for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
796 const TypeInstPtr* inst_t = d->field_at(i)->isa_instptr();
797 if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
798 (inst_t->klass() == boxing_klass))) {
799 return true;
800 }
801 }
802 return false;
803 }
804 }
805 return true;
806 }
807
808 // Does this call have a direct reference to n other than debug information?
809 bool CallNode::has_non_debug_use(Node *n) {
810 const TypeTuple * d = tf()->domain_cc();
811 for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
812 Node *arg = in(i);
813 if (arg == n) {
814 return true;
815 }
816 }
817 return false;
818 }
819
820 bool CallNode::has_debug_use(Node *n) {
821 for (uint i = jvms()->debug_start(); i < jvms()->debug_end(); i++) {
822 Node *arg = in(i);
823 if (arg == n) {
824 return true;
825 }
826 }
827 return false;
828 }
829
830 // Returns the unique CheckCastPP of a call
|