@@ -1215,6 +1215,17 @@ class G1UpdateRegionsAfterRebuild : public HeapRegionClosure {
1215
1215
}
1216
1216
};
1217
1217
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
+
1218
1229
void G1ConcurrentMark::remark () {
1219
1230
assert_at_safepoint_on_vm_thread ();
1220
1231
@@ -1297,6 +1308,12 @@ void G1ConcurrentMark::remark() {
1297
1308
reset_at_marking_complete ();
1298
1309
1299
1310
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
+ }
1300
1317
} else {
1301
1318
// We overflowed. Restart concurrent marking.
1302
1319
_restart_for_overflow = true ;
@@ -1308,11 +1325,6 @@ void G1ConcurrentMark::remark() {
1308
1325
reset_marking_for_restart ();
1309
1326
}
1310
1327
1311
- {
1312
- GCTraceTime (Debug, gc, phases) debug (" Report Object Count" , _gc_timer_cm);
1313
- report_object_count (mark_finished);
1314
- }
1315
-
1316
1328
// Statistics
1317
1329
double now = os::elapsedTime ();
1318
1330
_remark_mark_times.add ((mark_work_end - start) * 1000.0 );
@@ -1715,29 +1727,6 @@ void G1ConcurrentMark::preclean() {
1715
1727
_gc_timer_cm);
1716
1728
}
1717
1729
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
-
1741
1730
// Closure for marking entries in SATB buffers.
1742
1731
class G1CMSATBBufferClosure : public SATBBufferClosure {
1743
1732
private:
0 commit comments