Index: src/vm-state-inl.h |
diff --git a/src/vm-state-inl.h b/src/vm-state-inl.h |
index 7c9fdb1f978c3455c43d26b7faa780cc79aba8c9..6533aa18174ee96520e1cc005d1eb1c9c78f392d 100644 |
--- a/src/vm-state-inl.h |
+++ b/src/vm-state-inl.h |
@@ -61,18 +61,25 @@ VMState<Tag>::~VMState() { |
isolate_->set_current_vm_state(previous_tag_); |
} |
- |
ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) |
: isolate_(isolate), |
callback_(callback), |
- previous_scope_(isolate->external_callback_scope()) { |
+ previous_scope_(isolate->external_callback_scope()), |
+ timer_(&isolate->counters()->runtime_call_stats()->ExternalCallback, |
+ isolate->counters()->runtime_call_stats()->current_timer()) { |
#ifdef USE_SIMULATOR |
scope_address_ = Simulator::current(isolate)->get_sp(); |
#endif |
isolate_->set_external_callback_scope(this); |
+ if (FLAG_runtime_call_stats) { |
+ isolate_->counters()->runtime_call_stats()->Enter(&timer_); |
+ } |
} |
ExternalCallbackScope::~ExternalCallbackScope() { |
+ if (FLAG_runtime_call_stats) { |
+ isolate_->counters()->runtime_call_stats()->Leave(&timer_); |
+ } |
isolate_->set_external_callback_scope(previous_scope_); |
} |