890 }
891
892 void PSParallelCompact::initialize_space_info()
893 {
894 memset(&_space_info, 0, sizeof(_space_info));
895
896 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
897 PSYoungGen* young_gen = heap->young_gen();
898
899 _space_info[old_space_id].set_space(heap->old_gen()->object_space());
900 _space_info[eden_space_id].set_space(young_gen->eden_space());
901 _space_info[from_space_id].set_space(young_gen->from_space());
902 _space_info[to_space_id].set_space(young_gen->to_space());
903
904 _space_info[old_space_id].set_start_array(heap->old_gen()->start_array());
905 }
906
907 void PSParallelCompact::initialize_dead_wood_limiter()
908 {
909 const size_t max = 100;
910 _dwl_mean = double(MIN2(ParallelOldDeadWoodLimiterMean, max)) / 100.0;
911 _dwl_std_dev = double(MIN2(ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
912 _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
913 DEBUG_ONLY(_dwl_initialized = true;)
914 _dwl_adjustment = normal_distribution(1.0);
915 }
916
917 void
918 PSParallelCompact::clear_data_covering_space(SpaceId id)
919 {
920 // At this point, top is the value before GC, new_top() is the value that will
921 // be set at the end of GC. The marking bitmap is cleared to top; nothing
922 // should be marked above top. The summary data is cleared to the larger of
923 // top & new_top.
924 MutableSpace* const space = _space_info[id].space();
925 HeapWord* const bot = space->bottom();
926 HeapWord* const top = space->top();
927 HeapWord* const max_top = MAX2(top, _space_info[id].new_top());
928
929 const idx_t beg_bit = _mark_bitmap.addr_to_bit(bot);
930 const idx_t end_bit = BitMap::word_align_up(_mark_bitmap.addr_to_bit(top));
931 _mark_bitmap.clear_range(beg_bit, end_bit);
|
890 }
891
892 void PSParallelCompact::initialize_space_info()
893 {
894 memset(&_space_info, 0, sizeof(_space_info));
895
896 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
897 PSYoungGen* young_gen = heap->young_gen();
898
899 _space_info[old_space_id].set_space(heap->old_gen()->object_space());
900 _space_info[eden_space_id].set_space(young_gen->eden_space());
901 _space_info[from_space_id].set_space(young_gen->from_space());
902 _space_info[to_space_id].set_space(young_gen->to_space());
903
904 _space_info[old_space_id].set_start_array(heap->old_gen()->start_array());
905 }
906
907 void PSParallelCompact::initialize_dead_wood_limiter()
908 {
909 const size_t max = 100;
910 _dwl_mean = double(MIN2((size_t)ParallelOldDeadWoodLimiterMean, max)) / 100.0;
911 _dwl_std_dev = double(MIN2((size_t)ParallelOldDeadWoodLimiterStdDev, max)) / 100.0;
912 _dwl_first_term = 1.0 / (sqrt(2.0 * M_PI) * _dwl_std_dev);
913 DEBUG_ONLY(_dwl_initialized = true;)
914 _dwl_adjustment = normal_distribution(1.0);
915 }
916
917 void
918 PSParallelCompact::clear_data_covering_space(SpaceId id)
919 {
920 // At this point, top is the value before GC, new_top() is the value that will
921 // be set at the end of GC. The marking bitmap is cleared to top; nothing
922 // should be marked above top. The summary data is cleared to the larger of
923 // top & new_top.
924 MutableSpace* const space = _space_info[id].space();
925 HeapWord* const bot = space->bottom();
926 HeapWord* const top = space->top();
927 HeapWord* const max_top = MAX2(top, _space_info[id].new_top());
928
929 const idx_t beg_bit = _mark_bitmap.addr_to_bit(bot);
930 const idx_t end_bit = BitMap::word_align_up(_mark_bitmap.addr_to_bit(top));
931 _mark_bitmap.clear_range(beg_bit, end_bit);
|