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

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

Issue 1965133002: [runtime] Minimize runtime call stats overhead when it is disabled. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/counters.cc ('k') | src/vm-state-inl.h » ('j') | 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 328d5989e6a87b0fac527cf32fa95ed48834c45d..4bae0a4495dd0d77f9f733490e367074addb8a83 100644
--- a/src/heap/gc-tracer.cc
+++ b/src/heap/gc-tracer.cc
@@ -26,10 +26,8 @@ GCTracer::Scope::Scope(GCTracer* tracer, ScopeId 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_);
+ RuntimeCallStats::Enter(tracer_->heap_->isolate(), &timer_,
+ &RuntimeCallStats::GC);
}
}
@@ -40,7 +38,7 @@ GCTracer::Scope::~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_);
+ RuntimeCallStats::Leave(tracer_->heap_->isolate(), &timer_);
}
}
@@ -190,10 +188,7 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
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_);
+ RuntimeCallStats::Enter(heap_->isolate(), &timer_, &RuntimeCallStats::GC);
}
}
@@ -303,7 +298,7 @@ void GCTracer::Stop(GarbageCollector collector) {
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_);
+ RuntimeCallStats::Leave(heap_->isolate(), &timer_);
}
}
« no previous file with comments | « src/counters.cc ('k') | src/vm-state-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698