Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 916ee37864fc4d499398e17d6aa2ad4dbcb17b46..d72a992d252e07d43aa4ecac4f308480d3cc1af2 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -139,10 +139,26 @@ |
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++; \ |
+ base::ElapsedTimer timer; \ |
+ bool timing = false; \ |
+ if (FLAG_runtime_call_stats && !stats->in_runtime_call) { \ |
+ stats->in_runtime_call = true; \ |
+ timing = true; \ |
+ timer.Start(); \ |
+ } \ |
name##ArgumentsType args(args_length, args_object); \ |
isolate->counters()->runtime_calls()->Increment(); \ |
- return Builtin_Impl_##name(args, isolate); \ |
+ Object* value = Builtin_Impl_##name(args, isolate); \ |
+ if (timing) { \ |
+ stats->in_runtime_call = false; \ |
+ isolate->counters()->runtime_call_stats()->Time_Builtin_##name += \ |
+ timer.Elapsed(); \ |
+ } \ |
+ return value; \ |
} \ |
+ \ |
MUST_USE_RESULT static Object* Builtin_Impl_##name(name##ArgumentsType args, \ |
Isolate* isolate) |