v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-embedder-state-scope.h
Go to the documentation of this file.
1// Copyright 2021 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.
4
5#ifndef INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
6#define INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
7
8#include <memory>
9
10#include "v8-context.h" // NOLINT(build/include_directory)
11#include "v8-internal.h" // NOLINT(build/include_directory)
12#include "v8-local-handle.h" // NOLINT(build/include_directory)
13
14namespace v8 {
15
16namespace internal {
17class EmbedderState;
18} // namespace internal
19
20// A StateTag represents a possible state of the embedder.
21enum class EmbedderStateTag : uint8_t {
22 // reserved
23 EMPTY = 0,
24 OTHER = 1,
25 // embedder can define any state after
26};
27
28// A stack-allocated class that manages an embedder state on the isolate.
29// After an EmbedderState scope has been created, a new embedder state will be
30// pushed on the isolate stack.
32 public:
35
37
38 private:
39 // Declaring operator new and delete as deleted is not spec compliant.
40 // Therefore declare them private instead to disable dynamic alloc
41 void* operator new(size_t size);
42 void* operator new[](size_t size);
43 void operator delete(void*, size_t);
44 void operator delete[](void*, size_t);
45
46 std::unique_ptr<internal::EmbedderState> embedder_state_;
47};
48
49} // namespace v8
50
51#endif // INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
EmbedderStateScope(Isolate *isolate, Local< v8::Context > context, EmbedderStateTag tag)
@ OTHER
Definition v8-unwinder.h:42
#define V8_EXPORT
Definition v8config.h:578