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
9// Include the non-inl header before the rest of the headers.
10
13#include "src/objects/tagged.h"
14
15namespace v8 {
16namespace internal {
17
18template <typename T>
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
26template <typename T>
28 Tagged<T> obj = Cast<T>(Tagged<Object>(locations_.back()));
29 locations_.pop_back();
30 return obj;
31}
32
33template <typename T>
36
37template <typename T>
40
41} // namespace internal
42} // namespace v8
43
44#endif // V8_HANDLES_GLOBAL_HANDLES_INL_H_
IndirectHandle< Object > Create(Tagged< Object > value)
static constexpr bool is_subtype_v
Definition tagged.h:121
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition casting.h:150