Commit 1b67e9c8 authored by cbruni's avatar cbruni Committed by Commit bot

[counters] Put all counter work behind flags

Avoid creating and initializing timer scopes for builtins as well.

BUG=chromium:589679
LOG=N

Review URL: https://codereview.chromium.org/1784833002

Cr-Commit-Position: refs/heads/master@{#34707}
parent 0ca38a6d
......@@ -83,9 +83,9 @@ double ClobberDoubleRegisters(double x1, double x2, double x3, double x4);
static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
Type Name(int args_length, Object** args_object, Isolate* isolate) { \
CLOBBER_DOUBLE_REGISTERS(); \
Arguments args(args_length, args_object); \
Type value; \
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), "V8." #Name); \
Arguments args(args_length, args_object); \
if (FLAG_runtime_call_stats) { \
RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
RuntimeCallTimerScope timer(isolate, &stats->Name); \
......
......@@ -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; \
} \
\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment