|
57 | 57 | #include "gc/shared/referencePolicy.hpp" |
58 | 58 | #include "gc/shared/referenceProcessor.hpp" |
59 | 59 | #include "gc/shared/referenceProcessorPhaseTimes.hpp" |
60 | | -#include "gc/shared/spaceDecorator.inline.hpp" |
61 | 60 | #include "gc/shared/strongRootsScope.hpp" |
62 | 61 | #include "gc/shared/taskTerminator.hpp" |
63 | 62 | #include "gc/shared/weakProcessor.inline.hpp" |
@@ -963,8 +962,16 @@ void PSParallelCompact::post_compact() |
963 | 962 | for (unsigned int id = old_space_id; id < last_space_id; ++id) { |
964 | 963 | // Clear the marking bitmap, summary data and split info. |
965 | 964 | clear_data_covering_space(SpaceId(id)); |
966 | | - // Update top(). Must be done after clearing the bitmap and summary data. |
967 | | - _space_info[id].publish_new_top(); |
| 965 | + { |
| 966 | + MutableSpace* space = _space_info[id].space(); |
| 967 | + HeapWord* top = space->top(); |
| 968 | + HeapWord* new_top = _space_info[id].new_top(); |
| 969 | + if (ZapUnusedHeapArea && new_top < top) { |
| 970 | + space->mangle_region(MemRegion(new_top, top)); |
| 971 | + } |
| 972 | + // Update top(). Must be done after clearing the bitmap and summary data. |
| 973 | + space->set_top(new_top); |
| 974 | + } |
968 | 975 | } |
969 | 976 |
|
970 | 977 | ParCompactionManager::flush_all_string_dedup_requests(); |
@@ -1007,10 +1014,6 @@ void PSParallelCompact::post_compact() |
1007 | 1014 | DerivedPointerTable::update_pointers(); |
1008 | 1015 | #endif |
1009 | 1016 |
|
1010 | | - if (ZapUnusedHeapArea) { |
1011 | | - heap->gen_mangle_unused_area(); |
1012 | | - } |
1013 | | - |
1014 | 1017 | // Signal that we have completed a visit to all live objects. |
1015 | 1018 | Universe::heap()->record_whole_heap_examined_timestamp(); |
1016 | 1019 | } |
@@ -1307,11 +1310,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { |
1307 | 1310 | ClearedAllSoftRefs casr(maximum_heap_compaction, |
1308 | 1311 | heap->soft_ref_policy()); |
1309 | 1312 |
|
1310 | | - if (ZapUnusedHeapArea) { |
1311 | | - // Save information needed to minimize mangling |
1312 | | - heap->record_gen_tops_before_GC(); |
1313 | | - } |
1314 | | - |
1315 | 1313 | // Make sure data structures are sane, make the heap parsable, and do other |
1316 | 1314 | // miscellaneous bookkeeping. |
1317 | 1315 | pre_compact(); |
@@ -1469,10 +1467,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { |
1469 | 1467 | Universe::verify("After GC"); |
1470 | 1468 | } |
1471 | 1469 |
|
1472 | | - if (ZapUnusedHeapArea) { |
1473 | | - old_gen->object_space()->check_mangled_unused_area_complete(); |
1474 | | - } |
1475 | | - |
1476 | 1470 | heap->print_heap_after_gc(); |
1477 | 1471 | heap->trace_heap_after_gc(&_gc_tracer); |
1478 | 1472 |
|
|
0 commit comments