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

Unified Diff: src/counters.cc

Issue 1771323003: [counter] reducing the overhead of RuntimeCallTimerScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: further reducing overhead 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/counters.h ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index 23215925b637e4b50806ba50b5ac066593495463..60c800605ca7da570e053fa99791e8c513d7602d 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -273,7 +273,9 @@ void RuntimeCallCounter::Reset() {
}
void RuntimeCallStats::Enter(RuntimeCallCounter* counter) {
- Enter(new RuntimeCallTimer(counter, current_timer_));
+ RuntimeCallTimer* timer = new RuntimeCallTimer();
+ timer->Initialize(counter, current_timer_);
+ Enter(timer);
}
void RuntimeCallStats::Enter(RuntimeCallTimer* timer_) {
@@ -316,19 +318,19 @@ void RuntimeCallStats::Reset() {
#define RESET_COUNTER(name, type) this->Builtin_##name.Reset();
BUILTIN_LIST_C(RESET_COUNTER)
#undef RESET_COUNTER
+ this->ExternalCallback.Reset();
+ this->UnexpectedStubMiss.Reset();
}
-RuntimeCallTimerScope::RuntimeCallTimerScope(Isolate* isolate,
- RuntimeCallCounter* counter)
- : isolate_(isolate),
- timer_(counter,
- isolate->counters()->runtime_call_stats()->current_timer()) {
- if (!FLAG_runtime_call_stats) return;
- isolate->counters()->runtime_call_stats()->Enter(&timer_);
+void RuntimeCallTimerScope::Enter(Isolate* isolate,
+ RuntimeCallCounter* counter) {
+ isolate_ = isolate;
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats();
+ timer_.Initialize(counter, stats->current_timer());
+ stats->Enter(&timer_);
}
-RuntimeCallTimerScope::~RuntimeCallTimerScope() {
- if (!FLAG_runtime_call_stats) return;
+void RuntimeCallTimerScope::Leave() {
isolate_->counters()->runtime_call_stats()->Leave(&timer_);
}
« no previous file with comments | « src/counters.h ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698