8161044: PPC64: Improve internal array handling
authorzmajo
Mon, 25 Jul 2016 11:15:00 +0200
changeset 41546 357406d17607
parent 41545 45a3f587a838
child 41547 9d611e487d3e
8161044: PPC64: Improve internal array handling Reviewed-by: kvn Contributed-by: Xiang Yuan <xiang.yuan@linaro.org>, Volker Simonis <volker.simonis@sap.com>, Zoltan Majo <zoltan.majo@oracle.com>
hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp
--- a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp	Mon Jun 27 15:26:08 2016 -0400
+++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp	Mon Jul 25 11:15:00 2016 +0200
@@ -1894,6 +1894,22 @@
     __ beq(combined_check, slow);
   }
 
+  if (flags & LIR_OpArrayCopy::type_check) {
+    if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::dst_objarray)) {
+      __ load_klass(tmp, dst);
+      __ lwz(tmp2, in_bytes(Klass::layout_helper_offset()), tmp);
+      __ cmpwi(CCR0, tmp2, Klass::_lh_neutral_value);
+      __ bge(CCR0, slow);
+    }
+
+    if (!(flags & LIR_OpArrayCopy::LIR_OpArrayCopy::src_objarray)) {
+      __ load_klass(tmp, src);
+      __ lwz(tmp2, in_bytes(Klass::layout_helper_offset()), tmp);
+      __ cmpwi(CCR0, tmp2, Klass::_lh_neutral_value);
+      __ bge(CCR0, slow);
+    }
+  }
+
   // Higher 32bits must be null.
   __ extsw(length, length);