src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
changeset 58273 08a5148e7c4e
parent 57904 4f38fcd65577
child 58516 d376d86b0a01
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Mon Sep 23 14:39:11 2019 -0400
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Mon Sep 23 14:49:04 2019 -0400
@@ -660,7 +660,7 @@
 }
 
 bool ZBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
-  return type == T_OBJECT || type == T_ARRAY;
+  return is_reference_type(type);
 }
 
 bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n, uint opcode) const {
@@ -1367,7 +1367,7 @@
         LoadStoreNode* lsn = n->as_LoadStore();
         if (lsn->has_barrier()) {
           BasicType bt = lsn->in(MemNode::Address)->bottom_type()->basic_type();
-          assert ((bt == T_OBJECT || bt == T_ARRAY), "Sanity test");
+          assert (is_reference_type(bt), "Sanity test");
           insert_barrier_before_unsafe(phase, lsn);
         }
       }