Mercurial > hg > truffle
diff src/share/vm/memory/space.cpp @ 1571:2d127394260e
6916623: Align object to 16 bytes to use Compressed Oops with java heap up to 64Gb
Summary: Added new product ObjectAlignmentInBytes flag to control object alignment.
Reviewed-by: twisti, ysr, iveresov
author | kvn |
---|---|
date | Thu, 27 May 2010 18:01:56 -0700 |
parents | 4ce7240d622c |
children | e9ff18c4ace7 |
line wrap: on
line diff
--- a/src/share/vm/memory/space.cpp Thu May 27 09:54:07 2010 -0700 +++ b/src/share/vm/memory/space.cpp Thu May 27 18:01:56 2010 -0700 @@ -861,9 +861,9 @@ } size = align_object_size(size); - const size_t min_int_array_size = typeArrayOopDesc::header_size(T_INT); - if (size >= min_int_array_size) { - size_t length = (size - min_int_array_size) * (HeapWordSize / sizeof(jint)); + const size_t array_header_size = typeArrayOopDesc::header_size(T_INT); + if (size >= (size_t)align_object_size(array_header_size)) { + size_t length = (size - array_header_size) * (HeapWordSize / sizeof(jint)); // allocate uninitialized int array typeArrayOop t = (typeArrayOop) allocate(size); assert(t != NULL, "allocation should succeed"); @@ -871,7 +871,7 @@ t->set_klass(Universe::intArrayKlassObj()); t->set_length((int)length); } else { - assert((int) size == instanceOopDesc::header_size(), + assert(size == CollectedHeap::min_fill_size(), "size for smallest fake object doesn't match"); instanceOop obj = (instanceOop) allocate(size); obj->set_mark(markOopDesc::prototype());