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

Unified Diff: src/heap/heap.cc

Issue 1375963003: [heap] Add specific timer events for finalizing incremental GCs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index d8ad42ccfc7a4e33ce2d90970bc86535cc119676..5daeb46703102a272ea565c83d53794c4eac148e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -819,6 +819,23 @@ void Heap::OverApproximateWeakClosure(const char* gc_reason) {
}
+HistogramTimer* Heap::GCTypeTimer(GarbageCollector collector) {
+ if (collector == SCAVENGER) {
+ return isolate_->counters()->gc_scavenger();
+ } else {
+ if (!incremental_marking()->IsStopped()) {
+ if (ShouldReduceMemory()) {
+ return isolate_->counters()->gc_finalize_reduce_memory();
+ } else {
+ return isolate_->counters()->gc_finalize();
+ }
+ } else {
+ return isolate_->counters()->gc_compactor();
+ }
+ }
+}
+
+
void Heap::CollectAllGarbage(int flags, const char* gc_reason,
const v8::GCCallbackFlags gc_callback_flags) {
// Since we are ignoring the return value, the exact choice of space does
@@ -964,9 +981,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
GarbageCollectionPrologue();
{
- HistogramTimerScope histogram_timer_scope(
- (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger()
- : isolate_->counters()->gc_compactor());
+ HistogramTimerScope histogram_timer_scope(GCTypeTimer(collector));
+
next_gc_likely_to_collect_more =
PerformGarbageCollection(collector, gc_callback_flags);
}
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698