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

Unified Diff: src/heap/gc-tracer.cc

Issue 1826833002: Reland of [counters] adding runtime call timers for GC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/gc-tracer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-tracer.cc
diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
index 4d02fdeff57071ef61ec73ca3feb90653ca27eb2..e3828e58efdf6be4404ecd4ce84910d568be3870 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -24,6 +24,13 @@
GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope)
: tracer_(tracer), scope_(scope) {
start_time_ = tracer_->heap_->MonotonicallyIncreasingTimeInMs();
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
+ if (FLAG_runtime_call_stats) {
+ RuntimeCallStats* stats =
+ tracer_->heap_->isolate()->counters()->runtime_call_stats();
+ timer_.Initialize(&stats->GC, stats->current_timer());
+ stats->Enter(&timer_);
+ }
}
@@ -31,6 +38,10 @@
DCHECK(scope_ < NUMBER_OF_SCOPES); // scope_ is unsigned.
tracer_->current_.scopes[scope_] +=
tracer_->heap_->MonotonicallyIncreasingTimeInMs() - start_time_;
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
+ if (FLAG_runtime_call_stats) {
+ tracer_->heap_->isolate()->counters()->runtime_call_stats()->Leave(&timer_);
+ }
}
@@ -182,6 +193,13 @@
start_time, committed_memory);
heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
start_time, used_memory);
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
+ if (FLAG_runtime_call_stats) {
+ RuntimeCallStats* stats =
+ heap_->isolate()->counters()->runtime_call_stats();
+ timer_.Initialize(&stats->GC, stats->current_timer());
+ stats->Enter(&timer_);
+ }
}
@@ -281,6 +299,10 @@
longest_incremental_marking_finalization_step_ = 0.0;
cumulative_incremental_marking_finalization_steps_ = 0;
cumulative_incremental_marking_finalization_duration_ = 0.0;
+ // TODO(cbruni): remove once we fully moved to a trace-based system.
+ if (FLAG_runtime_call_stats) {
+ heap_->isolate()->counters()->runtime_call_stats()->Leave(&timer_);
+ }
}
« no previous file with comments | « src/heap/gc-tracer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698