JDK-8240341 : remove unneeded casts from 8u backport of JDK-8152856
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2020-03-03
  • Updated: 2020-05-01
Related Reports
Relates :  
Description
The original backport of JDK-8152856 to 8u-cpu included the following casts to silence warnings with Xcode 4.x:

===
--- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Mon Mar 02 12:38:11 2020 +0000
+++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Mon Mar 02 11:25:28 2020 -0500
@@ -1128,7 +1128,7 @@
           __ movl(t0, Address(klass, Klass::layout_helper_offset()));
           __ sarl(t0, Klass::_lh_array_tag_shift);
           int tag = ((id == new_type_array_id)
-                     ? Klass::_lh_array_tag_type_value
+                     ? (int)Klass::_lh_array_tag_type_value
                      : Klass::_lh_array_tag_obj_value);
           __ cmpl(t0, tag);
           __ jcc(Assembler::equal, ok);
--- a/src/share/vm/oops/klass.cpp	Mon Mar 02 12:38:11 2020 +0000
+++ b/src/share/vm/oops/klass.cpp	Mon Mar 02 11:25:28 2020 -0500
@@ -215,7 +215,7 @@
   int  hsize = arrayOopDesc::base_offset_in_bytes(etype);
   int  esize = type2aelembytes(etype);
   bool isobj = (etype == T_OBJECT);
-  int  tag   =  isobj ? _lh_array_tag_obj_value : _lh_array_tag_type_value;
+  int  tag   =  isobj ? _lh_array_tag_obj_value : (int)_lh_array_tag_type_value;
   int lh = array_layout_helper(tag, hsize, etype, exact_log2(esize));
==

These casts are not in the original JDK 9 fix as they are not needed to build with more recent versions of Xcode. They should be removed from 8u-cpu as soon as we completely migrate to Xcode 10.1 and no longer need to build with earlier versions of Xcode.