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
3 // found in the LICENSE file.
8 #include "src/allocation.h"
9 #include "src/isolate.h"
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
19 template <StateTag Tag>
20 class VMState BASE_EMBEDDED {
22 explicit inline VMState(Isolate* isolate);
27 StateTag previous_tag_;
31 class ExternalCallbackScope BASE_EMBEDDED {
33 inline ExternalCallbackScope(Isolate* isolate, Address callback);
34 inline ~ExternalCallbackScope();
35 Address callback() { return callback_; }
36 Address* callback_address() { return &callback_; }
37 ExternalCallbackScope* previous() { return previous_scope_; }
38 inline Address scope_address();
43 ExternalCallbackScope* previous_scope_;
45 Address scope_address_;
49 } // namespace internal
53 #endif // V8_VM_STATE_H_