Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: src/heap/mark-compact.cc

Issue 2147693004: [heap] ObjectStats: Fix accounting for fixed array subtypes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More fixed array types Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/marking.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index a4c1971c13f33355ec5468dccadda52e130d53c0..eca2880acd174b0bc7e6e620899ad17f6cd3d794 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -336,6 +336,8 @@ void MarkCompactCollector::CollectGarbage() {
ClearNonLiveReferences();
+ RecordObjectStats();
+
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
VerifyMarking(heap_);
@@ -2273,6 +2275,20 @@ void MarkCompactCollector::VisitAllObjects(HeapObjectVisitor* visitor) {
}
}
+void MarkCompactCollector::RecordObjectStats() {
+ if (FLAG_track_gc_object_stats) {
+ ObjectStatsVisitor visitor(heap()->live_object_stats_,
+ heap()->dead_object_stats_);
+ VisitAllObjects(&visitor);
+ if (FLAG_trace_gc_object_stats) {
+ heap()->live_object_stats_->PrintJSON("live");
+ heap()->dead_object_stats_->PrintJSON("dead");
+ }
+ heap()->live_object_stats_->CheckpointObjectStats();
+ heap()->dead_object_stats_->ClearObjectStats();
+ }
+}
+
void MarkCompactCollector::MarkLiveObjects() {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK);
double start_time = 0.0;
@@ -2372,17 +2388,6 @@ void MarkCompactCollector::MarkLiveObjects() {
heap_->tracer()->AddMarkingTime(heap_->MonotonicallyIncreasingTimeInMs() -
start_time);
}
- if (FLAG_track_gc_object_stats) {
- ObjectStatsVisitor visitor(heap()->live_object_stats_,
- heap()->dead_object_stats_);
- VisitAllObjects(&visitor);
- if (FLAG_trace_gc_object_stats) {
- heap()->live_object_stats_->PrintJSON("live");
- heap()->dead_object_stats_->PrintJSON("dead");
- }
- heap()->live_object_stats_->CheckpointObjectStats();
- heap()->dead_object_stats_->ClearObjectStats();
- }
}
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698