--- a/hotspot/src/share/vm/opto/arraycopynode.cpp Mon May 11 09:44:07 2015 +0200
+++ b/hotspot/src/share/vm/opto/arraycopynode.cpp Tue May 12 10:27:50 2015 +0200
@@ -30,7 +30,9 @@
: CallNode(arraycopy_type(), NULL, TypeRawPtr::BOTTOM),
_alloc_tightly_coupled(alloc_tightly_coupled),
_kind(None),
- _arguments_validated(false) {
+ _arguments_validated(false),
+ _src_type(TypeOopPtr::BOTTOM),
+ _dest_type(TypeOopPtr::BOTTOM) {
init_class_id(Class_ArrayCopy);
init_flags(Flag_is_macro);
C->add_macro_node(this);
@@ -595,3 +597,17 @@
return mem;
}
+
+bool ArrayCopyNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
+ const TypeOopPtr* dest_t = phase->type(in(ArrayCopyNode::Dest))->is_oopptr();
+ assert(!dest_t->is_known_instance() || _dest_type->is_known_instance(), "result of EA not recorded");
+ const TypeOopPtr* src_t = phase->type(in(ArrayCopyNode::Src))->is_oopptr();
+ assert(!src_t->is_known_instance() || _src_type->is_known_instance(), "result of EA not recorded");
+
+ if (_dest_type != TypeOopPtr::BOTTOM || t_oop->is_known_instance()) {
+ assert(_dest_type == TypeOopPtr::BOTTOM || _dest_type->is_known_instance(), "result of EA is known instance");
+ return t_oop->instance_id() == _dest_type->instance_id();
+ }
+
+ return CallNode::may_modify_arraycopy_helper(dest_t, t_oop, phase);
+}