| Index: src/counters.cc
|
| diff --git a/src/counters.cc b/src/counters.cc
|
| index 4f5c251a0cce8a42f5f33e057c4032f493b365cc..2b4ecace98d729cea890aa5e8fa597b0521cfab9 100644
|
| --- a/src/counters.cc
|
| +++ b/src/counters.cc
|
| @@ -299,33 +299,51 @@ void RuntimeCallStats::Print(std::ostream& os) {
|
| #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name);
|
| FOR_EACH_INTRINSIC(PRINT_COUNTER)
|
| #undef PRINT_COUNTER
|
| -
|
| #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name);
|
| BUILTIN_LIST_C(PRINT_COUNTER)
|
| #undef PRINT_COUNTER
|
| -
|
| - entries.Add(&this->ExternalCallback);
|
| - entries.Add(&this->GC);
|
| - entries.Add(&this->UnexpectedStubMiss);
|
| +#define PRINT_COUNTER(name) entries.Add(&this->API_##name);
|
| + API_COUNTER(PRINT_COUNTER)
|
| +#undef PRINT_COUNTER
|
| +#define PRINT_COUNTER(name) entries.Add(&this->name);
|
| + OTHER_COUNTER(PRINT_COUNTER)
|
| +#undef PRINT_COUNTER
|
|
|
| entries.Print(os);
|
| }
|
|
|
| void RuntimeCallStats::Reset() {
|
| if (!FLAG_runtime_call_stats) return;
|
| -#define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset();
|
| +#define RESET_COUNTER(name, nargs, result_size) this->Runtime_##name.Reset();
|
| FOR_EACH_INTRINSIC(RESET_COUNTER)
|
| #undef RESET_COUNTER
|
| #define RESET_COUNTER(name, type) this->Builtin_##name.Reset();
|
| BUILTIN_LIST_C(RESET_COUNTER)
|
| #undef RESET_COUNTER
|
| - this->ExternalCallback.Reset();
|
| - this->GC.Reset();
|
| - this->UnexpectedStubMiss.Reset();
|
| +#define RESET_COUNTER(name) this->API_##name.Reset();
|
| + API_COUNTER(RESET_COUNTER)
|
| +#undef RESET_COUNTER
|
| +#define RESET_COUNTER(name) this->name.Reset();
|
| + OTHER_COUNTER(RESET_COUNTER)
|
| +#undef RESET_COUNTER
|
| +
|
| + if (FLAG_api_call_stats) {
|
| +#define RESET_COUNTER(name, nargs, result_size) \
|
| + this->Runtime_##name.enabled = false;
|
| + FOR_EACH_INTRINSIC(RESET_COUNTER)
|
| +#undef RESET_COUNTER
|
| +#define RESET_COUNTER(name, type) this->Builtin_##name.enabled = false;
|
| + BUILTIN_LIST_C(RESET_COUNTER)
|
| +#undef RESET_COUNTER
|
| + }
|
| }
|
|
|
| void RuntimeCallTimerScope::Enter(Isolate* isolate,
|
| RuntimeCallCounter* counter) {
|
| + if (!counter->enabled) {
|
| + timer_.Initialize(NULL, NULL);
|
| + return;
|
| + }
|
| isolate_ = isolate;
|
| RuntimeCallStats* stats = isolate->counters()->runtime_call_stats();
|
| timer_.Initialize(counter, stats->current_timer());
|
| @@ -333,6 +351,7 @@ void RuntimeCallTimerScope::Enter(Isolate* isolate,
|
| }
|
|
|
| void RuntimeCallTimerScope::Leave() {
|
| + if (!timer_.enabled()) return;
|
| isolate_->counters()->runtime_call_stats()->Leave(&timer_);
|
| }
|
|
|
|
|