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 22 matching lines...) Expand all Loading... |
33 default: | 33 default: |
34 UNREACHABLE(); | 34 UNREACHABLE(); |
35 return NULL; | 35 return NULL; |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 | 39 |
40 template <StateTag Tag> | 40 template <StateTag Tag> |
41 VMState<Tag>::VMState(Isolate* isolate) | 41 VMState<Tag>::VMState(Isolate* isolate) |
42 : isolate_(isolate), previous_tag_(isolate->current_vm_state()) { | 42 : isolate_(isolate), previous_tag_(isolate->current_vm_state()) { |
43 if (previous_tag_ != EXTERNAL && Tag == EXTERNAL) { | 43 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { |
44 if (FLAG_log_timer_events) { | 44 LOG(isolate_, TimerEvent(Logger::START, TimerEventExternal::name())); |
45 LOG(isolate_, TimerEvent(Logger::START, TimerEventExternal::name())); | |
46 } | |
47 TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.External"); | |
48 } | 45 } |
49 isolate_->set_current_vm_state(Tag); | 46 isolate_->set_current_vm_state(Tag); |
50 } | 47 } |
51 | 48 |
52 | 49 |
53 template <StateTag Tag> | 50 template <StateTag Tag> |
54 VMState<Tag>::~VMState() { | 51 VMState<Tag>::~VMState() { |
55 if (previous_tag_ != EXTERNAL && Tag == EXTERNAL) { | 52 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { |
56 if (FLAG_log_timer_events) { | 53 LOG(isolate_, TimerEvent(Logger::END, TimerEventExternal::name())); |
57 LOG(isolate_, TimerEvent(Logger::END, TimerEventExternal::name())); | |
58 } | |
59 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.External"); | |
60 } | 54 } |
61 isolate_->set_current_vm_state(previous_tag_); | 55 isolate_->set_current_vm_state(previous_tag_); |
62 } | 56 } |
63 | 57 |
64 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) | 58 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) |
65 : isolate_(isolate), | 59 : isolate_(isolate), |
66 callback_(callback), | 60 callback_(callback), |
67 previous_scope_(isolate->external_callback_scope()), | 61 previous_scope_(isolate->external_callback_scope()), |
68 timer_(&isolate->counters()->runtime_call_stats()->ExternalCallback, | 62 timer_(&isolate->counters()->runtime_call_stats()->ExternalCallback, |
69 isolate->counters()->runtime_call_stats()->current_timer()) { | 63 isolate->counters()->runtime_call_stats()->current_timer()) { |
(...skipping 19 matching lines...) Expand all Loading... |
89 #else | 83 #else |
90 return reinterpret_cast<Address>(this); | 84 return reinterpret_cast<Address>(this); |
91 #endif | 85 #endif |
92 } | 86 } |
93 | 87 |
94 | 88 |
95 } // namespace internal | 89 } // namespace internal |
96 } // namespace v8 | 90 } // namespace v8 |
97 | 91 |
98 #endif // V8_VM_STATE_INL_H_ | 92 #endif // V8_VM_STATE_INL_H_ |
OLD | NEW |