< prev index next >
src/share/vm/oops/klass.hpp
Print this page
*** 77,87 ****
//
// For arrays, layout helper is a negative number, containing four
// distinct bytes, as follows:
// MSB:[tag, hsz, ebt, log2(esz)]:LSB
// where:
! // tag is 0x80 if the elements are oops, 0xC0 if non-oops
// hsz is array header size in bytes (i.e., offset of first element)
// ebt is the BasicType of the elements
// esz is the element size in bytes
// This packed word is arranged so as to be quickly unpacked by the
// various fast paths that use the various subfields.
--- 77,87 ----
//
// For arrays, layout helper is a negative number, containing four
// distinct bytes, as follows:
// MSB:[tag, hsz, ebt, log2(esz)]:LSB
// where:
! // tag is 0x80 if the elements are oops, 0xC0 if non-oops, 0xA0 if value types
// hsz is array header size in bytes (i.e., offset of first element)
// ebt is the BasicType of the elements
// esz is the element size in bytes
// This packed word is arranged so as to be quickly unpacked by the
// various fast paths that use the various subfields.
*** 314,330 ****
_lh_element_type_shift = BitsPerByte*1,
_lh_element_type_mask = right_n_bits(BitsPerByte), // shifted mask
_lh_header_size_shift = BitsPerByte*2,
_lh_header_size_mask = right_n_bits(BitsPerByte), // shifted mask
! // Additional array type bits
! _lh_valuetype_bit = 29, // maybe objArray or valueArrayOop
!
! _lh_array_tag_bits = 2,
_lh_array_tag_shift = BitsPerInt - _lh_array_tag_bits,
! _lh_array_tag_type_value = ~0x00, // 0xC0000000 >> 30
! _lh_array_tag_obj_value = ~0x01 // 0x80000000 >> 30
};
static int layout_helper_size_in_bytes(jint lh) {
assert(lh > (jint)_lh_neutral_value, "must be instance");
return (int) lh & ~_lh_instance_slow_path_bit;
--- 314,328 ----
_lh_element_type_shift = BitsPerByte*1,
_lh_element_type_mask = right_n_bits(BitsPerByte), // shifted mask
_lh_header_size_shift = BitsPerByte*2,
_lh_header_size_mask = right_n_bits(BitsPerByte), // shifted mask
! _lh_array_tag_bits = 3,
_lh_array_tag_shift = BitsPerInt - _lh_array_tag_bits,
! _lh_array_tag_type_value = ~0x3, // bits ~100 compare as int, ie. sign extended
! _lh_array_tag_vt_value = ~0x2, // bits ~101
! _lh_array_tag_obj_value = ~0x1, // bits ~110
};
static int layout_helper_size_in_bytes(jint lh) {
assert(lh > (jint)_lh_neutral_value, "must be instance");
return (int) lh & ~_lh_instance_slow_path_bit;
*** 344,354 ****
}
static bool layout_helper_is_objArray(jint lh) {
return _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);
}
static bool layout_helper_is_valueArray(jint lh) {
! return (lh >> _lh_valuetype_bit) & 1;
}
static int layout_helper_header_size(jint lh) {
assert(lh < (jint)_lh_neutral_value, "must be array");
int hsize = (lh >> _lh_header_size_shift) & _lh_header_size_mask;
assert(hsize > 0 && hsize < (int)sizeof(oopDesc)*3, "sanity");
--- 342,352 ----
}
static bool layout_helper_is_objArray(jint lh) {
return _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);
}
static bool layout_helper_is_valueArray(jint lh) {
! return _lh_array_tag_vt_value == (lh >> _lh_array_tag_shift);
}
static int layout_helper_header_size(jint lh) {
assert(lh < (jint)_lh_neutral_value, "must be array");
int hsize = (lh >> _lh_header_size_shift) & _lh_header_size_mask;
assert(hsize > 0 && hsize < (int)sizeof(oopDesc)*3, "sanity");
< prev index next >