39 // Interpreter/Compiler offsets |
39 // Interpreter/Compiler offsets |
40 |
40 |
41 // Header size computation. |
41 // Header size computation. |
42 // The header is considered the oop part of this type plus the length. |
42 // The header is considered the oop part of this type plus the length. |
43 // Returns the aligned header_size_in_bytes. This is not equivalent to |
43 // Returns the aligned header_size_in_bytes. This is not equivalent to |
44 // sizeof(arrayOopDesc) which should not appear in the code, except here. |
44 // sizeof(arrayOopDesc) which should not appear in the code. |
45 static int header_size_in_bytes() { |
45 static int header_size_in_bytes() { |
46 size_t hs = UseCompressedOops ? |
46 size_t hs = align_size_up(length_offset_in_bytes() + sizeof(int), |
47 sizeof(arrayOopDesc) : |
47 HeapWordSize); |
48 align_size_up(sizeof(arrayOopDesc) + sizeof(int), HeapWordSize); |
|
49 #ifdef ASSERT |
48 #ifdef ASSERT |
50 // make sure it isn't called before UseCompressedOops is initialized. |
49 // make sure it isn't called before UseCompressedOops is initialized. |
51 static size_t arrayoopdesc_hs = 0; |
50 static size_t arrayoopdesc_hs = 0; |
52 if (arrayoopdesc_hs == 0) arrayoopdesc_hs = hs; |
51 if (arrayoopdesc_hs == 0) arrayoopdesc_hs = hs; |
53 assert(arrayoopdesc_hs == hs, "header size can't change"); |
52 assert(arrayoopdesc_hs == hs, "header size can't change"); |