@@ -362,8 +362,9 @@ HeapWord* ParallelCompactData::summarize_split_space(size_t src_region,
362
362
363
363
split_info.record (split_region, overflowing_obj, preceding_live_words);
364
364
365
- HeapWord* src_region_start = region_to_addr (src_region);
366
- HeapWord* new_top = destination - pointer_delta (src_region_start, overflowing_obj);
365
+ // The [overflowing_obj, src_region_start) part has been accounted for, so
366
+ // must move back the new_top, now that this overflowing obj is deferred.
367
+ HeapWord* new_top = destination - pointer_delta (region_to_addr (src_region), overflowing_obj);
367
368
368
369
// If the overflowing obj was relocated to its original destination,
369
370
// those destination regions would have their source_region set. Now that
@@ -890,7 +891,7 @@ void PSParallelCompact::summary_phase()
890
891
_summary_data.summarize_dense_prefix (old_space->bottom (), dense_prefix_end);
891
892
}
892
893
893
- // Compacting objs inn [dense_prefix_end, old_space->top())
894
+ // Compacting objs in [dense_prefix_end, old_space->top())
894
895
_summary_data.summarize (_space_info[id].split_info (),
895
896
dense_prefix_end, old_space->top (), nullptr ,
896
897
dense_prefix_end, old_space->end (),
@@ -1596,29 +1597,28 @@ void PSParallelCompact::forward_to_new_addr() {
1596
1597
&start_region, &end_region);
1597
1598
for (size_t cur_region = start_region; cur_region < end_region; ++cur_region) {
1598
1599
RegionData* region_ptr = _summary_data.region (cur_region);
1599
- size_t live_words = region_ptr->partial_obj_size ();
1600
+ size_t partial_obj_size = region_ptr->partial_obj_size ();
1600
1601
1601
- if (live_words == ParallelCompactData::RegionSize) {
1602
+ if (partial_obj_size == ParallelCompactData::RegionSize) {
1602
1603
// No obj-start
1603
1604
continue ;
1604
1605
}
1605
1606
1606
1607
HeapWord* region_start = _summary_data.region_to_addr (cur_region);
1607
1608
HeapWord* region_end = region_start + ParallelCompactData::RegionSize;
1608
1609
1609
-
1610
1610
if (split_info.is_split (cur_region)) {
1611
1611
// Part 1: will be relocated to space-1
1612
1612
HeapWord* preceding_destination = split_info.preceding_destination ();
1613
1613
HeapWord* split_point = split_info.split_point ();
1614
- forward_objs_in_range (cm, region_start + live_words , split_point, preceding_destination + live_words );
1614
+ forward_objs_in_range (cm, region_start + partial_obj_size , split_point, preceding_destination + partial_obj_size );
1615
1615
1616
1616
// Part 2: will be relocated to space-2
1617
1617
HeapWord* destination = region_ptr->destination ();
1618
1618
forward_objs_in_range (cm, split_point, region_end, destination);
1619
1619
} else {
1620
1620
HeapWord* destination = region_ptr->destination ();
1621
- forward_objs_in_range (cm, region_start + live_words , region_end, destination + live_words );
1621
+ forward_objs_in_range (cm, region_start + partial_obj_size , region_end, destination + partial_obj_size );
1622
1622
}
1623
1623
}
1624
1624
}
@@ -1984,11 +1984,11 @@ HeapWord* PSParallelCompact::skip_live_words(HeapWord* beg, HeapWord* end, size_
1984
1984
}
1985
1985
}
1986
1986
1987
- // On filling a destination region (dest-region), we need to know the location
1988
- // of the word that will be at the start of the dest-region after compaction.
1989
- // A dest-region can have one or more source regions, but only the first
1990
- // source-region contains this location. This location is retrieved by calling
1991
- // `first_src_addr` on a dest-region.
1987
+ // On starting to fill a destination region (dest-region), we need to know the
1988
+ // location of the word that will be at the start of the dest-region after
1989
+ // compaction. A dest-region can have one or more source regions, but only the
1990
+ // first source-region contains this location. This location is retrieved by
1991
+ // calling `first_src_addr` on a dest-region.
1992
1992
// Conversely, a source-region has a dest-region which holds the destination of
1993
1993
// the first live word on this source-region, based on which the destination
1994
1994
// for the rest of live words can be derived.
@@ -2017,9 +2017,9 @@ HeapWord* PSParallelCompact::skip_live_words(HeapWord* beg, HeapWord* end, size_
2017
2017
// ^ ^
2018
2018
// | old-space-end | eden-space-start
2019
2019
//
2020
- // Therefore, in this example, region-n will have two dest-regions, one for
2021
- // the final region in old-space and the other for the first region in
2022
- // eden-space.
2020
+ // Therefore, in this example, region-n will have two dest-regions:
2021
+ // 1. the final region in old-space
2022
+ // 2. the first region in eden-space.
2023
2023
// To handle this special case, we introduce the concept of split-region, whose
2024
2024
// contents are relocated to two spaces. `SplitInfo` captures all necessary
2025
2025
// info about the split, the first part, spliting-point, and the second part.
1 commit comments
openjdk-notifier[bot] commentedon Nov 26, 2024
Review
Issues