v8
12.4.254 (node 22.4.1)
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-internal.h
"
// NOLINT(build/include_directory)
11
#include "
v8-local-handle.h
"
// NOLINT(build/include_directory)
12
13
namespace
v8
{
14
15
class
Context;
16
17
namespace
internal {
18
class
EmbedderState;
19
}
// namespace internal
20
21
// A StateTag represents a possible state of the embedder.
22
enum class
EmbedderStateTag
: uint8_t {
23
// reserved
24
EMPTY
= 0,
25
OTHER
= 1,
26
// embedder can define any state after
27
};
28
29
// A stack-allocated class that manages an embedder state on the isolate.
30
// After an EmbedderState scope has been created, a new embedder state will be
31
// pushed on the isolate stack.
32
class
V8_EXPORT
EmbedderStateScope
{
33
public
:
34
EmbedderStateScope
(
Isolate
* isolate,
Local<v8::Context>
context,
35
EmbedderStateTag
tag);
36
37
~EmbedderStateScope
();
38
39
private
:
40
// Declaring operator new and delete as deleted is not spec compliant.
41
// Therefore declare them private instead to disable dynamic alloc
42
void
*
operator
new
(
size_t
size);
43
void
*
operator
new
[](
size_t
size);
44
void
operator
delete
(
void
*, size_t);
45
void
operator
delete
[](
void
*, size_t);
46
47
std::unique_ptr<internal::EmbedderState> embedder_state_;
48
};
49
50
}
// namespace v8
51
52
#endif
// INCLUDE_V8_EMBEDDER_STATE_SCOPE_H_
v8::EmbedderStateScope
Definition
v8-embedder-state-scope.h:32
v8::EmbedderStateScope::~EmbedderStateScope
~EmbedderStateScope()
v8::EmbedderStateScope::EmbedderStateScope
EmbedderStateScope(Isolate *isolate, Local< v8::Context > context, EmbedderStateTag tag)
v8::Isolate
Definition
v8-isolate.h:210
v8::Local
Definition
v8-local-handle.h:258
v8
Definition
libplatform.h:15
v8::OTHER
@ OTHER
Definition
v8-unwinder.h:42
v8::EmbedderStateTag
EmbedderStateTag
Definition
v8-embedder-state-scope.h:22
v8::EmbedderStateTag::EMPTY
@ EMPTY
v8-internal.h
v8-local-handle.h
V8_EXPORT
#define V8_EXPORT
Definition
v8config.h:753
include
v8-embedder-state-scope.h
Generated on Thu Jul 11 2024 21:30:42 for v8 by
1.9.7