Skip to content

Commit 0665195

Browse files
committed
8334293: G1: Refactor G1ConcurrentMark::update_top_at_rebuild_start
Reviewed-by: tschatzl, iwalulya
1 parent 99fefec commit 0665195

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,14 @@ inline HeapWord* G1ConcurrentMark::top_at_rebuild_start(G1HeapRegion* r) const {
214214
}
215215

216216
inline void G1ConcurrentMark::update_top_at_rebuild_start(G1HeapRegion* r) {
217+
assert(r->is_old() || r->is_humongous(), "precondition");
218+
217219
uint const region = r->hrm_index();
218220
assert(region < _g1h->max_reserved_regions(), "Tried to access TARS for region %u out of bounds", region);
219221
assert(_top_at_rebuild_starts[region] == nullptr,
220222
"TARS for region %u has already been set to " PTR_FORMAT " should be null",
221223
region, p2i(_top_at_rebuild_starts[region]));
222-
G1RemSetTrackingPolicy* tracker = _g1h->policy()->remset_tracker();
223-
if (tracker->needs_scan_for_rebuild(r)) {
224-
_top_at_rebuild_starts[region] = r->top();
225-
} else {
226-
// Leave TARS at null.
227-
}
224+
_top_at_rebuild_starts[region] = r->top();
228225
}
229226

230227
inline void G1CMTask::update_liveness(oop const obj, const size_t obj_size) {

src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@
3030
#include "gc/g1/g1RemSetTrackingPolicy.hpp"
3131
#include "runtime/safepoint.hpp"
3232

33-
bool G1RemSetTrackingPolicy::needs_scan_for_rebuild(G1HeapRegion* r) const {
34-
// All non-free and non-young regions need to be scanned for references;
35-
// At every gc we gather references to other regions in young.
36-
// Free regions trivially do not need scanning because they do not contain live
37-
// objects.
38-
return !(r->is_young() || r->is_free());
39-
}
40-
4133
void G1RemSetTrackingPolicy::update_at_allocate(G1HeapRegion* r) {
4234
assert(r->is_young() || r->is_humongous() || r->is_old(),
4335
"Region %u with unexpected heap region type %s", r->hrm_index(), r->get_type_str());

src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
// set is complete.
3535
class G1RemSetTrackingPolicy : public CHeapObj<mtGC> {
3636
public:
37-
// Do we need to scan the given region to get all outgoing references for remembered
38-
// set rebuild?
39-
bool needs_scan_for_rebuild(G1HeapRegion* r) const;
4037
// Update remembered set tracking state at allocation of the region. May be
4138
// called at any time. The caller makes sure that the changes to the remembered
4239
// set state are visible to other threads.

0 commit comments

Comments
 (0)