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_H_ | 5 #ifndef V8_VM_STATE_H_ |
6 #define V8_VM_STATE_H_ | 6 #define V8_VM_STATE_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
| 14 // Logging and profiling. A StateTag represents a possible state of |
| 15 // the VM. The logger maintains a stack of these. Creating a VMState |
| 16 // object enters a state by pushing on the stack, and destroying a |
| 17 // VMState object leaves a state by popping the current state from the |
| 18 // stack. |
14 template <StateTag Tag> | 19 template <StateTag Tag> |
15 class VMState BASE_EMBEDDED { | 20 class VMState BASE_EMBEDDED { |
16 public: | 21 public: |
17 explicit inline VMState(Isolate* isolate); | 22 explicit inline VMState(Isolate* isolate); |
18 inline ~VMState(); | 23 inline ~VMState(); |
19 | 24 |
20 private: | 25 private: |
21 Isolate* isolate_; | 26 Isolate* isolate_; |
22 StateTag previous_tag_; | 27 StateTag previous_tag_; |
23 }; | 28 }; |
(...skipping 14 matching lines...) Expand all Loading... |
38 ExternalCallbackScope* previous_scope_; | 43 ExternalCallbackScope* previous_scope_; |
39 #ifdef USE_SIMULATOR | 44 #ifdef USE_SIMULATOR |
40 Address scope_address_; | 45 Address scope_address_; |
41 #endif | 46 #endif |
42 }; | 47 }; |
43 | 48 |
44 } } // namespace v8::internal | 49 } } // namespace v8::internal |
45 | 50 |
46 | 51 |
47 #endif // V8_VM_STATE_H_ | 52 #endif // V8_VM_STATE_H_ |
OLD | NEW |