/src/serenity/AK/IntrusiveList.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/Assertions.h> |
10 | | #include <AK/BitCast.h> |
11 | | #include <AK/Forward.h> |
12 | | #include <AK/IntrusiveDetails.h> |
13 | | #include <AK/Noncopyable.h> |
14 | | #include <AK/StdLibExtras.h> |
15 | | |
16 | | #ifdef KERNEL |
17 | | # include <Kernel/Library/LockRefPtr.h> |
18 | | #endif |
19 | | |
20 | | namespace AK::Detail { |
21 | | |
22 | | template<typename T, typename Container = RawPtr<T>> |
23 | | class IntrusiveListNode; |
24 | | |
25 | | struct ExtractIntrusiveListTypes { |
26 | | template<typename V, typename Container, typename T> |
27 | | static V value(IntrusiveListNode<V, Container> T::*x); |
28 | | template<typename V, typename Container, typename T> |
29 | | static Container container(IntrusiveListNode<V, Container> T::*x); |
30 | | }; |
31 | | |
32 | | template<typename T, typename Container = RawPtr<T>> |
33 | | using SubstitutedIntrusiveListNode = IntrusiveListNode<T, typename Detail::SubstituteIntrusiveContainerType<T, Container>::Type>; |
34 | | |
35 | | template<typename T, typename Container> |
36 | | class IntrusiveListStorage { |
37 | | private: |
38 | | friend class IntrusiveListNode<T, Container>; |
39 | | |
40 | | template<class T_, typename Container_, SubstitutedIntrusiveListNode<T_, Container_> T_::*member> |
41 | | friend class IntrusiveList; |
42 | | |
43 | | SubstitutedIntrusiveListNode<T, Container>* m_first { nullptr }; |
44 | | SubstitutedIntrusiveListNode<T, Container>* m_last { nullptr }; |
45 | | }; |
46 | | |
47 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
48 | | class IntrusiveList { |
49 | | AK_MAKE_NONCOPYABLE(IntrusiveList); |
50 | | AK_MAKE_NONMOVABLE(IntrusiveList); |
51 | | |
52 | | public: |
53 | 4.67k | IntrusiveList() = default; Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::IntrusiveList() AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::IntrusiveList() Line | Count | Source | 53 | 3.12k | IntrusiveList() = default; |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::IntrusiveList() Line | Count | Source | 53 | 62 | IntrusiveList() = default; |
AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::IntrusiveList() Line | Count | Source | 53 | 62 | IntrusiveList() = default; |
AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::IntrusiveList() Line | Count | Source | 53 | 62 | IntrusiveList() = default; |
AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::IntrusiveList() Line | Count | Source | 53 | 62 | IntrusiveList() = default; |
AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::IntrusiveList() Line | Count | Source | 53 | 62 | IntrusiveList() = default; |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::IntrusiveList() Line | Count | Source | 53 | 457 | IntrusiveList() = default; |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::IntrusiveList() AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::IntrusiveList() Line | Count | Source | 53 | 783 | IntrusiveList() = default; |
|
54 | | ~IntrusiveList(); |
55 | | |
56 | | void clear(); |
57 | | [[nodiscard]] bool is_empty() const; |
58 | | [[nodiscard]] size_t size_slow() const; |
59 | | void append(T& n); |
60 | | void prepend(T& n); |
61 | | void insert_before(T&, T&); |
62 | | void remove(T& n); |
63 | | [[nodiscard]] bool contains(T const&) const; |
64 | | [[nodiscard]] Container first() const; |
65 | | [[nodiscard]] Container last() const; |
66 | | |
67 | | [[nodiscard]] Container take_first(); |
68 | | [[nodiscard]] Container take_last(); |
69 | | |
70 | | class Iterator { |
71 | | public: |
72 | 19.4k | Iterator() = default; AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::Iterator::Iterator() Line | Count | Source | 72 | 19.1k | Iterator() = default; |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::Iterator::Iterator() Line | Count | Source | 72 | 124 | Iterator() = default; |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::Iterator::Iterator() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::Iterator::Iterator() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::Iterator::Iterator() AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::Iterator::Iterator() Line | Count | Source | 72 | 124 | Iterator() = default; |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::Iterator::Iterator() |
73 | | Iterator(T* value) |
74 | 7.18k | : m_value(move(value)) |
75 | 7.18k | { |
76 | 7.18k | } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::Iterator::Iterator(JS::HeapBlock*) Line | Count | Source | 74 | 7.06k | : m_value(move(value)) | 75 | 7.06k | { | 76 | 7.06k | } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::Iterator::Iterator(JS::CellAllocator*) Line | Count | Source | 74 | 124 | : m_value(move(value)) | 75 | 124 | { | 76 | 124 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::Iterator::Iterator(JS::HandleImpl*) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::Iterator::Iterator(JS::MarkedVectorBase*) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::Iterator::Iterator(JS::ConservativeVectorBase*) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::Iterator::Iterator(JS::WeakContainer*) Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::Iterator::Iterator(Shell::Shell::Promise*) |
77 | | |
78 | | T const& operator*() const { return *m_value; } |
79 | | auto operator->() const { return m_value; } |
80 | 17.4k | T& operator*() { return *m_value; } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::Iterator::operator*() Line | Count | Source | 80 | 10.8k | T& operator*() { return *m_value; } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::Iterator::operator*() Line | Count | Source | 80 | 6.56k | T& operator*() { return *m_value; } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::Iterator::operator*() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::Iterator::operator*() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::Iterator::operator*() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::Iterator::operator*() Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::Iterator::operator*() |
81 | | auto operator->() { return m_value; } |
82 | 30.7k | bool operator==(Iterator const& other) const { return other.m_value == m_value; } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::Iterator::operator==(AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::Iterator const&) const Line | Count | Source | 82 | 23.9k | bool operator==(Iterator const& other) const { return other.m_value == m_value; } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::Iterator::operator==(AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::Iterator const&) const Line | Count | Source | 82 | 6.68k | bool operator==(Iterator const& other) const { return other.m_value == m_value; } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::Iterator::operator==(AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::Iterator const&) const Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::Iterator::operator==(AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::Iterator const&) const Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::Iterator::operator==(AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::Iterator const&) const AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::Iterator::operator==(AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::Iterator const&) const Line | Count | Source | 82 | 62 | bool operator==(Iterator const& other) const { return other.m_value == m_value; } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::Iterator::operator==(AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::Iterator const&) const |
83 | | Iterator& operator++() |
84 | 17.4k | { |
85 | 17.4k | m_value = IntrusiveList<T, Container, member>::next(m_value); |
86 | 17.4k | return *this; |
87 | 17.4k | } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::Iterator::operator++() Line | Count | Source | 84 | 10.8k | { | 85 | 10.8k | m_value = IntrusiveList<T, Container, member>::next(m_value); | 86 | 10.8k | return *this; | 87 | 10.8k | } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::Iterator::operator++() Line | Count | Source | 84 | 6.56k | { | 85 | 6.56k | m_value = IntrusiveList<T, Container, member>::next(m_value); | 86 | 6.56k | return *this; | 87 | 6.56k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::Iterator::operator++() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::Iterator::operator++() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::Iterator::operator++() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::Iterator::operator++() Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::Iterator::operator++() |
88 | | Iterator& erase(); |
89 | | |
90 | | private: |
91 | | T* m_value { nullptr }; |
92 | | }; |
93 | | |
94 | | Iterator begin(); |
95 | 13.3k | Iterator end() { return Iterator {}; } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::end() Line | Count | Source | 95 | 13.1k | Iterator end() { return Iterator {}; } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::end() Line | Count | Source | 95 | 124 | Iterator end() { return Iterator {}; } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::end() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::end() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::end() AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::end() Line | Count | Source | 95 | 62 | Iterator end() { return Iterator {}; } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::end() |
96 | | |
97 | | class ReverseIterator { |
98 | | public: |
99 | | ReverseIterator() = default; |
100 | | ReverseIterator(T* value) |
101 | | : m_value(move(value)) |
102 | | { |
103 | | } |
104 | | |
105 | | T const& operator*() const { return *m_value; } |
106 | | auto operator->() const { return m_value; } |
107 | | T& operator*() { return *m_value; } |
108 | | auto operator->() { return m_value; } |
109 | | bool operator==(ReverseIterator const& other) const { return other.m_value == m_value; } |
110 | | ReverseIterator& operator++() |
111 | | { |
112 | | m_value = IntrusiveList<T, Container, member>::prev(m_value); |
113 | | return *this; |
114 | | } |
115 | | |
116 | | private: |
117 | | T* m_value { nullptr }; |
118 | | }; |
119 | | |
120 | | ReverseIterator rbegin(); |
121 | | ReverseIterator rend() { return ReverseIterator {}; } |
122 | | |
123 | | class ConstIterator { |
124 | | public: |
125 | | ConstIterator() = default; |
126 | | ConstIterator(T const* value) |
127 | | : m_value(value) |
128 | | { |
129 | | } |
130 | | |
131 | | T const& operator*() const { return *m_value; } |
132 | | auto operator->() const { return m_value; } |
133 | | bool operator==(ConstIterator const& other) const { return other.m_value == m_value; } |
134 | | ConstIterator& operator++() |
135 | | { |
136 | | m_value = IntrusiveList<T, Container, member>::next(m_value); |
137 | | return *this; |
138 | | } |
139 | | |
140 | | private: |
141 | | T const* m_value { nullptr }; |
142 | | }; |
143 | | |
144 | | ConstIterator begin() const; |
145 | | ConstIterator end() const { return ConstIterator {}; } |
146 | | |
147 | | private: |
148 | | static T* next(T* current); |
149 | | static T* prev(T* current); |
150 | | static T const* next(T const* current); |
151 | | static T const* prev(T const* current); |
152 | | static T* node_to_value(SubstitutedIntrusiveListNode<T, Container>& node); |
153 | | IntrusiveListStorage<T, Container> m_storage; |
154 | | }; |
155 | | |
156 | | template<typename T, typename Container> |
157 | | class IntrusiveListNode { |
158 | | public: |
159 | | ~IntrusiveListNode(); |
160 | | void remove(); |
161 | | bool is_in_list() const; |
162 | | |
163 | | static constexpr bool IsRaw = IsPointer<Container>; |
164 | | |
165 | | // Note: For some reason, clang does not consider `member` as declared here, and as declared above (`SubstitutedIntrusiveListNode<T, Container> T::*`) |
166 | | // to be of equal types. so for now, just make the members public on clang. |
167 | | #if !defined(AK_COMPILER_CLANG) |
168 | | private: |
169 | | template<class T_, typename Container_, SubstitutedIntrusiveListNode<T_, Container_> T_::*member> |
170 | | friend class ::AK::Detail::IntrusiveList; |
171 | | #endif |
172 | | |
173 | | IntrusiveListStorage<T, Container>* m_storage = nullptr; |
174 | | SubstitutedIntrusiveListNode<T, Container>* m_next = nullptr; |
175 | | SubstitutedIntrusiveListNode<T, Container>* m_prev = nullptr; |
176 | | [[no_unique_address]] SelfReferenceIfNeeded<Container, IsRaw> m_self; |
177 | | }; |
178 | | |
179 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
180 | | inline typename IntrusiveList<T, Container, member>::Iterator& IntrusiveList<T, Container, member>::Iterator::erase() |
181 | | { |
182 | | auto old = m_value; |
183 | | m_value = IntrusiveList<T, Container, member>::next(m_value); |
184 | | (old->*member).remove(); |
185 | | return *this; |
186 | | } |
187 | | |
188 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
189 | | inline IntrusiveList<T, Container, member>::~IntrusiveList() |
190 | 2.41k | { |
191 | 2.41k | clear(); |
192 | 2.41k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::~IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::~IntrusiveList() AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::~IntrusiveList() Line | Count | Source | 190 | 62 | { | 191 | 62 | clear(); | 192 | 62 | } |
AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::~IntrusiveList() Line | Count | Source | 190 | 62 | { | 191 | 62 | clear(); | 192 | 62 | } |
AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::~IntrusiveList() Line | Count | Source | 190 | 62 | { | 191 | 62 | clear(); | 192 | 62 | } |
AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::~IntrusiveList() Line | Count | Source | 190 | 62 | { | 191 | 62 | clear(); | 192 | 62 | } |
AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::~IntrusiveList() Line | Count | Source | 190 | 62 | { | 191 | 62 | clear(); | 192 | 62 | } |
AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::~IntrusiveList() Line | Count | Source | 190 | 868 | { | 191 | 868 | clear(); | 192 | 868 | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::~IntrusiveList() Line | Count | Source | 190 | 457 | { | 191 | 457 | clear(); | 192 | 457 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::~IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::~IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::~IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::~IntrusiveList() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::~IntrusiveList() AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::~IntrusiveList() Line | Count | Source | 190 | 783 | { | 191 | 783 | clear(); | 192 | 783 | } |
|
193 | | |
194 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
195 | | inline void IntrusiveList<T, Container, member>::clear() |
196 | 2.41k | { |
197 | 5.69k | while (m_storage.m_first) |
198 | 3.28k | m_storage.m_first->remove(); |
199 | 2.41k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::clear() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::clear() AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::clear() Line | Count | Source | 196 | 868 | { | 197 | 868 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 868 | } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::clear() Line | Count | Source | 196 | 62 | { | 197 | 3.34k | while (m_storage.m_first) | 198 | 3.28k | m_storage.m_first->remove(); | 199 | 62 | } |
AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::clear() Line | Count | Source | 196 | 62 | { | 197 | 62 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 62 | } |
AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::clear() Line | Count | Source | 196 | 62 | { | 197 | 62 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 62 | } |
AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::clear() Line | Count | Source | 196 | 62 | { | 197 | 62 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 62 | } |
AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::clear() Line | Count | Source | 196 | 62 | { | 197 | 62 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 62 | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::clear() Line | Count | Source | 196 | 457 | { | 197 | 457 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 457 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::clear() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::clear() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::clear() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::clear() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::clear() AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::clear() Line | Count | Source | 196 | 783 | { | 197 | 783 | while (m_storage.m_first) | 198 | 0 | m_storage.m_first->remove(); | 199 | 783 | } |
|
200 | | |
201 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
202 | | inline bool IntrusiveList<T, Container, member>::is_empty() const |
203 | 308k | { |
204 | 308k | return m_storage.m_first == nullptr; |
205 | 308k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::is_empty() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::is_empty() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::is_empty() const AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::is_empty() const Line | Count | Source | 203 | 85.8k | { | 204 | 85.8k | return m_storage.m_first == nullptr; | 205 | 85.8k | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::is_empty() const Line | Count | Source | 203 | 220k | { | 204 | 220k | return m_storage.m_first == nullptr; | 205 | 220k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::is_empty() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::is_empty() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::is_empty() const AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::is_empty() const Line | Count | Source | 203 | 1.39k | { | 204 | 1.39k | return m_storage.m_first == nullptr; | 205 | 1.39k | } |
|
206 | | |
207 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
208 | | inline size_t IntrusiveList<T, Container, member>::size_slow() const |
209 | | { |
210 | | size_t size = 0; |
211 | | auto it_end = end(); |
212 | | for (auto it = begin(); it != it_end; ++it) { |
213 | | ++size; |
214 | | } |
215 | | return size; |
216 | | } |
217 | | |
218 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
219 | | inline void IntrusiveList<T, Container, member>::append(T& n) |
220 | 14.4k | { |
221 | 14.4k | remove(n); |
222 | | |
223 | 14.4k | auto& nnode = n.*member; |
224 | 14.4k | nnode.m_storage = &m_storage; |
225 | 14.4k | nnode.m_prev = m_storage.m_last; |
226 | 14.4k | nnode.m_next = nullptr; |
227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) |
228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. |
229 | | |
230 | 14.4k | if (m_storage.m_last) |
231 | 6.09k | m_storage.m_last->m_next = &nnode; |
232 | 14.4k | m_storage.m_last = &nnode; |
233 | 14.4k | if (!m_storage.m_first) |
234 | 8.31k | m_storage.m_first = &nnode; |
235 | 14.4k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::append(AK::Queue<Gfx::Point<int>, 1000>::QueueSegment&) AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::append(JS::HandleImpl&) Line | Count | Source | 220 | 1.42k | { | 221 | 1.42k | remove(n); | 222 | | | 223 | 1.42k | auto& nnode = n.*member; | 224 | 1.42k | nnode.m_storage = &m_storage; | 225 | 1.42k | nnode.m_prev = m_storage.m_last; | 226 | 1.42k | nnode.m_next = nullptr; | 227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) | 228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. | 229 | | | 230 | 1.42k | if (m_storage.m_last) | 231 | 0 | m_storage.m_last->m_next = &nnode; | 232 | 1.42k | m_storage.m_last = &nnode; | 233 | 1.42k | if (!m_storage.m_first) | 234 | 1.42k | m_storage.m_first = &nnode; | 235 | 1.42k | } |
AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::append(JS::MarkedVectorBase&) Line | Count | Source | 220 | 16 | { | 221 | 16 | remove(n); | 222 | | | 223 | 16 | auto& nnode = n.*member; | 224 | 16 | nnode.m_storage = &m_storage; | 225 | 16 | nnode.m_prev = m_storage.m_last; | 226 | 16 | nnode.m_next = nullptr; | 227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) | 228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. | 229 | | | 230 | 16 | if (m_storage.m_last) | 231 | 0 | m_storage.m_last->m_next = &nnode; | 232 | 16 | m_storage.m_last = &nnode; | 233 | 16 | if (!m_storage.m_first) | 234 | 16 | m_storage.m_first = &nnode; | 235 | 16 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::append(JS::ConservativeVectorBase&) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::append(JS::WeakContainer&) AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::append(JS::CellAllocator&) Line | Count | Source | 220 | 3.28k | { | 221 | 3.28k | remove(n); | 222 | | | 223 | 3.28k | auto& nnode = n.*member; | 224 | 3.28k | nnode.m_storage = &m_storage; | 225 | 3.28k | nnode.m_prev = m_storage.m_last; | 226 | 3.28k | nnode.m_next = nullptr; | 227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) | 228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. | 229 | | | 230 | 3.28k | if (m_storage.m_last) | 231 | 3.21k | m_storage.m_last->m_next = &nnode; | 232 | 3.28k | m_storage.m_last = &nnode; | 233 | 3.28k | if (!m_storage.m_first) | 234 | 62 | m_storage.m_first = &nnode; | 235 | 3.28k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::append(AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment&) AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::append(JS::HeapBlock&) Line | Count | Source | 220 | 7.66k | { | 221 | 7.66k | remove(n); | 222 | | | 223 | 7.66k | auto& nnode = n.*member; | 224 | 7.66k | nnode.m_storage = &m_storage; | 225 | 7.66k | nnode.m_prev = m_storage.m_last; | 226 | 7.66k | nnode.m_next = nullptr; | 227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) | 228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. | 229 | | | 230 | 7.66k | if (m_storage.m_last) | 231 | 1.90k | m_storage.m_last->m_next = &nnode; | 232 | 7.66k | m_storage.m_last = &nnode; | 233 | 7.66k | if (!m_storage.m_first) | 234 | 5.75k | m_storage.m_first = &nnode; | 235 | 7.66k | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::append(AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment&) Line | Count | Source | 220 | 626 | { | 221 | 626 | remove(n); | 222 | | | 223 | 626 | auto& nnode = n.*member; | 224 | 626 | nnode.m_storage = &m_storage; | 225 | 626 | nnode.m_prev = m_storage.m_last; | 226 | 626 | nnode.m_next = nullptr; | 227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) | 228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. | 229 | | | 230 | 626 | if (m_storage.m_last) | 231 | 169 | m_storage.m_last->m_next = &nnode; | 232 | 626 | m_storage.m_last = &nnode; | 233 | 626 | if (!m_storage.m_first) | 234 | 457 | m_storage.m_first = &nnode; | 235 | 626 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::append(Shell::Shell::Promise&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::append(AK::Queue<IPC::File, 1000>::QueueSegment&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::append(AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::append(AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::append(AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment&) AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::append(AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment&) Line | Count | Source | 220 | 1.39k | { | 221 | 1.39k | remove(n); | 222 | | | 223 | 1.39k | auto& nnode = n.*member; | 224 | 1.39k | nnode.m_storage = &m_storage; | 225 | 1.39k | nnode.m_prev = m_storage.m_last; | 226 | 1.39k | nnode.m_next = nullptr; | 227 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) | 228 | | nnode.m_self.reference = &n; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. | 229 | | | 230 | 1.39k | if (m_storage.m_last) | 231 | 798 | m_storage.m_last->m_next = &nnode; | 232 | 1.39k | m_storage.m_last = &nnode; | 233 | 1.39k | if (!m_storage.m_first) | 234 | 596 | m_storage.m_first = &nnode; | 235 | 1.39k | } |
|
236 | | |
237 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
238 | | inline void IntrusiveList<T, Container, member>::prepend(T& n) |
239 | | { |
240 | | remove(n); |
241 | | |
242 | | auto& nnode = n.*member; |
243 | | nnode.m_storage = &m_storage; |
244 | | nnode.m_prev = nullptr; |
245 | | nnode.m_next = m_storage.m_first; |
246 | | if constexpr (!RemoveReference<decltype(nnode)>::IsRaw) |
247 | | nnode.m_self.reference = &n; |
248 | | |
249 | | if (m_storage.m_first) |
250 | | m_storage.m_first->m_prev = &nnode; |
251 | | m_storage.m_first = &nnode; |
252 | | if (!m_storage.m_last) |
253 | | m_storage.m_last = &nnode; |
254 | | } |
255 | | |
256 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
257 | | inline void IntrusiveList<T, Container, member>::insert_before(T& bn, T& n) |
258 | | { |
259 | | remove(n); |
260 | | |
261 | | auto& new_node = n.*member; |
262 | | auto& before_node = bn.*member; |
263 | | new_node.m_storage = &m_storage; |
264 | | new_node.m_next = &before_node; |
265 | | new_node.m_prev = before_node.m_prev; |
266 | | if (before_node.m_prev) |
267 | | before_node.m_prev->m_next = &new_node; |
268 | | before_node.m_prev = &new_node; |
269 | | |
270 | | if (m_storage.m_first == &before_node) { |
271 | | m_storage.m_first = &new_node; |
272 | | } |
273 | | |
274 | | if constexpr (!RemoveReference<decltype(new_node)>::IsRaw) |
275 | | new_node.m_self.reference = &n; |
276 | | } |
277 | | |
278 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
279 | | inline void IntrusiveList<T, Container, member>::remove(T& n) |
280 | 17.8k | { |
281 | 17.8k | auto& nnode = n.*member; |
282 | 17.8k | if (nnode.m_storage) |
283 | 5.68k | nnode.remove(); |
284 | 17.8k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::remove(AK::Queue<Gfx::Point<int>, 1000>::QueueSegment&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::remove(AK::Queue<IPC::File, 1000>::QueueSegment&) AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::remove(JS::HandleImpl&) Line | Count | Source | 280 | 2.85k | { | 281 | 2.85k | auto& nnode = n.*member; | 282 | 2.85k | if (nnode.m_storage) | 283 | 1.42k | nnode.remove(); | 284 | 2.85k | } |
AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::remove(JS::MarkedVectorBase&) Line | Count | Source | 280 | 32 | { | 281 | 32 | auto& nnode = n.*member; | 282 | 32 | if (nnode.m_storage) | 283 | 16 | nnode.remove(); | 284 | 32 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::remove(JS::ConservativeVectorBase&) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::remove(JS::WeakContainer&) AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::remove(JS::CellAllocator&) Line | Count | Source | 280 | 3.28k | { | 281 | 3.28k | auto& nnode = n.*member; | 282 | 3.28k | if (nnode.m_storage) | 283 | 0 | nnode.remove(); | 284 | 3.28k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::remove(AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment&) AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::remove(JS::HeapBlock&) Line | Count | Source | 280 | 7.66k | { | 281 | 7.66k | auto& nnode = n.*member; | 282 | 7.66k | if (nnode.m_storage) | 283 | 2.22k | nnode.remove(); | 284 | 7.66k | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::remove(AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment&) Line | Count | Source | 280 | 1.25k | { | 281 | 1.25k | auto& nnode = n.*member; | 282 | 1.25k | if (nnode.m_storage) | 283 | 626 | nnode.remove(); | 284 | 1.25k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::remove(Shell::Shell::Promise&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::remove(AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::remove(AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::remove(AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment&) AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::remove(AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment&) Line | Count | Source | 280 | 2.78k | { | 281 | 2.78k | auto& nnode = n.*member; | 282 | 2.78k | if (nnode.m_storage) | 283 | 1.39k | nnode.remove(); | 284 | 2.78k | } |
|
285 | | |
286 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
287 | | inline bool IntrusiveList<T, Container, member>::contains(T const& n) const |
288 | 2.88k | { |
289 | 2.88k | auto& nnode = n.*member; |
290 | 2.88k | return nnode.m_storage == &m_storage; |
291 | 2.88k | } AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::contains(JS::HandleImpl const&) const Line | Count | Source | 288 | 2.85k | { | 289 | 2.85k | auto& nnode = n.*member; | 290 | 2.85k | return nnode.m_storage == &m_storage; | 291 | 2.85k | } |
AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::contains(JS::MarkedVectorBase const&) const Line | Count | Source | 288 | 32 | { | 289 | 32 | auto& nnode = n.*member; | 290 | 32 | return nnode.m_storage == &m_storage; | 291 | 32 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::contains(JS::ConservativeVectorBase const&) const Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::contains(JS::WeakContainer const&) const |
292 | | |
293 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
294 | | inline Container IntrusiveList<T, Container, member>::first() const |
295 | 210k | { |
296 | 210k | return m_storage.m_first ? node_to_value(*m_storage.m_first) : nullptr; |
297 | 210k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::first() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::first() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::first() const RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::first() const Line | Count | Source | 295 | 208k | { | 296 | 208k | return m_storage.m_first ? node_to_value(*m_storage.m_first) : nullptr; | 297 | 208k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::first() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::first() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::first() const AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::first() const Line | Count | Source | 295 | 2.17k | { | 296 | 2.17k | return m_storage.m_first ? node_to_value(*m_storage.m_first) : nullptr; | 297 | 2.17k | } |
|
298 | | |
299 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
300 | | inline Container IntrusiveList<T, Container, member>::take_first() |
301 | 3.26k | { |
302 | 3.26k | if (Container ptr = first()) { |
303 | 2.02k | remove(*ptr); |
304 | 2.02k | return ptr; |
305 | 2.02k | } |
306 | 1.24k | return nullptr; |
307 | 3.26k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::take_first() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::take_first() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::take_first() RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::take_first() Line | Count | Source | 301 | 1.08k | { | 302 | 1.08k | if (Container ptr = first()) { | 303 | 626 | remove(*ptr); | 304 | 626 | return ptr; | 305 | 626 | } | 306 | 457 | return nullptr; | 307 | 1.08k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::take_first() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::take_first() Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::take_first() AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::take_first() Line | Count | Source | 301 | 2.17k | { | 302 | 2.17k | if (Container ptr = first()) { | 303 | 1.39k | remove(*ptr); | 304 | 1.39k | return ptr; | 305 | 1.39k | } | 306 | 783 | return nullptr; | 307 | 2.17k | } |
|
308 | | |
309 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
310 | | inline Container IntrusiveList<T, Container, member>::take_last() |
311 | | { |
312 | | if (Container ptr = last()) { |
313 | | remove(*ptr); |
314 | | return ptr; |
315 | | } |
316 | | return nullptr; |
317 | | } |
318 | | |
319 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
320 | | inline Container IntrusiveList<T, Container, member>::last() const |
321 | 518k | { |
322 | 518k | return m_storage.m_last ? node_to_value(*m_storage.m_last) : nullptr; |
323 | 518k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::last() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::last() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::last() const AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::last() const Line | Count | Source | 321 | 88.0k | { | 322 | 88.0k | return m_storage.m_last ? node_to_value(*m_storage.m_last) : nullptr; | 323 | 88.0k | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::last() const Line | Count | Source | 321 | 427k | { | 322 | 427k | return m_storage.m_last ? node_to_value(*m_storage.m_last) : nullptr; | 323 | 427k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::last() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::last() const Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::last() const AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::last() const Line | Count | Source | 321 | 2.19k | { | 322 | 2.19k | return m_storage.m_last ? node_to_value(*m_storage.m_last) : nullptr; | 323 | 2.19k | } |
|
324 | | |
325 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
326 | | inline T const* IntrusiveList<T, Container, member>::next(T const* current) |
327 | | { |
328 | | auto& nextnode = (current->*member).m_next; |
329 | | T const* nextstruct = nextnode ? node_to_value(*nextnode) : nullptr; |
330 | | return nextstruct; |
331 | | } |
332 | | |
333 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
334 | | inline T const* IntrusiveList<T, Container, member>::prev(T const* current) |
335 | | { |
336 | | auto& prevnode = (current->*member).m_prev; |
337 | | T const* prevstruct = prevnode ? node_to_value(*prevnode) : nullptr; |
338 | | return prevstruct; |
339 | | } |
340 | | |
341 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
342 | | inline T* IntrusiveList<T, Container, member>::next(T* current) |
343 | 17.4k | { |
344 | 17.4k | auto& nextnode = (current->*member).m_next; |
345 | 17.4k | T* nextstruct = nextnode ? node_to_value(*nextnode) : nullptr; |
346 | 17.4k | return nextstruct; |
347 | 17.4k | } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::next(JS::HeapBlock*) Line | Count | Source | 343 | 10.8k | { | 344 | 10.8k | auto& nextnode = (current->*member).m_next; | 345 | 10.8k | T* nextstruct = nextnode ? node_to_value(*nextnode) : nullptr; | 346 | 10.8k | return nextstruct; | 347 | 10.8k | } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::next(JS::CellAllocator*) Line | Count | Source | 343 | 6.56k | { | 344 | 6.56k | auto& nextnode = (current->*member).m_next; | 345 | 6.56k | T* nextstruct = nextnode ? node_to_value(*nextnode) : nullptr; | 346 | 6.56k | return nextstruct; | 347 | 6.56k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::next(JS::HandleImpl*) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::next(JS::MarkedVectorBase*) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::next(JS::ConservativeVectorBase*) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::next(JS::WeakContainer*) Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::next(Shell::Shell::Promise*) |
348 | | |
349 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
350 | | inline T* IntrusiveList<T, Container, member>::prev(T* current) |
351 | | { |
352 | | auto& prevnode = (current->*member).m_prev; |
353 | | T* prevstruct = prevnode ? node_to_value(*prevnode) : nullptr; |
354 | | return prevstruct; |
355 | | } |
356 | | |
357 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
358 | | inline typename IntrusiveList<T, Container, member>::Iterator IntrusiveList<T, Container, member>::begin() |
359 | 13.3k | { |
360 | 13.3k | return m_storage.m_first ? Iterator(node_to_value(*m_storage.m_first)) : Iterator(); |
361 | 13.3k | } AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::begin() Line | Count | Source | 359 | 13.1k | { | 360 | 13.1k | return m_storage.m_first ? Iterator(node_to_value(*m_storage.m_first)) : Iterator(); | 361 | 13.1k | } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::begin() Line | Count | Source | 359 | 124 | { | 360 | 124 | return m_storage.m_first ? Iterator(node_to_value(*m_storage.m_first)) : Iterator(); | 361 | 124 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::begin() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::begin() Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::begin() AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::begin() Line | Count | Source | 359 | 62 | { | 360 | 62 | return m_storage.m_first ? Iterator(node_to_value(*m_storage.m_first)) : Iterator(); | 361 | 62 | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::begin() |
362 | | |
363 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
364 | | inline typename IntrusiveList<T, Container, member>::ReverseIterator IntrusiveList<T, Container, member>::rbegin() |
365 | | { |
366 | | return m_storage.m_last ? ReverseIterator(node_to_value(*m_storage.m_last)) : ReverseIterator(); |
367 | | } |
368 | | |
369 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
370 | | inline typename IntrusiveList<T, Container, member>::ConstIterator IntrusiveList<T, Container, member>::begin() const |
371 | | { |
372 | | return m_storage.m_first ? ConstIterator(node_to_value(*m_storage.m_first)) : ConstIterator(); |
373 | | } |
374 | | |
375 | | template<class T, typename Container, SubstitutedIntrusiveListNode<T, Container> T::*member> |
376 | | inline T* IntrusiveList<T, Container, member>::node_to_value(SubstitutedIntrusiveListNode<T, Container>& node) |
377 | 745k | { |
378 | | // Note: A data member pointer is a 32-bit offset in the Windows ABI (both x86 and x86_64), |
379 | | // whereas it is an appropriately sized ptrdiff_t in the Itanium ABI, the following ensures |
380 | | // that we always use the correct type for the subtraction. |
381 | 745k | using EquivalentNumericTypeForDataMemberPointer = Conditional<sizeof(member) == sizeof(ptrdiff_t), ptrdiff_t, u32>; |
382 | 745k | static_assert(sizeof(EquivalentNumericTypeForDataMemberPointer) == sizeof(member), |
383 | 745k | "The equivalent numeric type for the data member pointer must have the same size as the data member pointer itself."); |
384 | | |
385 | | // Note: Since this might seem odd, here's an explanation on what this function actually does: |
386 | | // `node` is a reference that resides in some part of the actual value (of type T), the |
387 | | // placement (i.e. offset) of which is described by the pointer-to-data-member parameter |
388 | | // named `member`. |
389 | | // This function effectively takes in the address of the data member, and returns the address |
390 | | // of the value (of type T) holding that member. |
391 | 745k | return bit_cast<T*>(bit_cast<unsigned char*>(&node) - bit_cast<EquivalentNumericTypeForDataMemberPointer>(member)); |
392 | 745k | } Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*, &AK::Queue<Gfx::Point<int>, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*, &AK::Queue<IPC::File, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*, &AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*>&) AK::Detail::IntrusiveList<JS::HeapBlock, JS::HeapBlock*, &JS::HeapBlock::m_list_node>::node_to_value(AK::Detail::IntrusiveListNode<JS::HeapBlock, JS::HeapBlock*>&) Line | Count | Source | 377 | 98.9k | { | 378 | | // Note: A data member pointer is a 32-bit offset in the Windows ABI (both x86 and x86_64), | 379 | | // whereas it is an appropriately sized ptrdiff_t in the Itanium ABI, the following ensures | 380 | | // that we always use the correct type for the subtraction. | 381 | 98.9k | using EquivalentNumericTypeForDataMemberPointer = Conditional<sizeof(member) == sizeof(ptrdiff_t), ptrdiff_t, u32>; | 382 | 98.9k | static_assert(sizeof(EquivalentNumericTypeForDataMemberPointer) == sizeof(member), | 383 | 98.9k | "The equivalent numeric type for the data member pointer must have the same size as the data member pointer itself."); | 384 | | | 385 | | // Note: Since this might seem odd, here's an explanation on what this function actually does: | 386 | | // `node` is a reference that resides in some part of the actual value (of type T), the | 387 | | // placement (i.e. offset) of which is described by the pointer-to-data-member parameter | 388 | | // named `member`. | 389 | | // This function effectively takes in the address of the data member, and returns the address | 390 | | // of the value (of type T) holding that member. | 391 | 98.9k | return bit_cast<T*>(bit_cast<unsigned char*>(&node) - bit_cast<EquivalentNumericTypeForDataMemberPointer>(member)); | 392 | 98.9k | } |
AK::Detail::IntrusiveList<JS::CellAllocator, JS::CellAllocator*, &JS::CellAllocator::m_list_node>::node_to_value(AK::Detail::IntrusiveListNode<JS::CellAllocator, JS::CellAllocator*>&) Line | Count | Source | 377 | 6.56k | { | 378 | | // Note: A data member pointer is a 32-bit offset in the Windows ABI (both x86 and x86_64), | 379 | | // whereas it is an appropriately sized ptrdiff_t in the Itanium ABI, the following ensures | 380 | | // that we always use the correct type for the subtraction. | 381 | 6.56k | using EquivalentNumericTypeForDataMemberPointer = Conditional<sizeof(member) == sizeof(ptrdiff_t), ptrdiff_t, u32>; | 382 | 6.56k | static_assert(sizeof(EquivalentNumericTypeForDataMemberPointer) == sizeof(member), | 383 | 6.56k | "The equivalent numeric type for the data member pointer must have the same size as the data member pointer itself."); | 384 | | | 385 | | // Note: Since this might seem odd, here's an explanation on what this function actually does: | 386 | | // `node` is a reference that resides in some part of the actual value (of type T), the | 387 | | // placement (i.e. offset) of which is described by the pointer-to-data-member parameter | 388 | | // named `member`. | 389 | | // This function effectively takes in the address of the data member, and returns the address | 390 | | // of the value (of type T) holding that member. | 391 | 6.56k | return bit_cast<T*>(bit_cast<unsigned char*>(&node) - bit_cast<EquivalentNumericTypeForDataMemberPointer>(member)); | 392 | 6.56k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<JS::HandleImpl, JS::HandleImpl*, &JS::HandleImpl::m_list_node>::node_to_value(AK::Detail::IntrusiveListNode<JS::HandleImpl, JS::HandleImpl*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::MarkedVectorBase, JS::MarkedVectorBase*, &JS::MarkedVectorBase::m_list_node>::node_to_value(AK::Detail::IntrusiveListNode<JS::MarkedVectorBase, JS::MarkedVectorBase*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::ConservativeVectorBase, JS::ConservativeVectorBase*, &JS::ConservativeVectorBase::m_list_node>::node_to_value(AK::Detail::IntrusiveListNode<JS::ConservativeVectorBase, JS::ConservativeVectorBase*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<JS::WeakContainer, JS::WeakContainer*, &JS::WeakContainer::m_list_node>::node_to_value(AK::Detail::IntrusiveListNode<JS::WeakContainer, JS::WeakContainer*>&) RegexOptimizer.cpp:AK::Detail::IntrusiveList<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*, &AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*>&) Line | Count | Source | 377 | 636k | { | 378 | | // Note: A data member pointer is a 32-bit offset in the Windows ABI (both x86 and x86_64), | 379 | | // whereas it is an appropriately sized ptrdiff_t in the Itanium ABI, the following ensures | 380 | | // that we always use the correct type for the subtraction. | 381 | 636k | using EquivalentNumericTypeForDataMemberPointer = Conditional<sizeof(member) == sizeof(ptrdiff_t), ptrdiff_t, u32>; | 382 | 636k | static_assert(sizeof(EquivalentNumericTypeForDataMemberPointer) == sizeof(member), | 383 | 636k | "The equivalent numeric type for the data member pointer must have the same size as the data member pointer itself."); | 384 | | | 385 | | // Note: Since this might seem odd, here's an explanation on what this function actually does: | 386 | | // `node` is a reference that resides in some part of the actual value (of type T), the | 387 | | // placement (i.e. offset) of which is described by the pointer-to-data-member parameter | 388 | | // named `member`. | 389 | | // This function effectively takes in the address of the data member, and returns the address | 390 | | // of the value (of type T) holding that member. | 391 | 636k | return bit_cast<T*>(bit_cast<unsigned char*>(&node) - bit_cast<EquivalentNumericTypeForDataMemberPointer>(member)); | 392 | 636k | } |
Unexecuted instantiation: AK::Detail::IntrusiveList<Shell::Shell::Promise, Shell::Shell::Promise*, &Shell::Shell::Promise::node>::node_to_value(AK::Detail::IntrusiveListNode<Shell::Shell::Promise, Shell::Shell::Promise*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*, &AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*, &AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*>&) Unexecuted instantiation: AK::Detail::IntrusiveList<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*, &AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*>&) AK::Detail::IntrusiveList<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*, &AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment::node>::node_to_value(AK::Detail::IntrusiveListNode<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*>&) Line | Count | Source | 377 | 3.58k | { | 378 | | // Note: A data member pointer is a 32-bit offset in the Windows ABI (both x86 and x86_64), | 379 | | // whereas it is an appropriately sized ptrdiff_t in the Itanium ABI, the following ensures | 380 | | // that we always use the correct type for the subtraction. | 381 | 3.58k | using EquivalentNumericTypeForDataMemberPointer = Conditional<sizeof(member) == sizeof(ptrdiff_t), ptrdiff_t, u32>; | 382 | 3.58k | static_assert(sizeof(EquivalentNumericTypeForDataMemberPointer) == sizeof(member), | 383 | 3.58k | "The equivalent numeric type for the data member pointer must have the same size as the data member pointer itself."); | 384 | | | 385 | | // Note: Since this might seem odd, here's an explanation on what this function actually does: | 386 | | // `node` is a reference that resides in some part of the actual value (of type T), the | 387 | | // placement (i.e. offset) of which is described by the pointer-to-data-member parameter | 388 | | // named `member`. | 389 | | // This function effectively takes in the address of the data member, and returns the address | 390 | | // of the value (of type T) holding that member. | 391 | 3.58k | return bit_cast<T*>(bit_cast<unsigned char*>(&node) - bit_cast<EquivalentNumericTypeForDataMemberPointer>(member)); | 392 | 3.58k | } |
|
393 | | |
394 | | template<typename T, typename Container> |
395 | | inline IntrusiveListNode<T, Container>::~IntrusiveListNode() |
396 | 9.33k | { |
397 | 9.33k | VERIFY(!is_in_list()); |
398 | 9.33k | } Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*>::~IntrusiveListNode() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*>::~IntrusiveListNode() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*>::~IntrusiveListNode() AK::Detail::IntrusiveListNode<JS::HeapBlock, JS::HeapBlock*>::~IntrusiveListNode() Line | Count | Source | 396 | 5.43k | { | 397 | 5.43k | VERIFY(!is_in_list()); | 398 | 5.43k | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<JS::ConservativeVectorBase, JS::ConservativeVectorBase*>::~IntrusiveListNode() AK::Detail::IntrusiveListNode<JS::HandleImpl, JS::HandleImpl*>::~IntrusiveListNode() Line | Count | Source | 396 | 1.42k | { | 397 | 1.42k | VERIFY(!is_in_list()); | 398 | 1.42k | } |
AK::Detail::IntrusiveListNode<JS::CellAllocator, JS::CellAllocator*>::~IntrusiveListNode() Line | Count | Source | 396 | 434 | { | 397 | 434 | VERIFY(!is_in_list()); | 398 | 434 | } |
AK::Detail::IntrusiveListNode<JS::MarkedVectorBase, JS::MarkedVectorBase*>::~IntrusiveListNode() Line | Count | Source | 396 | 16 | { | 397 | 16 | VERIFY(!is_in_list()); | 398 | 16 | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<JS::WeakContainer, JS::WeakContainer*>::~IntrusiveListNode() RegexOptimizer.cpp:AK::Detail::IntrusiveListNode<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*>::~IntrusiveListNode() Line | Count | Source | 396 | 626 | { | 397 | 626 | VERIFY(!is_in_list()); | 398 | 626 | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<Shell::Shell::Promise, Shell::Shell::Promise*>::~IntrusiveListNode() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*>::~IntrusiveListNode() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*>::~IntrusiveListNode() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*>::~IntrusiveListNode() AK::Detail::IntrusiveListNode<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*>::~IntrusiveListNode() Line | Count | Source | 396 | 1.39k | { | 397 | 1.39k | VERIFY(!is_in_list()); | 398 | 1.39k | } |
|
399 | | |
400 | | template<typename T, typename Container> |
401 | | inline void IntrusiveListNode<T, Container>::remove() |
402 | 14.4k | { |
403 | 14.4k | VERIFY(m_storage); |
404 | 14.4k | if (m_storage->m_first == this) |
405 | 14.4k | m_storage->m_first = m_next; |
406 | 14.4k | if (m_storage->m_last == this) |
407 | 8.31k | m_storage->m_last = m_prev; |
408 | 14.4k | if (m_prev) |
409 | 0 | m_prev->m_next = m_next; |
410 | 14.4k | if (m_next) |
411 | 6.09k | m_next->m_prev = m_prev; |
412 | 14.4k | m_prev = nullptr; |
413 | 14.4k | m_next = nullptr; |
414 | 14.4k | m_storage = nullptr; |
415 | | if constexpr (!IsRaw) |
416 | | m_self.reference = nullptr; |
417 | 14.4k | } Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*>::remove() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*>::remove() AK::Detail::IntrusiveListNode<JS::HandleImpl, JS::HandleImpl*>::remove() Line | Count | Source | 402 | 1.42k | { | 403 | 1.42k | VERIFY(m_storage); | 404 | 1.42k | if (m_storage->m_first == this) | 405 | 1.42k | m_storage->m_first = m_next; | 406 | 1.42k | if (m_storage->m_last == this) | 407 | 1.42k | m_storage->m_last = m_prev; | 408 | 1.42k | if (m_prev) | 409 | 0 | m_prev->m_next = m_next; | 410 | 1.42k | if (m_next) | 411 | 0 | m_next->m_prev = m_prev; | 412 | 1.42k | m_prev = nullptr; | 413 | 1.42k | m_next = nullptr; | 414 | 1.42k | m_storage = nullptr; | 415 | | if constexpr (!IsRaw) | 416 | | m_self.reference = nullptr; | 417 | 1.42k | } |
AK::Detail::IntrusiveListNode<JS::MarkedVectorBase, JS::MarkedVectorBase*>::remove() Line | Count | Source | 402 | 16 | { | 403 | 16 | VERIFY(m_storage); | 404 | 16 | if (m_storage->m_first == this) | 405 | 16 | m_storage->m_first = m_next; | 406 | 16 | if (m_storage->m_last == this) | 407 | 16 | m_storage->m_last = m_prev; | 408 | 16 | if (m_prev) | 409 | 0 | m_prev->m_next = m_next; | 410 | 16 | if (m_next) | 411 | 0 | m_next->m_prev = m_prev; | 412 | 16 | m_prev = nullptr; | 413 | 16 | m_next = nullptr; | 414 | 16 | m_storage = nullptr; | 415 | | if constexpr (!IsRaw) | 416 | | m_self.reference = nullptr; | 417 | 16 | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<JS::ConservativeVectorBase, JS::ConservativeVectorBase*>::remove() Unexecuted instantiation: AK::Detail::IntrusiveListNode<JS::WeakContainer, JS::WeakContainer*>::remove() AK::Detail::IntrusiveListNode<JS::CellAllocator, JS::CellAllocator*>::remove() Line | Count | Source | 402 | 3.28k | { | 403 | 3.28k | VERIFY(m_storage); | 404 | 3.28k | if (m_storage->m_first == this) | 405 | 3.28k | m_storage->m_first = m_next; | 406 | 3.28k | if (m_storage->m_last == this) | 407 | 62 | m_storage->m_last = m_prev; | 408 | 3.28k | if (m_prev) | 409 | 0 | m_prev->m_next = m_next; | 410 | 3.28k | if (m_next) | 411 | 3.21k | m_next->m_prev = m_prev; | 412 | 3.28k | m_prev = nullptr; | 413 | 3.28k | m_next = nullptr; | 414 | 3.28k | m_storage = nullptr; | 415 | | if constexpr (!IsRaw) | 416 | | m_self.reference = nullptr; | 417 | 3.28k | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*>::remove() AK::Detail::IntrusiveListNode<JS::HeapBlock, JS::HeapBlock*>::remove() Line | Count | Source | 402 | 7.66k | { | 403 | 7.66k | VERIFY(m_storage); | 404 | 7.66k | if (m_storage->m_first == this) | 405 | 7.66k | m_storage->m_first = m_next; | 406 | 7.66k | if (m_storage->m_last == this) | 407 | 5.75k | m_storage->m_last = m_prev; | 408 | 7.66k | if (m_prev) | 409 | 0 | m_prev->m_next = m_next; | 410 | 7.66k | if (m_next) | 411 | 1.90k | m_next->m_prev = m_prev; | 412 | 7.66k | m_prev = nullptr; | 413 | 7.66k | m_next = nullptr; | 414 | 7.66k | m_storage = nullptr; | 415 | | if constexpr (!IsRaw) | 416 | | m_self.reference = nullptr; | 417 | 7.66k | } |
RegexOptimizer.cpp:AK::Detail::IntrusiveListNode<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*>::remove() Line | Count | Source | 402 | 626 | { | 403 | 626 | VERIFY(m_storage); | 404 | 626 | if (m_storage->m_first == this) | 405 | 626 | m_storage->m_first = m_next; | 406 | 626 | if (m_storage->m_last == this) | 407 | 457 | m_storage->m_last = m_prev; | 408 | 626 | if (m_prev) | 409 | 0 | m_prev->m_next = m_next; | 410 | 626 | if (m_next) | 411 | 169 | m_next->m_prev = m_prev; | 412 | 626 | m_prev = nullptr; | 413 | 626 | m_next = nullptr; | 414 | 626 | m_storage = nullptr; | 415 | | if constexpr (!IsRaw) | 416 | | m_self.reference = nullptr; | 417 | 626 | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<Shell::Shell::Promise, Shell::Shell::Promise*>::remove() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*>::remove() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*>::remove() Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*>::remove() AK::Detail::IntrusiveListNode<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*>::remove() Line | Count | Source | 402 | 1.39k | { | 403 | 1.39k | VERIFY(m_storage); | 404 | 1.39k | if (m_storage->m_first == this) | 405 | 1.39k | m_storage->m_first = m_next; | 406 | 1.39k | if (m_storage->m_last == this) | 407 | 596 | m_storage->m_last = m_prev; | 408 | 1.39k | if (m_prev) | 409 | 0 | m_prev->m_next = m_next; | 410 | 1.39k | if (m_next) | 411 | 798 | m_next->m_prev = m_prev; | 412 | 1.39k | m_prev = nullptr; | 413 | 1.39k | m_next = nullptr; | 414 | 1.39k | m_storage = nullptr; | 415 | | if constexpr (!IsRaw) | 416 | | m_self.reference = nullptr; | 417 | 1.39k | } |
|
418 | | |
419 | | template<typename T, typename Container> |
420 | | inline bool IntrusiveListNode<T, Container>::is_in_list() const |
421 | 95.1k | { |
422 | 95.1k | return m_storage != nullptr; |
423 | 95.1k | } Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Gfx::Point<int>, 1000>::QueueSegment, AK::Queue<Gfx::Point<int>, 1000>::QueueSegment*>::is_in_list() const Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<IPC::File, 1000>::QueueSegment, AK::Queue<IPC::File, 1000>::QueueSegment*>::is_in_list() const Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment, AK::Queue<JS::Bytecode::BasicBlock*, 1000>::QueueSegment*>::is_in_list() const AK::Detail::IntrusiveListNode<JS::HeapBlock, JS::HeapBlock*>::is_in_list() const Line | Count | Source | 421 | 5.43k | { | 422 | 5.43k | return m_storage != nullptr; | 423 | 5.43k | } |
AK::Detail::IntrusiveListNode<JS::CellAllocator, JS::CellAllocator*>::is_in_list() const Line | Count | Source | 421 | 86.2k | { | 422 | 86.2k | return m_storage != nullptr; | 423 | 86.2k | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<JS::ConservativeVectorBase, JS::ConservativeVectorBase*>::is_in_list() const AK::Detail::IntrusiveListNode<JS::HandleImpl, JS::HandleImpl*>::is_in_list() const Line | Count | Source | 421 | 1.42k | { | 422 | 1.42k | return m_storage != nullptr; | 423 | 1.42k | } |
AK::Detail::IntrusiveListNode<JS::MarkedVectorBase, JS::MarkedVectorBase*>::is_in_list() const Line | Count | Source | 421 | 16 | { | 422 | 16 | return m_storage != nullptr; | 423 | 16 | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<JS::WeakContainer, JS::WeakContainer*>::is_in_list() const RegexOptimizer.cpp:AK::Detail::IntrusiveListNode<AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment, AK::Queue<AK::Trie<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> >, AK::Vector<regex::Optimizer::append_alternation(regex::ByteCode&, AK::Span<regex::ByteCode>)::QualifiedIP, 0ul>, AK::Traits<AK::DisjointSpans<unsigned long const, AK::Vector<AK::Span<unsigned long const>, 0ul> > >, void, regex::OrderedHashMapForTrie>*, 1000>::QueueSegment*>::is_in_list() const Line | Count | Source | 421 | 626 | { | 422 | 626 | return m_storage != nullptr; | 423 | 626 | } |
Unexecuted instantiation: AK::Detail::IntrusiveListNode<Shell::Shell::Promise, Shell::Shell::Promise*>::is_in_list() const Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment, AK::Queue<Web::HTML::HTMLToken, 1000>::QueueSegment*>::is_in_list() const Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment, AK::Queue<JS::Handle<Web::HTML::ChangingNavigableContinuationState>, 1000>::QueueSegment*>::is_in_list() const Unexecuted instantiation: AK::Detail::IntrusiveListNode<AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment, AK::Queue<Web::Layout::InlineLevelIterator::Item, 1000>::QueueSegment*>::is_in_list() const AK::Detail::IntrusiveListNode<AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment, AK::Queue<AK::NonnullOwnPtr<Media::VideoFrame>, 1>::QueueSegment*>::is_in_list() const Line | Count | Source | 421 | 1.39k | { | 422 | 1.39k | return m_storage != nullptr; | 423 | 1.39k | } |
|
424 | | |
425 | | // Specialise IntrusiveList for NonnullRefPtr |
426 | | // By default, intrusive lists cannot contain null entries anyway, so switch to RefPtr |
427 | | // and just make the user-facing functions deref the pointers. |
428 | | |
429 | | template<class T, SubstitutedIntrusiveListNode<T, NonnullRefPtr<T>> T::*member> |
430 | | class IntrusiveList<T, NonnullRefPtr<T>, member> : public IntrusiveList<T, RefPtr<T>, member> { |
431 | | public: |
432 | | [[nodiscard]] NonnullRefPtr<T> first() const { return *IntrusiveList<T, RefPtr<T>, member>::first(); } |
433 | | [[nodiscard]] NonnullRefPtr<T> last() const { return *IntrusiveList<T, RefPtr<T>, member>::last(); } |
434 | | |
435 | | [[nodiscard]] NonnullRefPtr<T> take_first() { return *IntrusiveList<T, RefPtr<T>, member>::take_first(); } |
436 | | [[nodiscard]] NonnullRefPtr<T> take_last() { return *IntrusiveList<T, RefPtr<T>, member>::take_last(); } |
437 | | }; |
438 | | |
439 | | #ifdef KERNEL |
440 | | // Specialise IntrusiveList for NonnullLockRefPtr |
441 | | // By default, intrusive lists cannot contain null entries anyway, so switch to LockRefPtr |
442 | | // and just make the user-facing functions deref the pointers. |
443 | | |
444 | | template<class T, SubstitutedIntrusiveListNode<T, NonnullLockRefPtr<T>> T::*member> |
445 | | class IntrusiveList<T, NonnullLockRefPtr<T>, member> : public IntrusiveList<T, LockRefPtr<T>, member> { |
446 | | public: |
447 | | [[nodiscard]] NonnullLockRefPtr<T> first() const { return *IntrusiveList<T, LockRefPtr<T>, member>::first(); } |
448 | | [[nodiscard]] NonnullLockRefPtr<T> last() const { return *IntrusiveList<T, LockRefPtr<T>, member>::last(); } |
449 | | |
450 | | [[nodiscard]] NonnullLockRefPtr<T> take_first() { return *IntrusiveList<T, LockRefPtr<T>, member>::take_first(); } |
451 | | [[nodiscard]] NonnullLockRefPtr<T> take_last() { return *IntrusiveList<T, LockRefPtr<T>, member>::take_last(); } |
452 | | }; |
453 | | #endif |
454 | | |
455 | | } |
456 | | |
457 | | namespace AK { |
458 | | |
459 | | template<typename T, typename Container = RawPtr<T>> |
460 | | using IntrusiveListNode = Detail::SubstitutedIntrusiveListNode<T, Container>; |
461 | | |
462 | | template<auto member> |
463 | | using IntrusiveList = Detail::IntrusiveList< |
464 | | decltype(Detail::ExtractIntrusiveListTypes::value(member)), |
465 | | decltype(Detail::ExtractIntrusiveListTypes::container(member)), |
466 | | member>; |
467 | | |
468 | | } |
469 | | |
470 | | #if USING_AK_GLOBALLY |
471 | | using AK::IntrusiveList; |
472 | | using AK::IntrusiveListNode; |
473 | | #endif |