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

Unified Diff: src/builtins.cc

Issue 1784833002: [counters] Put all counter work behind flags (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« src/arguments.h ('K') | « src/arguments.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 9e68ded426954509119fc97a2d11c49f0b358be4..8265f650d20451f4f7601795f1e3ac72b8532891 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -142,13 +142,18 @@ BUILTIN_LIST_C(DEF_ARG_TYPE)
Isolate* isolate); \
MUST_USE_RESULT static Object* Builtin_##name( \
int args_length, Object** args_object, Isolate* isolate) { \
+ Object* value; \
isolate->counters()->runtime_calls()->Increment(); \
- RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
- RuntimeCallTimerScope timer(isolate, &stats->Builtin_##name); \
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
"V8.Builtin_" #name); \
name##ArgumentsType args(args_length, args_object); \
- Object* value = Builtin_Impl_##name(args, isolate); \
+ if (FLAG_runtime_call_stats) { \
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
+ RuntimeCallTimerScope timer(isolate, &stats->Builtin_##name); \
+ value = Builtin_Impl_##name(args, isolate); \
+ } else { \
+ value = Builtin_Impl_##name(args, isolate); \
+ } \
return value; \
} \
\
« src/arguments.h ('K') | « src/arguments.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698