6857661: 64-bit server VM: assert(is_Initialize(),"invalid node class")
authorkvn
Mon, 06 Jul 2009 15:53:30 -0700 (2009-07-06)
changeset 3189 e9171813dda3
parent 3188 23b1df66f64e
child 3190 57b670a78763
6857661: 64-bit server VM: assert(is_Initialize(),"invalid node class") Summary: Move the secondary raw memory barrier to the correct place in generate_arraycopy(). Reviewed-by: never
hotspot/src/share/vm/opto/library_call.cpp
--- a/hotspot/src/share/vm/opto/library_call.cpp	Mon Jul 06 12:54:17 2009 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Mon Jul 06 15:53:30 2009 -0700
@@ -4500,27 +4500,27 @@
       generate_negative_guard(copy_length, slow_region);
     }
 
+    // copy_length is 0.
     if (!stopped() && must_clear_dest) {
       Node* dest_length = alloc->in(AllocateNode::ALength);
       if (_gvn.eqv_uncast(copy_length, dest_length)
           || _gvn.find_int_con(dest_length, 1) <= 0) {
-        // There is no zeroing to do.
+        // There is no zeroing to do. No need for a secondary raw memory barrier.
       } else {
         // Clear the whole thing since there are no source elements to copy.
         generate_clear_array(adr_type, dest, basic_elem_type,
                              intcon(0), NULL,
                              alloc->in(AllocateNode::AllocSize));
+        // Use a secondary InitializeNode as raw memory barrier.
+        // Currently it is needed only on this path since other
+        // paths have stub or runtime calls as raw memory barriers.
+        InitializeNode* init = insert_mem_bar_volatile(Op_Initialize,
+                                                       Compile::AliasIdxRaw,
+                                                       top())->as_Initialize();
+        init->set_complete(&_gvn);  // (there is no corresponding AllocateNode)
       }
     }
 
-    // Use a secondary InitializeNode as raw memory barrier.
-    // Currently it is needed only on this path since other
-    // paths have stub or runtime calls as raw memory barriers.
-    InitializeNode* init = insert_mem_bar_volatile(Op_Initialize,
-                                                   Compile::AliasIdxRaw,
-                                                   top())->as_Initialize();
-    init->set_complete(&_gvn);  // (there is no corresponding AllocateNode)
-
     // Present the results of the fast call.
     result_region->init_req(zero_path, control());
     result_i_o   ->init_req(zero_path, i_o());