8073796: assert(check_obj_alignment(result)) failed: address not aligned: ...
authorroland
Wed, 25 Feb 2015 12:33:43 +0100
changeset 29348 523c0c8c3c41
parent 29347 3ec0c806f1d1
child 29352 04b43b438b7b
child 29353 f0fd57a85296
child 29355 6a13ec66ba95
8073796: assert(check_obj_alignment(result)) failed: address not aligned: ... Summary: Arrays.copyOf intrinsic can deoptimize with uninitialized new array Reviewed-by: kvn
hotspot/src/share/vm/opto/library_call.cpp
--- a/hotspot/src/share/vm/opto/library_call.cpp	Sat Feb 28 12:33:50 2015 +0000
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Wed Feb 25 12:33:43 2015 +0100
@@ -3868,8 +3868,6 @@
       Node* orig_tail = _gvn.transform(new SubINode(orig_length, start));
       Node* moved = generate_min_max(vmIntrinsics::_min, orig_tail, length);
 
-      newcopy = new_array(klass_node, length, 0);  // no arguments to push
-
       // Generate a direct call to the right arraycopy function(s).
       // We know the copy is disjoint but we might not know if the
       // oop stores need checking.
@@ -3913,6 +3911,8 @@
         validated = true;
       }
 
+      newcopy = new_array(klass_node, length, 0);  // no arguments to push
+
       ArrayCopyNode* ac = ArrayCopyNode::make(this, true, original, start, newcopy, intcon(0), moved, true,
                                               load_object_klass(original), klass_node);
       if (!is_copyOfRange) {