Mercurial > hg > truffle
comparison src/share/vm/oops/arrayOop.hpp @ 165:437d03ea40b1
6703888: Compressed Oops: use the 32-bits gap after klass in a object
Summary: Use the gap also for a narrow oop field and a boxing object value.
Reviewed-by: coleenp, never
author | kvn |
---|---|
date | Wed, 21 May 2008 16:31:35 -0700 |
parents | ba764ed4b6f2 |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
164:c436414a719e | 165:437d03ea40b1 |
---|---|
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"); |