Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.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 | cff162798819 |
children | e9ff18c4ace7 |
comparison
equal
deleted
inserted
replaced
1570:de91a2f25c7e | 1571:2d127394260e |
---|---|
709 // If all the data in the region is live, then the new location of the object | 709 // If all the data in the region is live, then the new location of the object |
710 // can be calculated from the destination of the region plus the offset of the | 710 // can be calculated from the destination of the region plus the offset of the |
711 // object in the region. | 711 // object in the region. |
712 if (region_ptr->data_size() == RegionSize) { | 712 if (region_ptr->data_size() == RegionSize) { |
713 result += pointer_delta(addr, region_addr); | 713 result += pointer_delta(addr, region_addr); |
714 DEBUG_ONLY(PSParallelCompact::check_new_location(addr, result);) | |
714 return result; | 715 return result; |
715 } | 716 } |
716 | 717 |
717 // The new location of the object is | 718 // The new location of the object is |
718 // region destination + | 719 // region destination + |
1485 space->set_top(t); | 1486 space->set_top(t); |
1486 if (ZapUnusedHeapArea) { | 1487 if (ZapUnusedHeapArea) { |
1487 space->set_top_for_allocations(); | 1488 space->set_top_for_allocations(); |
1488 } | 1489 } |
1489 | 1490 |
1490 size_t obj_len = 8; | 1491 size_t min_size = CollectedHeap::min_fill_size(); |
1492 size_t obj_len = min_size; | |
1491 while (b + obj_len <= t) { | 1493 while (b + obj_len <= t) { |
1492 CollectedHeap::fill_with_object(b, obj_len); | 1494 CollectedHeap::fill_with_object(b, obj_len); |
1493 mark_bitmap()->mark_obj(b, obj_len); | 1495 mark_bitmap()->mark_obj(b, obj_len); |
1494 summary_data().add_obj(b, obj_len); | 1496 summary_data().add_obj(b, obj_len); |
1495 b += obj_len; | 1497 b += obj_len; |
1496 obj_len = (obj_len & 0x18) + 8; // 8 16 24 32 8 16 24 32 ... | 1498 obj_len = (obj_len & (min_size*3)) + min_size; // 8 16 24 32 8 16 24 32 ... |
1497 } | 1499 } |
1498 if (b < t) { | 1500 if (b < t) { |
1499 // The loop didn't completely fill to t (top); adjust top downward. | 1501 // The loop didn't completely fill to t (top); adjust top downward. |
1500 space->set_top(b); | 1502 space->set_top(b); |
1501 if (ZapUnusedHeapArea) { | 1503 if (ZapUnusedHeapArea) { |
1678 // e) beg_bits: ... 0 0 | 0 0 | || 0 x x ... | 1680 // e) beg_bits: ... 0 0 | 0 0 | || 0 x x ... |
1679 // end_bits: ... 0 0 | 0 0 | || 0 x x ... | 1681 // end_bits: ... 0 0 | 0 0 | || 0 x x ... |
1680 // +-------+ | 1682 // +-------+ |
1681 | 1683 |
1682 // Initially assume case a, c or e will apply. | 1684 // Initially assume case a, c or e will apply. |
1683 size_t obj_len = (size_t)oopDesc::header_size(); | 1685 size_t obj_len = CollectedHeap::min_fill_size(); |
1684 HeapWord* obj_beg = dense_prefix_end - obj_len; | 1686 HeapWord* obj_beg = dense_prefix_end - obj_len; |
1685 | 1687 |
1686 #ifdef _LP64 | 1688 #ifdef _LP64 |
1687 if (_mark_bitmap.is_obj_end(dense_prefix_bit - 2)) { | 1689 if (MinObjAlignment > 1) { // object alignment > heap word size |
1690 // Cases a, c or e. | |
1691 } else if (_mark_bitmap.is_obj_end(dense_prefix_bit - 2)) { | |
1688 // Case b above. | 1692 // Case b above. |
1689 obj_beg = dense_prefix_end - 1; | 1693 obj_beg = dense_prefix_end - 1; |
1690 } else if (!_mark_bitmap.is_obj_end(dense_prefix_bit - 3) && | 1694 } else if (!_mark_bitmap.is_obj_end(dense_prefix_bit - 3) && |
1691 _mark_bitmap.is_obj_end(dense_prefix_bit - 4)) { | 1695 _mark_bitmap.is_obj_end(dense_prefix_bit - 4)) { |
1692 // Case d above. | 1696 // Case d above. |