comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @ 266:2214b226b7f0

6724367: par compact could clear less young gen summary data Reviewed-by: jmasa, apetrusenko
author jcoomes
date Fri, 11 Jul 2008 16:11:50 -0700
parents f88815ca1af1
children 850fdf70db2b
comparison
equal deleted inserted replaced
265:f88815ca1af1 266:2214b226b7f0
1637 for (id = eden_space_id; id < last_space_id; ++id) { 1637 for (id = eden_space_id; id < last_space_id; ++id) {
1638 const MutableSpace* space = _space_info[id].space(); 1638 const MutableSpace* space = _space_info[id].space();
1639 const size_t live = pointer_delta(_space_info[id].new_top(), 1639 const size_t live = pointer_delta(_space_info[id].new_top(),
1640 space->bottom()); 1640 space->bottom());
1641 const size_t available = pointer_delta(target_space_end, *new_top_addr); 1641 const size_t available = pointer_delta(target_space_end, *new_top_addr);
1642 if (live <= available) { 1642 if (live > 0 && live <= available) {
1643 // All the live data will fit. 1643 // All the live data will fit.
1644 if (TraceParallelOldGCSummaryPhase) { 1644 if (TraceParallelOldGCSummaryPhase) {
1645 tty->print_cr("summarizing %d into old_space @ " PTR_FORMAT, 1645 tty->print_cr("summarizing %d into old_space @ " PTR_FORMAT,
1646 id, *new_top_addr); 1646 id, *new_top_addr);
1647 } 1647 }
1648 _summary_data.summarize(*new_top_addr, target_space_end, 1648 _summary_data.summarize(*new_top_addr, target_space_end,
1649 space->bottom(), space->top(), 1649 space->bottom(), space->top(),
1650 new_top_addr); 1650 new_top_addr);
1651 1651
1652 // Reset the new_top value for the space.
1653 _space_info[id].set_new_top(space->bottom());
1654
1655 // Clear the source_chunk field for each chunk in the space. 1652 // Clear the source_chunk field for each chunk in the space.
1653 HeapWord* const new_top = _space_info[id].new_top();
1654 HeapWord* const clear_end = _summary_data.chunk_align_up(new_top);
1656 ChunkData* beg_chunk = _summary_data.addr_to_chunk_ptr(space->bottom()); 1655 ChunkData* beg_chunk = _summary_data.addr_to_chunk_ptr(space->bottom());
1657 ChunkData* end_chunk = _summary_data.addr_to_chunk_ptr(space->top() - 1); 1656 ChunkData* end_chunk = _summary_data.addr_to_chunk_ptr(clear_end);
1658 while (beg_chunk <= end_chunk) { 1657 while (beg_chunk < end_chunk) {
1659 beg_chunk->set_source_chunk(0); 1658 beg_chunk->set_source_chunk(0);
1660 ++beg_chunk; 1659 ++beg_chunk;
1661 } 1660 }
1661
1662 // Reset the new_top value for the space.
1663 _space_info[id].set_new_top(space->bottom());
1662 } 1664 }
1663 } 1665 }
1664 1666
1665 // Fill in the block data after any changes to the chunks have 1667 // Fill in the block data after any changes to the chunks have
1666 // been made. 1668 // been made.