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_); |
} |