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 UNREACHABLE(); | 33 UNREACHABLE(); |
34 return NULL; | 34 return NULL; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 template <StateTag Tag> | 39 template <StateTag Tag> |
40 VMState<Tag>::VMState(Isolate* isolate) | 40 VMState<Tag>::VMState(Isolate* isolate) |
41 : isolate_(isolate), previous_tag_(isolate->current_vm_state()) { | 41 : isolate_(isolate), previous_tag_(isolate->current_vm_state()) { |
42 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { | 42 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { |
43 LOG(isolate_, | 43 LOG(isolate_, TimerEvent(Logger::START, TimerEventExternal::name())); |
44 TimerEvent(Logger::START, Logger::TimerEventScope::v8_external)); | |
45 } | 44 } |
46 isolate_->set_current_vm_state(Tag); | 45 isolate_->set_current_vm_state(Tag); |
47 } | 46 } |
48 | 47 |
49 | 48 |
50 template <StateTag Tag> | 49 template <StateTag Tag> |
51 VMState<Tag>::~VMState() { | 50 VMState<Tag>::~VMState() { |
52 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { | 51 if (FLAG_log_timer_events && previous_tag_ != EXTERNAL && Tag == EXTERNAL) { |
53 LOG(isolate_, | 52 LOG(isolate_, TimerEvent(Logger::END, TimerEventExternal::name())); |
54 TimerEvent(Logger::END, Logger::TimerEventScope::v8_external)); | |
55 } | 53 } |
56 isolate_->set_current_vm_state(previous_tag_); | 54 isolate_->set_current_vm_state(previous_tag_); |
57 } | 55 } |
58 | 56 |
59 | 57 |
60 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) | 58 ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback) |
61 : isolate_(isolate), | 59 : isolate_(isolate), |
62 callback_(callback), | 60 callback_(callback), |
63 previous_scope_(isolate->external_callback_scope()) { | 61 previous_scope_(isolate->external_callback_scope()) { |
64 #ifdef USE_SIMULATOR | 62 #ifdef USE_SIMULATOR |
(...skipping 11 matching lines...) Expand all Loading... |
76 return scope_address_; | 74 return scope_address_; |
77 #else | 75 #else |
78 return reinterpret_cast<Address>(this); | 76 return reinterpret_cast<Address>(this); |
79 #endif | 77 #endif |
80 } | 78 } |
81 | 79 |
82 | 80 |
83 } } // namespace v8::internal | 81 } } // namespace v8::internal |
84 | 82 |
85 #endif // V8_VM_STATE_INL_H_ | 83 #endif // V8_VM_STATE_INL_H_ |
OLD | NEW |