v8
14.1.146 (node 25.0.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-embedder-heap.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_HEAP_H_
6
#
define
INCLUDE_V8_EMBEDDER_HEAP_H_
7
8
#
include
"v8-traced-handle.h"
// NOLINT(build/include_directory)
9
#
include
"v8config.h"
// NOLINT(build/include_directory)
10
11
namespace
v8
{
12
namespace
internal
{
13
class
TracedHandles;
14
}
// namespace internal
15
16
class
Isolate
;
17
class
Value
;
18
19
/**
20
* Handler for embedder roots on non-unified heap garbage collections.
21
*/
22
class
V8_EXPORT
EmbedderRootsHandler
{
23
public
:
24
virtual
~
EmbedderRootsHandler
() =
default
;
25
26
EmbedderRootsHandler
() =
default
;
27
28
/**
29
* Used in combination with |IsRoot|. Called by V8 when an
30
* object that is backed by a handle is reclaimed by a non-tracing garbage
31
* collection. It is up to the embedder to reset the original handle.
32
*
33
* Note that the |handle| is different from the handle that the embedder holds
34
* for retaining the object. It is up to the embedder to find the original
35
* handle via the object or class id.
36
*/
37
virtual
void
ResetRoot
(
const
v8
::
TracedReference
<
v8
::
Value
>& handle) = 0;
38
39
/**
40
* Similar to |ResetRoot()|, but opportunistic. The function is called in
41
* parallel for different handles and as such must be thread-safe. In case,
42
* |false| is returned, |ResetRoot()| will be recalled for the same handle.
43
*/
44
virtual
bool
TryResetRoot
(
const
v8
::
TracedReference
<
v8
::
Value
>& handle) {
45
return
false
;
46
}
47
48
private
:
49
friend
class
internal
::TracedHandles;
50
};
51
52
}
// namespace v8
53
54
#
endif
// INCLUDE_V8_EMBEDDER_HEAP_H_
v8::BasicTracedReference::TracedReference
friend class TracedReference
Definition
v8-traced-handle.h:152
v8::EmbedderRootsHandler
Definition
v8-embedder-heap.h:22
v8::EmbedderRootsHandler::TryResetRoot
virtual bool TryResetRoot(const v8::TracedReference< v8::Value > &handle)
Definition
v8-embedder-heap.h:44
v8::EmbedderRootsHandler::~EmbedderRootsHandler
virtual ~EmbedderRootsHandler()=default
v8::EmbedderRootsHandler::EmbedderRootsHandler
EmbedderRootsHandler()=default
v8::EmbedderRootsHandler::ResetRoot
virtual void ResetRoot(const v8::TracedReference< v8::Value > &handle)=0
v8::Isolate
Definition
v8-isolate.h:290
v8::Value
Definition
v8-value.h:32
v8::internal
Definition
v8-cppgc.h:29
v8
Definition
libplatform.h:15
V8_EXPORT
#define V8_EXPORT
Definition
v8config.h:860
include
v8-embedder-heap.h
Generated on Thu Oct 30 2025 09:27:02 for v8 by
1.9.8