v8
8.4.371 (node 14.15.5)
V8 is Google's open source JavaScript engine
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Functions
a
c
d
f
g
h
i
j
m
n
o
p
r
s
t
u
Variables
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
c
e
g
i
j
k
m
n
p
r
s
t
w
Enumerator
a
b
c
d
e
g
i
j
k
n
o
p
r
s
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
d
e
g
i
m
n
p
r
s
t
u
w
Enumerations
a
b
c
e
f
g
m
n
o
p
s
t
u
w
Enumerator
b
c
d
e
h
j
k
n
o
p
r
s
t
u
Related Functions
a
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Files
File List
Globals
All
c
m
s
u
v
Macros
c
m
s
u
v
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
trace-trait.h
Go to the documentation of this file.
1
// Copyright 2020 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_CPPGC_TRACE_TRAIT_H_
6
#
define
INCLUDE_CPPGC_TRACE_TRAIT_H_
7
8
#
include
<
type_traits
>
9
#
include
"cppgc/type-traits.h"
10
11
namespace
cppgc
{
12
13
class
Visitor
;
14
15
namespace
internal
{
16
17
template
<
typename
T,
18
bool
=
19
IsGarbageCollectedMixinTypeV<
typename
std::remove_const<T>::type>>
20
struct
TraceTraitImpl;
21
22
}
// namespace internal
23
24
using
TraceCallback =
void
(*)(
Visitor
*,
const
void
*);
25
26
// TraceDescriptor is used to describe how to trace an object.
27
struct
TraceDescriptor
{
28
// The adjusted base pointer of the object that should be traced.
29
const
void
*
base_object_payload
;
30
// A callback for tracing the object.
31
TraceCallback
callback
;
32
};
33
34
template
<
typename
T>
35
struct
TraceTrait
{
36
static_assert
(
internal
::IsTraceableV<T>,
"T must have a Trace() method"
);
37
38
static
TraceDescriptor
GetTraceDescriptor
(
const
void
* self) {
39
return
internal
::TraceTraitImpl<T>::GetTraceDescriptor(
40
static_cast
<
const
T*>(self));
41
}
42
43
static
void
Trace
(
Visitor
* visitor,
const
void
* self) {
44
static_cast
<
const
T*>(self)->Trace(visitor);
45
}
46
};
47
48
namespace
internal
{
49
50
template
<
typename
T>
51
struct
TraceTraitImpl<T,
false
> {
52
static
TraceDescriptor
GetTraceDescriptor
(
const
void
* self) {
53
return
{self,
TraceTrait
<T>::Trace};
54
}
55
};
56
57
template
<
typename
T>
58
struct
TraceTraitImpl<T,
true
> {
59
static
TraceDescriptor
GetTraceDescriptor
(
const
void
* self) {
60
return
static_cast
<
const
T*>(self)->GetTraceDescriptor();
61
}
62
};
63
64
}
// namespace internal
65
}
// namespace cppgc
66
67
#
endif
// INCLUDE_CPPGC_TRACE_TRAIT_H_
include
cppgc
trace-trait.h
Generated on Fri Oct 29 2021 20:07:26 for v8 by
1.9.1