Skip to content

Commit f7bbbc6

Browse files
committed
8307808: G1: Remove partial object-count report after gc
Reviewed-by: tschatzl, iwalulya
1 parent 13a3fce commit f7bbbc6

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

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

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,17 @@ class G1UpdateRegionsAfterRebuild : public HeapRegionClosure {
12151215
}
12161216
};
12171217

1218+
class G1ObjectCountIsAliveClosure: public BoolObjectClosure {
1219+
G1CollectedHeap* _g1h;
1220+
public:
1221+
G1ObjectCountIsAliveClosure(G1CollectedHeap* g1h) : _g1h(g1h) { }
1222+
1223+
bool do_object_b(oop obj) {
1224+
return obj != nullptr &&
1225+
(!_g1h->is_in_reserved(obj) || !_g1h->is_obj_dead(obj));
1226+
}
1227+
};
1228+
12181229
void G1ConcurrentMark::remark() {
12191230
assert_at_safepoint_on_vm_thread();
12201231

@@ -1297,6 +1308,12 @@ void G1ConcurrentMark::remark() {
12971308
reset_at_marking_complete();
12981309

12991310
G1CollectedHeap::finish_codecache_marking_cycle();
1311+
1312+
{
1313+
GCTraceTime(Debug, gc, phases) debug("Report Object Count", _gc_timer_cm);
1314+
G1ObjectCountIsAliveClosure is_alive(_g1h);
1315+
_gc_tracer_cm->report_object_count_after_gc(&is_alive, _g1h->workers());
1316+
}
13001317
} else {
13011318
// We overflowed. Restart concurrent marking.
13021319
_restart_for_overflow = true;
@@ -1308,11 +1325,6 @@ void G1ConcurrentMark::remark() {
13081325
reset_marking_for_restart();
13091326
}
13101327

1311-
{
1312-
GCTraceTime(Debug, gc, phases) debug("Report Object Count", _gc_timer_cm);
1313-
report_object_count(mark_finished);
1314-
}
1315-
13161328
// Statistics
13171329
double now = os::elapsedTime();
13181330
_remark_mark_times.add((mark_work_end - start) * 1000.0);
@@ -1715,29 +1727,6 @@ void G1ConcurrentMark::preclean() {
17151727
_gc_timer_cm);
17161728
}
17171729

1718-
class G1ObjectCountIsAliveClosure: public BoolObjectClosure {
1719-
G1CollectedHeap* _g1h;
1720-
public:
1721-
G1ObjectCountIsAliveClosure(G1CollectedHeap* g1h) : _g1h(g1h) { }
1722-
1723-
bool do_object_b(oop obj) {
1724-
return obj != nullptr &&
1725-
(!_g1h->is_in_reserved(obj) || !_g1h->is_obj_dead(obj));
1726-
}
1727-
};
1728-
1729-
void G1ConcurrentMark::report_object_count(bool mark_completed) {
1730-
// Depending on the completion of the marking liveness needs to be determined
1731-
// using either the bitmap or after the cycle using the scrubbing information.
1732-
if (mark_completed) {
1733-
G1ObjectCountIsAliveClosure is_alive(_g1h);
1734-
_gc_tracer_cm->report_object_count_after_gc(&is_alive, _g1h->workers());
1735-
} else {
1736-
G1CMIsAliveClosure is_alive(_g1h);
1737-
_gc_tracer_cm->report_object_count_after_gc(&is_alive, _g1h->workers());
1738-
}
1739-
}
1740-
17411730
// Closure for marking entries in SATB buffers.
17421731
class G1CMSATBBufferClosure : public SATBBufferClosure {
17431732
private:

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,6 @@ class G1ConcurrentMark : public CHeapObj<mtGC> {
375375

376376
void weak_refs_work();
377377

378-
void report_object_count(bool mark_completed);
379-
380378
void reclaim_empty_regions();
381379

382380
// After reclaiming empty regions, update heap sizes.

0 commit comments

Comments
 (0)