Tue, 24 May 2016 12:42:43 -0500
8152856: Xcode 7.3 -Wshift-negative-value compile failure on Mac OS X
Summary: Implement _lh_array_tag_type_value as const, not enum.
Reviewed-by: vlivanov, minqi
src/share/vm/oops/klass.hpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/library_call.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/oops/klass.hpp Wed Jul 17 21:18:57 2019 +0100 1.2 +++ b/src/share/vm/oops/klass.hpp Tue May 24 12:42:43 2016 -0500 1.3 @@ -335,10 +335,11 @@ 1.4 _lh_header_size_mask = right_n_bits(BitsPerByte), // shifted mask 1.5 _lh_array_tag_bits = 2, 1.6 _lh_array_tag_shift = BitsPerInt - _lh_array_tag_bits, 1.7 - _lh_array_tag_type_value = ~0x00, // 0xC0000000 >> 30 1.8 _lh_array_tag_obj_value = ~0x01 // 0x80000000 >> 30 1.9 }; 1.10 1.11 + static const unsigned int _lh_array_tag_type_value = 0Xffffffff; // ~0x00, // 0xC0000000 >> 30 1.12 + 1.13 static int layout_helper_size_in_bytes(jint lh) { 1.14 assert(lh > (jint)_lh_neutral_value, "must be instance"); 1.15 return (int) lh & ~_lh_instance_slow_path_bit;
2.1 --- a/src/share/vm/opto/library_call.cpp Wed Jul 17 21:18:57 2019 +0100 2.2 +++ b/src/share/vm/opto/library_call.cpp Tue May 24 12:42:43 2016 -0500 2.3 @@ -3803,7 +3803,7 @@ 2.4 } 2.5 // Now test the correct condition. 2.6 jint nval = (obj_array 2.7 - ? ((jint)Klass::_lh_array_tag_type_value 2.8 + ? (jint)(Klass::_lh_array_tag_type_value 2.9 << Klass::_lh_array_tag_shift) 2.10 : Klass::_lh_neutral_value); 2.11 Node* cmp = _gvn.transform(new(C) CmpINode(layout_val, intcon(nval)));