5#ifndef V8_COMPILER_TURBOSHAFT_ZONE_WITH_NAME_H_
6#define V8_COMPILER_TURBOSHAFT_ZONE_WITH_NAME_H_
29#if defined(DEBUG) && defined(HAS_CPP_CLASS_TYPES_AS_TEMPLATE_ARGS)
30template <
typename T, base::tmp::StringLiteral Name>
31class ZoneWithNamePointerImpl final {
33 using pointer_type = T*;
35 ZoneWithNamePointerImpl() =
default;
36 ZoneWithNamePointerImpl(std::nullptr_t)
38 explicit ZoneWithNamePointerImpl(pointer_type ptr) :
ptr_(ptr) {}
40 ZoneWithNamePointerImpl(
const ZoneWithNamePointerImpl&)
V8_NOEXCEPT =
default;
41 ZoneWithNamePointerImpl(ZoneWithNamePointerImpl&&)
V8_NOEXCEPT = default;
43 ZoneWithNamePointerImpl(const ZoneWithNamePointerImpl<U, Name>& other)
45 requires(
std::is_convertible_v<U*, pointer_type>)
46 :
ptr_(static_cast<U*>(other)) {}
47 ZoneWithNamePointerImpl& operator=(
const ZoneWithNamePointerImpl&)
49 ZoneWithNamePointerImpl& operator=(ZoneWithNamePointerImpl&&)
52 ZoneWithNamePointerImpl& operator=(
53 const ZoneWithNamePointerImpl<U, Name>& other)
V8_NOEXCEPT
54 requires(
std::is_convertible_v<U*, pointer_type>)
56 ptr_ =
static_cast<U*
>(other);
59 operator pointer_type()
const {
return get(); }
60 T& operator*()
const {
return *get(); }
61 pointer_type operator->() {
return get(); }
64 pointer_type get()
const {
return ptr_; }
66 pointer_type
ptr_ = pointer_type{};
69template <
typename T, base::tmp::StringLiteral Name>
72template <
typename T, auto>
76#ifdef HAS_CPP_CLASS_TYPES_AS_TEMPLATE_ARGS
77template <base::tmp::StringLiteral Name>
84 bool support_zone_compression =
false)
85 :
scope_(pool, name, support_zone_compression) {
86#ifdef HAS_CPP_CLASS_TYPES_AS_TEMPLATE_ARGS
93 :
scope_(std::move(other.scope_)) {}
96 scope_ = std::move(other.scope_);
100 template <
typename T,
typename... Args>
106 template <
typename T>
ZoneWithName & operator=(const ZoneWithName &)=delete
ZoneWithNamePointer< T, Name > AllocateArray(size_t length)
ZoneWithNamePointer< T, Name > New(Args &&... args)
ZoneWithName & operator=(ZoneWithName &&other) V8_NOEXCEPT
ZoneWithName(const ZoneWithName &)=delete
ZoneWithName(ZoneWithName &&other) V8_NOEXCEPT
ZoneWithName(ZoneStats *pool, const char *name, bool support_zone_compression=false)
base::Vector< const DirectHandle< Object > > args
#define DCHECK_EQ(v1, v2)