v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
global-handles-inl.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 V8_HANDLES_GLOBAL_HANDLES_INL_H_
6
#define V8_HANDLES_GLOBAL_HANDLES_INL_H_
7
8
#include "
src/handles/global-handles.h
"
9
// Include the non-inl header before the rest of the headers.
10
11
#include "
src/handles/handles-inl.h
"
12
#include "
src/objects/heap-object-inl.h
"
13
#include "
src/objects/tagged.h
"
14
15
namespace
v8
{
16
namespace
internal
{
17
18
template
<
typename
T>
19
IndirectHandle<T>
GlobalHandles::Create
(
Tagged<T>
value) {
20
static_assert
(
is_subtype_v<T, Object>
,
"static type violation"
);
21
// The compiler should only pick this method if T is not Object.
22
static_assert
(!std::is_same<Object, T>::value,
"compiler error"
);
23
return
Cast<T>
(
Create
(
Tagged<Object>
(value)));
24
}
25
26
template
<
typename
T>
27
Tagged<T>
GlobalHandleVector<T>::Pop
() {
28
Tagged<T>
obj =
Cast<T>
(
Tagged<Object>
(locations_.back()));
29
locations_.pop_back();
30
return
obj;
31
}
32
33
template
<
typename
T>
34
GlobalHandleVector<T>::GlobalHandleVector
(
LocalHeap
* local_heap)
35
:
GlobalHandleVector
(local_heap->AsHeap()) {}
36
37
template
<
typename
T>
38
GlobalHandleVector<T>::GlobalHandleVector
(
Heap
*
heap
)
39
: locations_(
StrongRootAllocator
<
Address
>(
heap
)) {}
40
41
}
// namespace internal
42
}
// namespace v8
43
44
#endif
// V8_HANDLES_GLOBAL_HANDLES_INL_H_
v8::internal::GlobalHandleVector
Definition
pretenuring-handler.h:18
v8::internal::GlobalHandleVector::Pop
Tagged< T > Pop()
Definition
global-handles-inl.h:27
v8::internal::GlobalHandleVector::GlobalHandleVector
GlobalHandleVector(Heap *heap)
Definition
global-handles-inl.h:38
v8::internal::GlobalHandles::Create
IndirectHandle< Object > Create(Tagged< Object > value)
Definition
global-handles.cc:624
v8::internal::Handle
Definition
handles.h:149
v8::internal::Heap
Definition
heap.h:195
v8::internal::LocalHeap
Definition
local-heap.h:50
v8::internal::StrongRootAllocator
Definition
v8-internal.h:1396
v8::internal::Tagged
Definition
waiter-queue-node.h:21
global-handles.h
handles-inl.h
heap-object-inl.h
heap
Definition
platform.h:72
v8::internal::internal
internal
Definition
wasm-objects-inl.h:458
v8::internal::is_subtype_v
static constexpr bool is_subtype_v
Definition
tagged.h:121
v8::internal::Address
Address
Definition
api-callbacks-inl.h:36
v8::internal::Cast
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition
casting.h:150
v8
Definition
api-arguments-inl.h:19
tagged.h
src
handles
global-handles-inl.h
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0