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

Unified Diff: src/builtins.cc

Issue 1681943002: [counter] Properly measure own-time of runtime counters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2016-02-08_builtins_timer_1678973002
Patch Set: fixing type Created 4 years, 10 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
« no previous file with comments | « src/arguments.h ('k') | src/counters.h » ('j') | 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 c6368bbd573c674417b4da5b37955b8b455f1e5e..c0a0ef7fe2ac792e16ee99dd71607a46a5fccba9 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -142,22 +142,17 @@ BUILTIN_LIST_C(DEF_ARG_TYPE)
Isolate* isolate); \
MUST_USE_RESULT static Object* Builtin_##name( \
int args_length, Object** args_object, Isolate* isolate) { \
- RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
- stats->Count_Builtin_##name++; \
+ isolate->counters()->runtime_calls()->Increment(); \
base::ElapsedTimer timer; \
- bool timing = false; \
- if (FLAG_runtime_call_stats && !stats->in_runtime_call) { \
- stats->in_runtime_call = true; \
- timing = true; \
+ if (FLAG_runtime_call_stats) { \
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
+ stats->Enter(&stats->Builtin_##name); \
timer.Start(); \
} \
name##ArgumentsType args(args_length, args_object); \
- isolate->counters()->runtime_calls()->Increment(); \
Object* value = Builtin_Impl_##name(args, isolate); \
- if (timing) { \
- stats->in_runtime_call = false; \
- isolate->counters()->runtime_call_stats()->Time_Builtin_##name += \
- timer.Elapsed(); \
+ if (FLAG_runtime_call_stats) { \
+ isolate->counters()->runtime_call_stats()->Leave(timer.Elapsed()); \
} \
return value; \
} \
« no previous file with comments | « src/arguments.h ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698