324 static bool layout_helper_is_objArray(jint lh) {
325 // _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);
326 return (jint)lh < (jint)(_lh_array_tag_type_value << _lh_array_tag_shift);
327 }
328 static int layout_helper_header_size(jint lh) {
329 assert(lh < (jint)_lh_neutral_value, "must be array");
330 int hsize = (lh >> _lh_header_size_shift) & _lh_header_size_mask;
331 assert(hsize > 0 && hsize < (int)sizeof(oopDesc)*3, "sanity");
332 return hsize;
333 }
334 static BasicType layout_helper_element_type(jint lh) {
335 assert(lh < (jint)_lh_neutral_value, "must be array");
336 int btvalue = (lh >> _lh_element_type_shift) & _lh_element_type_mask;
337 assert(btvalue >= T_BOOLEAN && btvalue <= T_OBJECT, "sanity");
338 return (BasicType) btvalue;
339 }
340 static int layout_helper_log2_element_size(jint lh) {
341 assert(lh < (jint)_lh_neutral_value, "must be array");
342 int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask;
343 assert(l2esz <= LogBitsPerLong,
344 err_msg("sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh));
345 return l2esz;
346 }
347 static jint array_layout_helper(jint tag, int hsize, BasicType etype, int log2_esize) {
348 return (tag << _lh_array_tag_shift)
349 | (hsize << _lh_header_size_shift)
350 | ((int)etype << _lh_element_type_shift)
351 | (log2_esize << _lh_log2_element_size_shift);
352 }
353 static jint instance_layout_helper(jint size, bool slow_path_flag) {
354 return (size << LogHeapWordSize)
355 | (slow_path_flag ? _lh_instance_slow_path_bit : 0);
356 }
357 static int layout_helper_to_size_helper(jint lh) {
358 assert(lh > (jint)_lh_neutral_value, "must be instance");
359 // Note that the following expression discards _lh_instance_slow_path_bit.
360 return lh >> LogHeapWordSize;
361 }
362 // Out-of-line version computes everything based on the etype:
363 static jint array_layout_helper(BasicType etype);
364
|
324 static bool layout_helper_is_objArray(jint lh) {
325 // _lh_array_tag_obj_value == (lh >> _lh_array_tag_shift);
326 return (jint)lh < (jint)(_lh_array_tag_type_value << _lh_array_tag_shift);
327 }
328 static int layout_helper_header_size(jint lh) {
329 assert(lh < (jint)_lh_neutral_value, "must be array");
330 int hsize = (lh >> _lh_header_size_shift) & _lh_header_size_mask;
331 assert(hsize > 0 && hsize < (int)sizeof(oopDesc)*3, "sanity");
332 return hsize;
333 }
334 static BasicType layout_helper_element_type(jint lh) {
335 assert(lh < (jint)_lh_neutral_value, "must be array");
336 int btvalue = (lh >> _lh_element_type_shift) & _lh_element_type_mask;
337 assert(btvalue >= T_BOOLEAN && btvalue <= T_OBJECT, "sanity");
338 return (BasicType) btvalue;
339 }
340 static int layout_helper_log2_element_size(jint lh) {
341 assert(lh < (jint)_lh_neutral_value, "must be array");
342 int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask;
343 assert(l2esz <= LogBitsPerLong,
344 "sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh);
345 return l2esz;
346 }
347 static jint array_layout_helper(jint tag, int hsize, BasicType etype, int log2_esize) {
348 return (tag << _lh_array_tag_shift)
349 | (hsize << _lh_header_size_shift)
350 | ((int)etype << _lh_element_type_shift)
351 | (log2_esize << _lh_log2_element_size_shift);
352 }
353 static jint instance_layout_helper(jint size, bool slow_path_flag) {
354 return (size << LogHeapWordSize)
355 | (slow_path_flag ? _lh_instance_slow_path_bit : 0);
356 }
357 static int layout_helper_to_size_helper(jint lh) {
358 assert(lh > (jint)_lh_neutral_value, "must be instance");
359 // Note that the following expression discards _lh_instance_slow_path_bit.
360 return lh >> LogHeapWordSize;
361 }
362 // Out-of-line version computes everything based on the etype:
363 static jint array_layout_helper(BasicType etype);
364
|