< prev index next >

src/hotspot/share/gc/parallel/psParallelCompact.cpp

Print this page
rev 60422 : [mq]: 8248401-ayang-review


1027   ParCompactionManager::remove_all_shadow_regions();
1028 
1029   for (unsigned int id = old_space_id; id < last_space_id; ++id) {
1030     // Clear the marking bitmap, summary data and split info.
1031     clear_data_covering_space(SpaceId(id));
1032     // Update top().  Must be done after clearing the bitmap and summary data.
1033     _space_info[id].publish_new_top();
1034   }
1035 
1036   MutableSpace* const eden_space = _space_info[eden_space_id].space();
1037   MutableSpace* const from_space = _space_info[from_space_id].space();
1038   MutableSpace* const to_space   = _space_info[to_space_id].space();
1039 
1040   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
1041   bool eden_empty = eden_space->is_empty();
1042 
1043   // Update heap occupancy information which is used as input to the soft ref
1044   // clearing policy at the next gc.
1045   Universe::update_heap_info_at_gc();
1046 
1047   Universe::heap()->next_whole_heap_examined();
1048 
1049   bool young_gen_empty = eden_empty && from_space->is_empty() &&
1050     to_space->is_empty();
1051 
1052   PSCardTable* ct = heap->card_table();
1053   MemRegion old_mr = heap->old_gen()->reserved();
1054   if (young_gen_empty) {
1055     ct->clear(MemRegion(old_mr.start(), old_mr.end()));
1056   } else {
1057     ct->invalidate(MemRegion(old_mr.start(), old_mr.end()));
1058   }
1059 
1060   // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1061   ClassLoaderDataGraph::purge();
1062   MetaspaceUtils::verify_metrics();
1063 
1064   heap->prune_scavengable_nmethods();
1065 
1066 #if COMPILER2_OR_JVMCI
1067   DerivedPointerTable::update_pointers();
1068 #endif
1069 
1070   if (ZapUnusedHeapArea) {
1071     heap->gen_mangle_unused_area();
1072   }



1073 }
1074 
1075 HeapWord*
1076 PSParallelCompact::compute_dense_prefix_via_density(const SpaceId id,
1077                                                     bool maximum_compaction)
1078 {
1079   const size_t region_size = ParallelCompactData::RegionSize;
1080   const ParallelCompactData& sd = summary_data();
1081 
1082   const MutableSpace* const space = _space_info[id].space();
1083   HeapWord* const top_aligned_up = sd.region_align_up(space->top());
1084   const RegionData* const beg_cp = sd.addr_to_region_ptr(space->bottom());
1085   const RegionData* const end_cp = sd.addr_to_region_ptr(top_aligned_up);
1086 
1087   // Skip full regions at the beginning of the space--they are necessarily part
1088   // of the dense prefix.
1089   size_t full_count = 0;
1090   const RegionData* cp;
1091   for (cp = beg_cp; cp < end_cp && cp->data_size() == region_size; ++cp) {
1092     ++full_count;




1027   ParCompactionManager::remove_all_shadow_regions();
1028 
1029   for (unsigned int id = old_space_id; id < last_space_id; ++id) {
1030     // Clear the marking bitmap, summary data and split info.
1031     clear_data_covering_space(SpaceId(id));
1032     // Update top().  Must be done after clearing the bitmap and summary data.
1033     _space_info[id].publish_new_top();
1034   }
1035 
1036   MutableSpace* const eden_space = _space_info[eden_space_id].space();
1037   MutableSpace* const from_space = _space_info[from_space_id].space();
1038   MutableSpace* const to_space   = _space_info[to_space_id].space();
1039 
1040   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
1041   bool eden_empty = eden_space->is_empty();
1042 
1043   // Update heap occupancy information which is used as input to the soft ref
1044   // clearing policy at the next gc.
1045   Universe::update_heap_info_at_gc();
1046 


1047   bool young_gen_empty = eden_empty && from_space->is_empty() &&
1048     to_space->is_empty();
1049 
1050   PSCardTable* ct = heap->card_table();
1051   MemRegion old_mr = heap->old_gen()->reserved();
1052   if (young_gen_empty) {
1053     ct->clear(MemRegion(old_mr.start(), old_mr.end()));
1054   } else {
1055     ct->invalidate(MemRegion(old_mr.start(), old_mr.end()));
1056   }
1057 
1058   // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1059   ClassLoaderDataGraph::purge();
1060   MetaspaceUtils::verify_metrics();
1061 
1062   heap->prune_scavengable_nmethods();
1063 
1064 #if COMPILER2_OR_JVMCI
1065   DerivedPointerTable::update_pointers();
1066 #endif
1067 
1068   if (ZapUnusedHeapArea) {
1069     heap->gen_mangle_unused_area();
1070   }
1071 
1072   // Signal that we have completed a visit to all live objects.
1073   Universe::heap()->record_whole_heap_examined_timestamp();
1074 }
1075 
1076 HeapWord*
1077 PSParallelCompact::compute_dense_prefix_via_density(const SpaceId id,
1078                                                     bool maximum_compaction)
1079 {
1080   const size_t region_size = ParallelCompactData::RegionSize;
1081   const ParallelCompactData& sd = summary_data();
1082 
1083   const MutableSpace* const space = _space_info[id].space();
1084   HeapWord* const top_aligned_up = sd.region_align_up(space->top());
1085   const RegionData* const beg_cp = sd.addr_to_region_ptr(space->bottom());
1086   const RegionData* const end_cp = sd.addr_to_region_ptr(top_aligned_up);
1087 
1088   // Skip full regions at the beginning of the space--they are necessarily part
1089   // of the dense prefix.
1090   size_t full_count = 0;
1091   const RegionData* cp;
1092   for (cp = beg_cp; cp < end_cp && cp->data_size() == region_size; ++cp) {
1093     ++full_count;


< prev index next >