OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_VM_STATE_INL_H_ | 5 #ifndef V8_VM_STATE_INL_H_ |
6 #define V8_VM_STATE_INL_H_ | 6 #define V8_VM_STATE_INL_H_ |
7 | 7 |
8 #include "src/vm-state.h" | 8 #include "src/vm-state.h" |
9 #include "src/log.h" | 9 #include "src/log.h" |
10 #include "src/simulator.h" | 10 #include "src/simulator.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 previous_scope_(isolate->external_callback_scope()) { | 61 previous_scope_(isolate->external_callback_scope()) { |
62 #ifdef USE_SIMULATOR | 62 #ifdef USE_SIMULATOR |
63 scope_address_ = Simulator::current(isolate)->get_sp(); | 63 scope_address_ = Simulator::current(isolate)->get_sp(); |
64 #endif | 64 #endif |
65 isolate_->set_external_callback_scope(this); | 65 isolate_->set_external_callback_scope(this); |
66 if (FLAG_runtime_call_stats) { | 66 if (FLAG_runtime_call_stats) { |
67 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); | 67 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
68 timer_.Initialize(&stats->ExternalCallback, stats->current_timer()); | 68 timer_.Initialize(&stats->ExternalCallback, stats->current_timer()); |
69 stats->Enter(&timer_); | 69 stats->Enter(&timer_); |
70 } | 70 } |
| 71 TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), |
| 72 "V8.ExternalCallback"); |
71 } | 73 } |
72 | 74 |
73 ExternalCallbackScope::~ExternalCallbackScope() { | 75 ExternalCallbackScope::~ExternalCallbackScope() { |
74 if (FLAG_runtime_call_stats) { | 76 if (FLAG_runtime_call_stats) { |
75 isolate_->counters()->runtime_call_stats()->Leave(&timer_); | 77 isolate_->counters()->runtime_call_stats()->Leave(&timer_); |
76 } | 78 } |
77 isolate_->set_external_callback_scope(previous_scope_); | 79 isolate_->set_external_callback_scope(previous_scope_); |
| 80 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), |
| 81 "V8.ExternalCallback"); |
78 } | 82 } |
79 | 83 |
80 Address ExternalCallbackScope::scope_address() { | 84 Address ExternalCallbackScope::scope_address() { |
81 #ifdef USE_SIMULATOR | 85 #ifdef USE_SIMULATOR |
82 return scope_address_; | 86 return scope_address_; |
83 #else | 87 #else |
84 return reinterpret_cast<Address>(this); | 88 return reinterpret_cast<Address>(this); |
85 #endif | 89 #endif |
86 } | 90 } |
87 | 91 |
88 | 92 |
89 } // namespace internal | 93 } // namespace internal |
90 } // namespace v8 | 94 } // namespace v8 |
91 | 95 |
92 #endif // V8_VM_STATE_INL_H_ | 96 #endif // V8_VM_STATE_INL_H_ |
OLD | NEW |