JDK-8153301 : Why is layout_helper_is_objArray using _lh_array_tag_type_value, not _lh_array_tag_obj_value?
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Not an Issue
  • Submitted: 2016-04-01
  • Updated: 2017-04-05
  • Resolved: 2017-04-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Related Reports
Relates :  
Description
According the this code:

  static bool layout_helper_is_objArray(jint lh) {
    // _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);
    return (jint)lh < (jint)(_lh_array_tag_type_value << _lh_array_tag_shift);
  }

comment, the implementation should use _lh_array_tag_obj_value, not _lh_array_tag_type_value

Is the comment or code wrong?
Comments
I found the comment confusing myself. This is just a clever way of performing the check with a single compare. objArray layout_helpers are all negative because the tag is the sign bit and they are all less than the shifted value because they have other bits set. The code in the comment requires a shift and compare.
13-05-2016