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

Unified Diff: src/counters.cc

Issue 1923893002: [counters] Annotate v8 with more runtime call counters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unused macro 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
« src/api.cc ('K') | « src/counters.h ('k') | src/deoptimizer.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 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_);
}
« src/api.cc ('K') | « src/counters.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698