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
14
namespace
v8
{
15
16
namespace
internal {
17
class
EmbedderState;
18
}
// namespace internal
19
20
// A StateTag represents a possible state of the embedder.
21
enum 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.
31
class
V8_EXPORT
EmbedderStateScope
{
32
public
:
33
EmbedderStateScope
(
Isolate
* isolate,
Local<v8::Context>
context,
34
EmbedderStateTag
tag);
35
36
~EmbedderStateScope
();
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_
v8::EmbedderStateScope
Definition
v8-embedder-state-scope.h:31
v8::EmbedderStateScope::~EmbedderStateScope
~EmbedderStateScope()
v8::EmbedderStateScope::EmbedderStateScope
EmbedderStateScope(Isolate *isolate, Local< v8::Context > context, EmbedderStateTag tag)
v8::Isolate
Definition
v8-isolate.h:205
v8::Local
Definition
v8-local-handle.h:155
v8
Definition
libplatform.h:15
v8::OTHER
@ OTHER
Definition
v8-unwinder.h:42
v8::EmbedderStateTag
EmbedderStateTag
Definition
v8-embedder-state-scope.h:21
v8::EmbedderStateTag::EMPTY
@ EMPTY
v8-context.h
v8-internal.h
v8-local-handle.h
V8_EXPORT
#define V8_EXPORT
Definition
v8config.h:578
include
v8-embedder-state-scope.h
Generated on Sat Jun 10 2023 16:59:17 for v8 by
1.9.7