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

Unified Diff: src/mark-compact.cc

Issue 2132005: Improved GC statistics (cumulative and per collection). (Closed)
Patch Set: fixed Created 10 years, 7 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.cc ('k') | tools/gc-nvp-trace-processor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index e3cc6ab6cbcefb6e99fa8374a71eb0755a90e177..554b5795de92e49ed29734e949768c12ff4cf625 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -78,6 +78,7 @@ void MarkCompactCollector::CollectGarbage() {
SweepLargeObjectSpace();
if (IsCompacting()) {
+ GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_COMPACT);
EncodeForwardingAddresses();
UpdatePointers();
@@ -678,6 +679,7 @@ void MarkCompactCollector::ProcessObjectGroups(MarkingVisitor* visitor) {
void MarkCompactCollector::MarkLiveObjects() {
+ GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_MARK);
#ifdef DEBUG
ASSERT(state_ == PREPARE_GC);
state_ = MARK_LIVE_OBJECTS;
@@ -1163,6 +1165,8 @@ static bool TryPromoteObject(HeapObject* object, int object_size) {
HeapObject* target = HeapObject::cast(result);
MigrateObject(target->address(), object->address(), object_size);
Heap::UpdateRSet(target);
+ MarkCompactCollector::tracer()->
+ increment_promoted_objects_size(object_size);
return true;
}
} else {
@@ -1177,6 +1181,8 @@ static bool TryPromoteObject(HeapObject* object, int object_size) {
if (target_space == Heap::old_pointer_space()) {
Heap::UpdateRSet(target);
}
+ MarkCompactCollector::tracer()->
+ increment_promoted_objects_size(object_size);
return true;
}
}
@@ -1735,6 +1741,8 @@ MapCompact::MapUpdatingVisitor MapCompact::map_updating_visitor_;
void MarkCompactCollector::SweepSpaces() {
+ GCTracer::Scope gc_scope(tracer_, GCTracer::Scope::MC_SWEEP);
+
ASSERT(state_ == SWEEP_SPACES);
ASSERT(!IsCompacting());
// Noncompacting collections simply sweep the spaces to clear the mark
« no previous file with comments | « src/heap.cc ('k') | tools/gc-nvp-trace-processor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698