Mercurial > hg > truffle
comparison src/share/vm/memory/universe.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 | cd5dbf694d45 |
children | e9ff18c4ace7 |
comparison
equal
deleted
inserted
replaced
1570:de91a2f25c7e | 1571:2d127394260e |
---|---|
746 // HeapBased - Use compressed oops with heap base + encoding. | 746 // HeapBased - Use compressed oops with heap base + encoding. |
747 | 747 |
748 // 4Gb | 748 // 4Gb |
749 static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); | 749 static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); |
750 // 32Gb | 750 // 32Gb |
751 static const uint64_t OopEncodingHeapMax = NarrowOopHeapMax << LogMinObjAlignmentInBytes; | 751 // OopEncodingHeapMax == NarrowOopHeapMax << LogMinObjAlignmentInBytes; |
752 | 752 |
753 char* Universe::preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode) { | 753 char* Universe::preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode) { |
754 size_t base = 0; | 754 size_t base = 0; |
755 #ifdef _LP64 | 755 #ifdef _LP64 |
756 if (UseCompressedOops) { | 756 if (UseCompressedOops) { |
1259 HeapWord* high_boundary) { | 1259 HeapWord* high_boundary) { |
1260 assert(low_boundary < high_boundary, "bad interval"); | 1260 assert(low_boundary < high_boundary, "bad interval"); |
1261 | 1261 |
1262 // decide which low-order bits we require to be clear: | 1262 // decide which low-order bits we require to be clear: |
1263 size_t alignSize = MinObjAlignmentInBytes; | 1263 size_t alignSize = MinObjAlignmentInBytes; |
1264 size_t min_object_size = oopDesc::header_size(); | 1264 size_t min_object_size = CollectedHeap::min_fill_size(); |
1265 | 1265 |
1266 // make an inclusive limit: | 1266 // make an inclusive limit: |
1267 uintptr_t max = (uintptr_t)high_boundary - min_object_size*wordSize; | 1267 uintptr_t max = (uintptr_t)high_boundary - min_object_size*wordSize; |
1268 uintptr_t min = (uintptr_t)low_boundary; | 1268 uintptr_t min = (uintptr_t)low_boundary; |
1269 assert(min < max, "bad interval"); | 1269 assert(min < max, "bad interval"); |