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