/src/mozilla-central/js/src/jit/InlineList.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
2 | | * vim: set ts=8 sts=4 et sw=4 tw=99: |
3 | | * This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef jit_InlineList_h |
8 | | #define jit_InlineList_h |
9 | | |
10 | | #include "jsutil.h" |
11 | | |
12 | | namespace js { |
13 | | |
14 | | template <typename T> class InlineForwardList; |
15 | | template <typename T> class InlineForwardListIterator; |
16 | | |
17 | | template <typename T> |
18 | | class InlineForwardListNode |
19 | | { |
20 | | public: |
21 | | InlineForwardListNode() : next(nullptr) |
22 | 19.1k | { } js::InlineForwardListNode<js::jit::LiveRange::BundleLink>::InlineForwardListNode() Line | Count | Source | 22 | 5.67k | { } |
js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>::InlineForwardListNode() Line | Count | Source | 22 | 5.32k | { } |
js::InlineForwardListNode<js::jit::UsePosition>::InlineForwardListNode() Line | Count | Source | 22 | 7.60k | { } |
js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>::InlineForwardListNode() Line | Count | Source | 22 | 140 | { } |
js::InlineForwardListNode<js::jit::MStoreToRecover>::InlineForwardListNode() Line | Count | Source | 22 | 301 | { } |
js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>::InlineForwardListNode() Line | Count | Source | 22 | 141 | { } |
|
23 | | explicit InlineForwardListNode(InlineForwardListNode<T>* n) : next(n) |
24 | 7.28k | { } js::InlineForwardListNode<js::jit::MUse>::InlineForwardListNode(js::InlineForwardListNode<js::jit::MUse>*) Line | Count | Source | 24 | 1.48k | { } |
js::InlineForwardListNode<js::jit::MInstruction>::InlineForwardListNode(js::InlineForwardListNode<js::jit::MInstruction>*) Line | Count | Source | 24 | 966 | { } |
js::InlineForwardListNode<js::jit::BacktrackingAllocator::CallRange>::InlineForwardListNode(js::InlineForwardListNode<js::jit::BacktrackingAllocator::CallRange>*) Line | Count | Source | 24 | 252 | { } |
js::InlineForwardListNode<js::jit::MBasicBlock>::InlineForwardListNode(js::InlineForwardListNode<js::jit::MBasicBlock>*) Line | Count | Source | 24 | 84 | { } |
js::InlineForwardListNode<js::jit::MPhi>::InlineForwardListNode(js::InlineForwardListNode<js::jit::MPhi>*) Line | Count | Source | 24 | 84 | { } |
js::InlineForwardListNode<js::jit::LInstruction>::InlineForwardListNode(js::InlineForwardListNode<js::jit::LInstruction>*) Line | Count | Source | 24 | 1.08k | { } |
js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>::InlineForwardListNode(js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 24 | 3.33k | { } |
|
25 | | |
26 | | InlineForwardListNode(const InlineForwardListNode<T>&) = delete; |
27 | | |
28 | | protected: |
29 | | friend class InlineForwardList<T>; |
30 | | friend class InlineForwardListIterator<T>; |
31 | | |
32 | | InlineForwardListNode<T>* next; |
33 | | }; |
34 | | |
35 | | template <typename T> |
36 | | class InlineForwardList : protected InlineForwardListNode<T> |
37 | | { |
38 | | friend class InlineForwardListIterator<T>; |
39 | | |
40 | | typedef InlineForwardListNode<T> Node; |
41 | | |
42 | | Node* tail_; |
43 | | #ifdef DEBUG |
44 | | int modifyCount_; |
45 | | #endif |
46 | | |
47 | 6.63k | InlineForwardList<T>* thisFromConstructor() { |
48 | 6.63k | return this; |
49 | 6.63k | } js::InlineForwardList<js::jit::UsePosition>::thisFromConstructor() Line | Count | Source | 47 | 4.54k | InlineForwardList<T>* thisFromConstructor() { | 48 | 4.54k | return this; | 49 | 4.54k | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::thisFromConstructor() Line | Count | Source | 47 | 780 | InlineForwardList<T>* thisFromConstructor() { | 48 | 780 | return this; | 49 | 780 | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::thisFromConstructor() Line | Count | Source | 47 | 1.12k | InlineForwardList<T>* thisFromConstructor() { | 48 | 1.12k | return this; | 49 | 1.12k | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::thisFromConstructor() Line | Count | Source | 47 | 42 | InlineForwardList<T>* thisFromConstructor() { | 48 | 42 | return this; | 49 | 42 | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::thisFromConstructor() Line | Count | Source | 47 | 141 | InlineForwardList<T>* thisFromConstructor() { | 48 | 141 | return this; | 49 | 141 | } |
|
50 | | |
51 | | public: |
52 | | InlineForwardList() |
53 | | : tail_(thisFromConstructor()) |
54 | 6.63k | { |
55 | | #ifdef DEBUG |
56 | | modifyCount_ = 0; |
57 | | #endif |
58 | | } js::InlineForwardList<js::jit::UsePosition>::InlineForwardList() Line | Count | Source | 54 | 4.54k | { | 55 | | #ifdef DEBUG | 56 | | modifyCount_ = 0; | 57 | | #endif | 58 | | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::InlineForwardList() Line | Count | Source | 54 | 780 | { | 55 | | #ifdef DEBUG | 56 | | modifyCount_ = 0; | 57 | | #endif | 58 | | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::InlineForwardList() Line | Count | Source | 54 | 1.12k | { | 55 | | #ifdef DEBUG | 56 | | modifyCount_ = 0; | 57 | | #endif | 58 | | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::InlineForwardList() Line | Count | Source | 54 | 42 | { | 55 | | #ifdef DEBUG | 56 | | modifyCount_ = 0; | 57 | | #endif | 58 | | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::InlineForwardList() Line | Count | Source | 54 | 141 | { | 55 | | #ifdef DEBUG | 56 | | modifyCount_ = 0; | 57 | | #endif | 58 | | } |
|
59 | | |
60 | | public: |
61 | | typedef InlineForwardListIterator<T> iterator; |
62 | | |
63 | | public: |
64 | 49.2k | iterator begin() const { |
65 | 49.2k | return iterator(this); |
66 | 49.2k | } js::InlineForwardList<js::jit::UsePosition>::begin() const Line | Count | Source | 64 | 9.43k | iterator begin() const { | 65 | 9.43k | return iterator(this); | 66 | 9.43k | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::begin() const Line | Count | Source | 64 | 23.9k | iterator begin() const { | 65 | 23.9k | return iterator(this); | 66 | 23.9k | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::begin() const Line | Count | Source | 64 | 15.4k | iterator begin() const { | 65 | 15.4k | return iterator(this); | 66 | 15.4k | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::begin() const Line | Count | Source | 64 | 378 | iterator begin() const { | 65 | 378 | return iterator(this); | 66 | 378 | } |
|
67 | 0 | iterator begin(Node* item) const { |
68 | 0 | return iterator(this, item); |
69 | 0 | } |
70 | | iterator end() const { |
71 | | return iterator(nullptr); |
72 | | } |
73 | 275 | void removeAt(iterator where) { |
74 | 275 | removeAfter(where.prev, where.iter); |
75 | 275 | } js::InlineForwardList<js::jit::LiveRange::BundleLink>::removeAt(js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>) Line | Count | Source | 73 | 84 | void removeAt(iterator where) { | 74 | 84 | removeAfter(where.prev, where.iter); | 75 | 84 | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::removeAt(js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>) Line | Count | Source | 73 | 191 | void removeAt(iterator where) { | 74 | 191 | removeAfter(where.prev, where.iter); | 75 | 191 | } |
|
76 | 7.73k | void pushFront(Node* t) { |
77 | 7.73k | insertAfter(this, t); |
78 | 7.73k | } js::InlineForwardList<js::jit::UsePosition>::pushFront(js::InlineForwardListNode<js::jit::UsePosition>*) Line | Count | Source | 76 | 3.25k | void pushFront(Node* t) { | 77 | 3.25k | insertAfter(this, t); | 78 | 3.25k | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::pushFront(js::InlineForwardListNode<js::jit::LiveRange::BundleLink>*) Line | Count | Source | 76 | 1.18k | void pushFront(Node* t) { | 77 | 1.18k | insertAfter(this, t); | 78 | 1.18k | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::pushFront(js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>*) Line | Count | Source | 76 | 957 | void pushFront(Node* t) { | 77 | 957 | insertAfter(this, t); | 78 | 957 | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::pushFront(js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>*) Line | Count | Source | 76 | 98 | void pushFront(Node* t) { | 77 | 98 | insertAfter(this, t); | 78 | 98 | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::pushFront(js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 76 | 2.23k | void pushFront(Node* t) { | 77 | 2.23k | insertAfter(this, t); | 78 | 2.23k | } |
|
79 | 2.57k | void pushBack(Node* t) { |
80 | 2.57k | MOZ_ASSERT(t->next == nullptr); |
81 | | #ifdef DEBUG |
82 | | modifyCount_++; |
83 | | #endif |
84 | | tail_->next = t; |
85 | 2.57k | tail_ = t; |
86 | 2.57k | } js::InlineForwardList<js::jit::UsePosition>::pushBack(js::InlineForwardListNode<js::jit::UsePosition>*) Line | Count | Source | 79 | 1.90k | void pushBack(Node* t) { | 80 | 1.90k | MOZ_ASSERT(t->next == nullptr); | 81 | | #ifdef DEBUG | 82 | | modifyCount_++; | 83 | | #endif | 84 | | tail_->next = t; | 85 | 1.90k | tail_ = t; | 86 | 1.90k | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::pushBack(js::InlineForwardListNode<js::jit::LiveRange::BundleLink>*) Line | Count | Source | 79 | 168 | void pushBack(Node* t) { | 80 | 168 | MOZ_ASSERT(t->next == nullptr); | 81 | | #ifdef DEBUG | 82 | | modifyCount_++; | 83 | | #endif | 84 | | tail_->next = t; | 85 | 168 | tail_ = t; | 86 | 168 | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::pushBack(js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>*) Line | Count | Source | 79 | 214 | void pushBack(Node* t) { | 80 | 214 | MOZ_ASSERT(t->next == nullptr); | 81 | | #ifdef DEBUG | 82 | | modifyCount_++; | 83 | | #endif | 84 | | tail_->next = t; | 85 | 214 | tail_ = t; | 86 | 214 | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::pushBack(js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>*) Line | Count | Source | 79 | 294 | void pushBack(Node* t) { | 80 | 294 | MOZ_ASSERT(t->next == nullptr); | 81 | | #ifdef DEBUG | 82 | | modifyCount_++; | 83 | | #endif | 84 | | tail_->next = t; | 85 | 294 | tail_ = t; | 86 | 294 | } |
|
87 | 4.55k | T* popFront() { |
88 | 4.55k | MOZ_ASSERT(!empty()); |
89 | 4.55k | T* result = static_cast<T*>(this->next); |
90 | 4.55k | removeAfter(this, result); |
91 | 4.55k | return result; |
92 | 4.55k | } js::InlineForwardList<js::jit::UsePosition>::popFront() Line | Count | Source | 87 | 2.13k | T* popFront() { | 88 | 2.13k | MOZ_ASSERT(!empty()); | 89 | 2.13k | T* result = static_cast<T*>(this->next); | 90 | 2.13k | removeAfter(this, result); | 91 | 2.13k | return result; | 92 | 2.13k | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::popFront() Line | Count | Source | 87 | 294 | T* popFront() { | 88 | 294 | MOZ_ASSERT(!empty()); | 89 | 294 | T* result = static_cast<T*>(this->next); | 90 | 294 | removeAfter(this, result); | 91 | 294 | return result; | 92 | 294 | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::popFront() Line | Count | Source | 87 | 2.12k | T* popFront() { | 88 | 2.12k | MOZ_ASSERT(!empty()); | 89 | 2.12k | T* result = static_cast<T*>(this->next); | 90 | 2.12k | removeAfter(this, result); | 91 | 2.12k | return result; | 92 | 2.12k | } |
|
93 | 4.92k | T* back() const { |
94 | 4.92k | MOZ_ASSERT(!empty()); |
95 | 4.92k | return static_cast<T*>(tail_); |
96 | 4.92k | } js::InlineForwardList<js::jit::LiveRange::RegisterLink>::back() const Line | Count | Source | 93 | 275 | T* back() const { | 94 | 275 | MOZ_ASSERT(!empty()); | 95 | 275 | return static_cast<T*>(tail_); | 96 | 275 | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::back() const Line | Count | Source | 93 | 252 | T* back() const { | 94 | 252 | MOZ_ASSERT(!empty()); | 95 | 252 | return static_cast<T*>(tail_); | 96 | 252 | } |
js::InlineForwardList<js::jit::UsePosition>::back() const Line | Count | Source | 93 | 4.40k | T* back() const { | 94 | 4.40k | MOZ_ASSERT(!empty()); | 95 | 4.40k | return static_cast<T*>(tail_); | 96 | 4.40k | } |
|
97 | 7.85k | void insertAfter(Node* at, Node* item) { |
98 | 7.85k | MOZ_ASSERT(item->next == nullptr); |
99 | | #ifdef DEBUG |
100 | | modifyCount_++; |
101 | | #endif |
102 | 7.85k | if (at == tail_) { |
103 | 3.11k | tail_ = item; |
104 | 3.11k | } |
105 | 7.85k | item->next = at->next; |
106 | 7.85k | at->next = item; |
107 | 7.85k | } js::InlineForwardList<js::jit::UsePosition>::insertAfter(js::InlineForwardListNode<js::jit::UsePosition>*, js::InlineForwardListNode<js::jit::UsePosition>*) Line | Count | Source | 97 | 3.29k | void insertAfter(Node* at, Node* item) { | 98 | 3.29k | MOZ_ASSERT(item->next == nullptr); | 99 | | #ifdef DEBUG | 100 | | modifyCount_++; | 101 | | #endif | 102 | 3.29k | if (at == tail_) { | 103 | 914 | tail_ = item; | 104 | 914 | } | 105 | 3.29k | item->next = at->next; | 106 | 3.29k | at->next = item; | 107 | 3.29k | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::insertAfter(js::InlineForwardListNode<js::jit::LiveRange::BundleLink>*, js::InlineForwardListNode<js::jit::LiveRange::BundleLink>*) Line | Count | Source | 97 | 1.21k | void insertAfter(Node* at, Node* item) { | 98 | 1.21k | MOZ_ASSERT(item->next == nullptr); | 99 | | #ifdef DEBUG | 100 | | modifyCount_++; | 101 | | #endif | 102 | 1.21k | if (at == tail_) { | 103 | 1.12k | tail_ = item; | 104 | 1.12k | } | 105 | 1.21k | item->next = at->next; | 106 | 1.21k | at->next = item; | 107 | 1.21k | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::insertAfter(js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>*, js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>*) Line | Count | Source | 97 | 1.01k | void insertAfter(Node* at, Node* item) { | 98 | 1.01k | MOZ_ASSERT(item->next == nullptr); | 99 | | #ifdef DEBUG | 100 | | modifyCount_++; | 101 | | #endif | 102 | 1.01k | if (at == tail_) { | 103 | 873 | tail_ = item; | 104 | 873 | } | 105 | 1.01k | item->next = at->next; | 106 | 1.01k | at->next = item; | 107 | 1.01k | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::insertAfter(js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>*, js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>*) Line | Count | Source | 97 | 98 | void insertAfter(Node* at, Node* item) { | 98 | 98 | MOZ_ASSERT(item->next == nullptr); | 99 | | #ifdef DEBUG | 100 | | modifyCount_++; | 101 | | #endif | 102 | 98 | if (at == tail_) { | 103 | 14 | tail_ = item; | 104 | 14 | } | 105 | 98 | item->next = at->next; | 106 | 98 | at->next = item; | 107 | 98 | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::insertAfter(js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>*, js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 97 | 2.23k | void insertAfter(Node* at, Node* item) { | 98 | 2.23k | MOZ_ASSERT(item->next == nullptr); | 99 | | #ifdef DEBUG | 100 | | modifyCount_++; | 101 | | #endif | 102 | 2.23k | if (at == tail_) { | 103 | 189 | tail_ = item; | 104 | 189 | } | 105 | 2.23k | item->next = at->next; | 106 | 2.23k | at->next = item; | 107 | 2.23k | } |
|
108 | 4.82k | void removeAfter(Node* at, Node* item) { |
109 | | #ifdef DEBUG |
110 | | modifyCount_++; |
111 | | #endif |
112 | 4.82k | if (item == tail_) { |
113 | 512 | tail_ = at; |
114 | 512 | } |
115 | 4.82k | MOZ_ASSERT(at->next == item); |
116 | 4.82k | at->next = item->next; |
117 | 4.82k | item->next = nullptr; |
118 | 4.82k | } js::InlineForwardList<js::jit::UsePosition>::removeAfter(js::InlineForwardListNode<js::jit::UsePosition>*, js::InlineForwardListNode<js::jit::UsePosition>*) Line | Count | Source | 108 | 2.13k | void removeAfter(Node* at, Node* item) { | 109 | | #ifdef DEBUG | 110 | | modifyCount_++; | 111 | | #endif | 112 | 2.13k | if (item == tail_) { | 113 | 191 | tail_ = at; | 114 | 191 | } | 115 | 2.13k | MOZ_ASSERT(at->next == item); | 116 | 2.13k | at->next = item->next; | 117 | 2.13k | item->next = nullptr; | 118 | 2.13k | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::removeAfter(js::InlineForwardListNode<js::jit::LiveRange::BundleLink>*, js::InlineForwardListNode<js::jit::LiveRange::BundleLink>*) Line | Count | Source | 108 | 84 | void removeAfter(Node* at, Node* item) { | 109 | | #ifdef DEBUG | 110 | | modifyCount_++; | 111 | | #endif | 112 | 84 | if (item == tail_) { | 113 | 56 | tail_ = at; | 114 | 56 | } | 115 | 84 | MOZ_ASSERT(at->next == item); | 116 | 84 | at->next = item->next; | 117 | 84 | item->next = nullptr; | 118 | 84 | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::removeAfter(js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>*, js::InlineForwardListNode<js::jit::LiveRange::RegisterLink>*) Line | Count | Source | 108 | 191 | void removeAfter(Node* at, Node* item) { | 109 | | #ifdef DEBUG | 110 | | modifyCount_++; | 111 | | #endif | 112 | 191 | if (item == tail_) { | 113 | 107 | tail_ = at; | 114 | 107 | } | 115 | 191 | MOZ_ASSERT(at->next == item); | 116 | 191 | at->next = item->next; | 117 | 191 | item->next = nullptr; | 118 | 191 | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::removeAfter(js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>*, js::InlineForwardListNode<js::jit::BacktrackingAllocator::SpillSlot>*) Line | Count | Source | 108 | 294 | void removeAfter(Node* at, Node* item) { | 109 | | #ifdef DEBUG | 110 | | modifyCount_++; | 111 | | #endif | 112 | 294 | if (item == tail_) { | 113 | 14 | tail_ = at; | 114 | 14 | } | 115 | 294 | MOZ_ASSERT(at->next == item); | 116 | 294 | at->next = item->next; | 117 | 294 | item->next = nullptr; | 118 | 294 | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::removeAfter(js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>*, js::InlineForwardListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 108 | 2.12k | void removeAfter(Node* at, Node* item) { | 109 | | #ifdef DEBUG | 110 | | modifyCount_++; | 111 | | #endif | 112 | 2.12k | if (item == tail_) { | 113 | 144 | tail_ = at; | 114 | 144 | } | 115 | 2.12k | MOZ_ASSERT(at->next == item); | 116 | 2.12k | at->next = item->next; | 117 | 2.12k | item->next = nullptr; | 118 | 2.12k | } |
|
119 | 70 | void removeAndIncrement(iterator &where) { |
120 | 70 | // Do not change modifyCount_ here. The iterator can still be used |
121 | 70 | // after calling this method, unlike the other methods that modify |
122 | 70 | // the list. |
123 | 70 | Node* item = where.iter; |
124 | 70 | where.iter = item->next; |
125 | 70 | if (item == tail_) { |
126 | 70 | tail_ = where.prev; |
127 | 70 | } |
128 | 70 | MOZ_ASSERT(where.prev->next == item); |
129 | 70 | where.prev->next = where.iter; |
130 | 70 | item->next = nullptr; |
131 | 70 | } js::InlineForwardList<js::jit::LiveRange::BundleLink>::removeAndIncrement(js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>&) Line | Count | Source | 119 | 70 | void removeAndIncrement(iterator &where) { | 120 | 70 | // Do not change modifyCount_ here. The iterator can still be used | 121 | 70 | // after calling this method, unlike the other methods that modify | 122 | 70 | // the list. | 123 | 70 | Node* item = where.iter; | 124 | 70 | where.iter = item->next; | 125 | 70 | if (item == tail_) { | 126 | 70 | tail_ = where.prev; | 127 | 70 | } | 128 | 70 | MOZ_ASSERT(where.prev->next == item); | 129 | 70 | where.prev->next = where.iter; | 130 | 70 | item->next = nullptr; | 131 | 70 | } |
Unexecuted instantiation: js::InlineForwardList<js::jit::LiveRange::RegisterLink>::removeAndIncrement(js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>&) Unexecuted instantiation: js::InlineForwardList<js::jit::UsePosition>::removeAndIncrement(js::InlineForwardListIterator<js::jit::UsePosition>&) |
132 | | void splitAfter(Node* at, InlineForwardList<T>* to) { |
133 | | MOZ_ASSERT(to->empty()); |
134 | | if (!at) { |
135 | | at = this; |
136 | | } |
137 | | if (at == tail_) { |
138 | | return; |
139 | | } |
140 | | #ifdef DEBUG |
141 | | modifyCount_++; |
142 | | #endif |
143 | | to->next = at->next; |
144 | | to->tail_ = tail_; |
145 | | tail_ = at; |
146 | | at->next = nullptr; |
147 | | } |
148 | 9.58k | bool empty() const { |
149 | 9.58k | return tail_ == this; |
150 | 9.58k | } js::InlineForwardList<js::jit::UsePosition>::empty() const Line | Count | Source | 148 | 5.19k | bool empty() const { | 149 | 5.19k | return tail_ == this; | 150 | 5.19k | } |
js::InlineForwardList<js::jit::LiveRange::BundleLink>::empty() const Line | Count | Source | 148 | 1.38k | bool empty() const { | 149 | 1.38k | return tail_ == this; | 150 | 1.38k | } |
js::InlineForwardList<js::jit::LiveRange::RegisterLink>::empty() const Line | Count | Source | 148 | 377 | bool empty() const { | 149 | 377 | return tail_ == this; | 150 | 377 | } |
js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot>::empty() const Line | Count | Source | 148 | 392 | bool empty() const { | 149 | 392 | return tail_ == this; | 150 | 392 | } |
js::InlineForwardList<js::jit::MoveResolver::PendingMove>::empty() const Line | Count | Source | 148 | 2.23k | bool empty() const { | 149 | 2.23k | return tail_ == this; | 150 | 2.23k | } |
|
151 | | void clear() { |
152 | | this->next = nullptr; |
153 | | tail_ = this; |
154 | | #ifdef DEBUG |
155 | | modifyCount_ = 0; |
156 | | #endif |
157 | | } |
158 | | }; |
159 | | |
160 | | template <typename T> |
161 | | class InlineForwardListIterator |
162 | | { |
163 | | private: |
164 | | friend class InlineForwardList<T>; |
165 | | |
166 | | typedef InlineForwardListNode<T> Node; |
167 | | |
168 | | explicit InlineForwardListIterator<T>(const InlineForwardList<T>* owner) |
169 | | : prev(const_cast<Node*>(static_cast<const Node*>(owner))), |
170 | | iter(owner ? owner->next : nullptr) |
171 | | #ifdef DEBUG |
172 | | , owner_(owner), |
173 | | modifyCount_(owner ? owner->modifyCount_ : 0) |
174 | | #endif |
175 | 49.2k | { } js::InlineForwardListIterator<js::jit::UsePosition>::InlineForwardListIterator(js::InlineForwardList<js::jit::UsePosition> const*) Line | Count | Source | 175 | 9.43k | { } |
js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>::InlineForwardListIterator(js::InlineForwardList<js::jit::LiveRange::BundleLink> const*) Line | Count | Source | 175 | 23.9k | { } |
js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>::InlineForwardListIterator(js::InlineForwardList<js::jit::LiveRange::RegisterLink> const*) Line | Count | Source | 175 | 15.4k | { } |
js::InlineForwardListIterator<js::jit::BacktrackingAllocator::SpillSlot>::InlineForwardListIterator(js::InlineForwardList<js::jit::BacktrackingAllocator::SpillSlot> const*) Line | Count | Source | 175 | 378 | { } |
|
176 | | |
177 | | InlineForwardListIterator<T>(const InlineForwardList<T>* owner, Node* node) |
178 | | : prev(nullptr), |
179 | | iter(node) |
180 | | #ifdef DEBUG |
181 | | , owner_(owner), |
182 | | modifyCount_(owner ? owner->modifyCount_ : 0) |
183 | | #endif |
184 | 0 | { } |
185 | | |
186 | | public: |
187 | 31.8k | InlineForwardListIterator<T> & operator ++() { |
188 | 31.8k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); |
189 | 31.8k | prev = iter; |
190 | 31.8k | iter = iter->next; |
191 | 31.8k | return *this; |
192 | 31.8k | } js::InlineForwardListIterator<js::jit::UsePosition>::operator++() Line | Count | Source | 187 | 9.26k | InlineForwardListIterator<T> & operator ++() { | 188 | 9.26k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 189 | 9.26k | prev = iter; | 190 | 9.26k | iter = iter->next; | 191 | 9.26k | return *this; | 192 | 9.26k | } |
js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>::operator++() Line | Count | Source | 187 | 10.7k | InlineForwardListIterator<T> & operator ++() { | 188 | 10.7k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 189 | 10.7k | prev = iter; | 190 | 10.7k | iter = iter->next; | 191 | 10.7k | return *this; | 192 | 10.7k | } |
js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>::operator++() Line | Count | Source | 187 | 11.8k | InlineForwardListIterator<T> & operator ++() { | 188 | 11.8k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 189 | 11.8k | prev = iter; | 190 | 11.8k | iter = iter->next; | 191 | 11.8k | return *this; | 192 | 11.8k | } |
|
193 | 30.5k | InlineForwardListIterator<T> operator ++(int) { |
194 | 30.5k | InlineForwardListIterator<T> old(*this); |
195 | 30.5k | operator++(); |
196 | 30.5k | return old; |
197 | 30.5k | } js::InlineForwardListIterator<js::jit::UsePosition>::operator++(int) Line | Count | Source | 193 | 9.26k | InlineForwardListIterator<T> operator ++(int) { | 194 | 9.26k | InlineForwardListIterator<T> old(*this); | 195 | 9.26k | operator++(); | 196 | 9.26k | return old; | 197 | 9.26k | } |
js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>::operator++(int) Line | Count | Source | 193 | 10.5k | InlineForwardListIterator<T> operator ++(int) { | 194 | 10.5k | InlineForwardListIterator<T> old(*this); | 195 | 10.5k | operator++(); | 196 | 10.5k | return old; | 197 | 10.5k | } |
js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>::operator++(int) Line | Count | Source | 193 | 10.7k | InlineForwardListIterator<T> operator ++(int) { | 194 | 10.7k | InlineForwardListIterator<T> old(*this); | 195 | 10.7k | operator++(); | 196 | 10.7k | return old; | 197 | 10.7k | } |
|
198 | 46.9k | T * operator*() const { |
199 | 46.9k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); |
200 | 46.9k | return static_cast<T*>(iter); |
201 | 46.9k | } js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>::operator*() const Line | Count | Source | 198 | 26.3k | T * operator*() const { | 199 | 26.3k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 200 | 26.3k | return static_cast<T*>(iter); | 201 | 26.3k | } |
js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>::operator*() const Line | Count | Source | 198 | 17.1k | T * operator*() const { | 199 | 17.1k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 200 | 17.1k | return static_cast<T*>(iter); | 201 | 17.1k | } |
js::InlineForwardListIterator<js::jit::UsePosition>::operator*() const Line | Count | Source | 198 | 3.09k | T * operator*() const { | 199 | 3.09k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 200 | 3.09k | return static_cast<T*>(iter); | 201 | 3.09k | } |
js::InlineForwardListIterator<js::jit::BacktrackingAllocator::SpillSlot>::operator*() const Line | Count | Source | 198 | 378 | T * operator*() const { | 199 | 378 | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); | 200 | 378 | return static_cast<T*>(iter); | 201 | 378 | } |
|
202 | 12.3k | T * operator ->() const { |
203 | 12.3k | MOZ_ASSERT(modifyCount_ == owner_->modifyCount_); |
204 | 12.3k | return static_cast<T*>(iter); |
205 | 12.3k | } |
206 | 957 | bool operator !=(const InlineForwardListIterator<T>& where) const { |
207 | 957 | return iter != where.iter; |
208 | 957 | } js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>::operator!=(js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink> const&) const Line | Count | Source | 206 | 409 | bool operator !=(const InlineForwardListIterator<T>& where) const { | 207 | 409 | return iter != where.iter; | 208 | 409 | } |
js::InlineForwardListIterator<js::jit::UsePosition>::operator!=(js::InlineForwardListIterator<js::jit::UsePosition> const&) const Line | Count | Source | 206 | 548 | bool operator !=(const InlineForwardListIterator<T>& where) const { | 207 | 548 | return iter != where.iter; | 208 | 548 | } |
|
209 | | bool operator ==(const InlineForwardListIterator<T>& where) const { |
210 | | return iter == where.iter; |
211 | | } |
212 | 73.4k | explicit operator bool() const { |
213 | 73.4k | return iter != nullptr; |
214 | 73.4k | } js::InlineForwardListIterator<js::jit::UsePosition>::operator bool() const Line | Count | Source | 212 | 18.0k | explicit operator bool() const { | 213 | 18.0k | return iter != nullptr; | 214 | 18.0k | } |
js::InlineForwardListIterator<js::jit::LiveRange::BundleLink>::operator bool() const Line | Count | Source | 212 | 33.5k | explicit operator bool() const { | 213 | 33.5k | return iter != nullptr; | 214 | 33.5k | } |
js::InlineForwardListIterator<js::jit::LiveRange::RegisterLink>::operator bool() const Line | Count | Source | 212 | 21.8k | explicit operator bool() const { | 213 | 21.8k | return iter != nullptr; | 214 | 21.8k | } |
|
215 | | |
216 | | private: |
217 | | Node* prev; |
218 | | Node* iter; |
219 | | |
220 | | #ifdef DEBUG |
221 | | const InlineForwardList<T>* owner_; |
222 | | int modifyCount_; |
223 | | #endif |
224 | | }; |
225 | | |
226 | | template <typename T> class InlineList; |
227 | | template <typename T> class InlineListIterator; |
228 | | template <typename T> class InlineListReverseIterator; |
229 | | |
230 | | template <typename T> |
231 | | class InlineListNode : public InlineForwardListNode<T> |
232 | | { |
233 | | public: |
234 | | InlineListNode() : InlineForwardListNode<T>(nullptr), prev(nullptr) |
235 | 5.05k | { } js::InlineListNode<js::jit::MInstruction>::InlineListNode() Line | Count | Source | 235 | 896 | { } |
js::InlineListNode<js::jit::MUse>::InlineListNode() Line | Count | Source | 235 | 588 | { } |
js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>::InlineListNode() Line | Count | Source | 235 | 238 | { } |
Unexecuted instantiation: js::InlineListNode<js::jit::MPhi>::InlineListNode() js::InlineListNode<js::jit::LInstruction>::InlineListNode() Line | Count | Source | 235 | 1.03k | { } |
js::InlineListNode<js::jit::MBasicBlock>::InlineListNode() Line | Count | Source | 235 | 70 | { } |
js::InlineListNode<js::jit::MoveResolver::PendingMove>::InlineListNode() Line | Count | Source | 235 | 2.23k | { } |
|
236 | | InlineListNode(InlineListNode<T>* n, InlineListNode<T>* p) |
237 | | : InlineForwardListNode<T>(n), |
238 | | prev(p) |
239 | 2.23k | { } js::InlineListNode<js::jit::MUse>::InlineListNode(js::InlineListNode<js::jit::MUse>*, js::InlineListNode<js::jit::MUse>*) Line | Count | Source | 239 | 896 | { } |
js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>::InlineListNode(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*, js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*) Line | Count | Source | 239 | 14 | { } |
js::InlineListNode<js::jit::MBasicBlock>::InlineListNode(js::InlineListNode<js::jit::MBasicBlock>*, js::InlineListNode<js::jit::MBasicBlock>*) Line | Count | Source | 239 | 14 | { } |
js::InlineListNode<js::jit::MPhi>::InlineListNode(js::InlineListNode<js::jit::MPhi>*, js::InlineListNode<js::jit::MPhi>*) Line | Count | Source | 239 | 84 | { } |
js::InlineListNode<js::jit::LInstruction>::InlineListNode(js::InlineListNode<js::jit::LInstruction>*, js::InlineListNode<js::jit::LInstruction>*) Line | Count | Source | 239 | 56 | { } |
js::InlineListNode<js::jit::MInstruction>::InlineListNode(js::InlineListNode<js::jit::MInstruction>*, js::InlineListNode<js::jit::MInstruction>*) Line | Count | Source | 239 | 70 | { } |
js::InlineListNode<js::jit::MoveResolver::PendingMove>::InlineListNode(js::InlineListNode<js::jit::MoveResolver::PendingMove>*, js::InlineListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 239 | 1.09k | { } |
|
240 | | |
241 | | // Move constructor. Nodes may be moved without being removed from their |
242 | | // containing lists. For example, this allows list nodes to be safely |
243 | | // stored in a resizable Vector -- when the Vector resizes, the new storage |
244 | | // is initialized by this move constructor. |other| is a reference to the |
245 | | // old node which the |this| node here is replacing. |
246 | | InlineListNode(InlineListNode<T>&& other) |
247 | | : InlineForwardListNode<T>(other.next) |
248 | 0 | { |
249 | 0 | InlineListNode<T>* newNext = static_cast<InlineListNode<T>*>(other.next); |
250 | 0 | InlineListNode<T>* newPrev = other.prev; |
251 | 0 | prev = newPrev; |
252 | 0 |
|
253 | 0 | // Update the pointers in the adjacent nodes to point to this node's new |
254 | 0 | // location. |
255 | 0 | newNext->prev = this; |
256 | 0 | newPrev->next = this; |
257 | 0 | } |
258 | | |
259 | | InlineListNode(const InlineListNode<T>&) = delete; |
260 | | void operator=(const InlineListNode<T>&) = delete; |
261 | | |
262 | 14 | bool isInList() { |
263 | 14 | return prev != nullptr && this->next != nullptr; |
264 | 14 | } |
265 | | |
266 | | protected: |
267 | | friend class InlineList<T>; |
268 | | friend class InlineListIterator<T>; |
269 | | friend class InlineListReverseIterator<T>; |
270 | | |
271 | | InlineListNode<T>* prev; |
272 | | }; |
273 | | |
274 | | template <typename T> |
275 | | class InlineList : protected InlineListNode<T> |
276 | | { |
277 | | typedef InlineListNode<T> Node; |
278 | | |
279 | | public: |
280 | | InlineList() : InlineListNode<T>(this, this) |
281 | 2.23k | { } js::InlineList<js::jit::MUse>::InlineList() Line | Count | Source | 281 | 896 | { } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::InlineList() Line | Count | Source | 281 | 14 | { } |
js::InlineList<js::jit::MBasicBlock>::InlineList() Line | Count | Source | 281 | 14 | { } |
js::InlineList<js::jit::MPhi>::InlineList() Line | Count | Source | 281 | 84 | { } |
js::InlineList<js::jit::LInstruction>::InlineList() Line | Count | Source | 281 | 56 | { } |
js::InlineList<js::jit::MInstruction>::InlineList() Line | Count | Source | 281 | 70 | { } |
js::InlineList<js::jit::MoveResolver::PendingMove>::InlineList() Line | Count | Source | 281 | 1.09k | { } |
|
282 | | |
283 | | public: |
284 | | typedef InlineListIterator<T> iterator; |
285 | | typedef InlineListReverseIterator<T> reverse_iterator; |
286 | | |
287 | | public: |
288 | 15.6k | iterator begin() const { |
289 | 15.6k | return iterator(static_cast<Node*>(this->next)); |
290 | 15.6k | } js::InlineList<js::jit::MoveResolver::PendingMove>::begin() const Line | Count | Source | 288 | 9.89k | iterator begin() const { | 289 | 9.89k | return iterator(static_cast<Node*>(this->next)); | 290 | 9.89k | } |
js::InlineList<js::jit::MBasicBlock>::begin() const Line | Count | Source | 288 | 560 | iterator begin() const { | 289 | 560 | return iterator(static_cast<Node*>(this->next)); | 290 | 560 | } |
js::InlineList<js::jit::MInstruction>::begin() const Line | Count | Source | 288 | 1.31k | iterator begin() const { | 289 | 1.31k | return iterator(static_cast<Node*>(this->next)); | 290 | 1.31k | } |
js::InlineList<js::jit::MPhi>::begin() const Line | Count | Source | 288 | 1.27k | iterator begin() const { | 289 | 1.27k | return iterator(static_cast<Node*>(this->next)); | 290 | 1.27k | } |
js::InlineList<js::jit::LInstruction>::begin() const Line | Count | Source | 288 | 364 | iterator begin() const { | 289 | 364 | return iterator(static_cast<Node*>(this->next)); | 290 | 364 | } |
js::InlineList<js::jit::MUse>::begin() const Line | Count | Source | 288 | 2.28k | iterator begin() const { | 289 | 2.28k | return iterator(static_cast<Node*>(this->next)); | 290 | 2.28k | } |
|
291 | 345 | iterator begin(Node* t) const { |
292 | 345 | return iterator(t); |
293 | 345 | } js::InlineList<js::jit::MInstruction>::begin(js::InlineListNode<js::jit::MInstruction>*) const Line | Count | Source | 291 | 149 | iterator begin(Node* t) const { | 292 | 149 | return iterator(t); | 293 | 149 | } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::begin(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*) const Line | Count | Source | 291 | 182 | iterator begin(Node* t) const { | 292 | 182 | return iterator(t); | 293 | 182 | } |
Unexecuted instantiation: js::InlineList<js::jit::MPhi>::begin(js::InlineListNode<js::jit::MPhi>*) const js::InlineList<js::jit::MBasicBlock>::begin(js::InlineListNode<js::jit::MBasicBlock>*) const Line | Count | Source | 291 | 14 | iterator begin(Node* t) const { | 292 | 14 | return iterator(t); | 293 | 14 | } |
Unexecuted instantiation: js::InlineList<js::jit::LInstruction>::begin(js::InlineListNode<js::jit::LInstruction>*) const |
294 | 50.0k | iterator end() const { |
295 | 50.0k | return iterator(this); |
296 | 50.0k | } js::InlineList<js::jit::MoveResolver::PendingMove>::end() const Line | Count | Source | 294 | 14.5k | iterator end() const { | 295 | 14.5k | return iterator(this); | 296 | 14.5k | } |
js::InlineList<js::jit::MBasicBlock>::end() const Line | Count | Source | 294 | 1.83k | iterator end() const { | 295 | 1.83k | return iterator(this); | 296 | 1.83k | } |
js::InlineList<js::jit::MPhi>::end() const Line | Count | Source | 294 | 19.5k | iterator end() const { | 295 | 19.5k | return iterator(this); | 296 | 19.5k | } |
js::InlineList<js::jit::MInstruction>::end() const Line | Count | Source | 294 | 7.25k | iterator end() const { | 295 | 7.25k | return iterator(this); | 296 | 7.25k | } |
js::InlineList<js::jit::LInstruction>::end() const Line | Count | Source | 294 | 2.99k | iterator end() const { | 295 | 2.99k | return iterator(this); | 296 | 2.99k | } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::end() const Line | Count | Source | 294 | 518 | iterator end() const { | 295 | 518 | return iterator(this); | 296 | 518 | } |
js::InlineList<js::jit::MUse>::end() const Line | Count | Source | 294 | 3.35k | iterator end() const { | 295 | 3.35k | return iterator(this); | 296 | 3.35k | } |
|
297 | 9.07k | reverse_iterator rbegin() const { |
298 | 9.07k | return reverse_iterator(this->prev); |
299 | 9.07k | } js::InlineList<js::jit::MInstruction>::rbegin() const Line | Count | Source | 297 | 8.75k | reverse_iterator rbegin() const { | 298 | 8.75k | return reverse_iterator(this->prev); | 299 | 8.75k | } |
js::InlineList<js::jit::LInstruction>::rbegin() const Line | Count | Source | 297 | 112 | reverse_iterator rbegin() const { | 298 | 112 | return reverse_iterator(this->prev); | 299 | 112 | } |
js::InlineList<js::jit::MBasicBlock>::rbegin() const Line | Count | Source | 297 | 210 | reverse_iterator rbegin() const { | 298 | 210 | return reverse_iterator(this->prev); | 299 | 210 | } |
|
300 | 336 | reverse_iterator rbegin(Node* t) const { |
301 | 336 | return reverse_iterator(t); |
302 | 336 | } js::InlineList<js::jit::BacktrackingAllocator::CallRange>::rbegin(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*) const Line | Count | Source | 300 | 182 | reverse_iterator rbegin(Node* t) const { | 301 | 182 | return reverse_iterator(t); | 302 | 182 | } |
js::InlineList<js::jit::MInstruction>::rbegin(js::InlineListNode<js::jit::MInstruction>*) const Line | Count | Source | 300 | 154 | reverse_iterator rbegin(Node* t) const { | 301 | 154 | return reverse_iterator(t); | 302 | 154 | } |
Unexecuted instantiation: js::InlineList<js::jit::MBasicBlock>::rbegin(js::InlineListNode<js::jit::MBasicBlock>*) const Unexecuted instantiation: js::InlineList<js::jit::LInstruction>::rbegin(js::InlineListNode<js::jit::LInstruction>*) const |
303 | 5.98k | reverse_iterator rend() const { |
304 | 5.98k | return reverse_iterator(this); |
305 | 5.98k | } js::InlineList<js::jit::LInstruction>::rend() const Line | Count | Source | 303 | 924 | reverse_iterator rend() const { | 304 | 924 | return reverse_iterator(this); | 305 | 924 | } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::rend() const Line | Count | Source | 303 | 392 | reverse_iterator rend() const { | 304 | 392 | return reverse_iterator(this); | 305 | 392 | } |
js::InlineList<js::jit::MInstruction>::rend() const Line | Count | Source | 303 | 3.66k | reverse_iterator rend() const { | 304 | 3.66k | return reverse_iterator(this); | 305 | 3.66k | } |
js::InlineList<js::jit::MBasicBlock>::rend() const Line | Count | Source | 303 | 1.00k | reverse_iterator rend() const { | 304 | 1.00k | return reverse_iterator(this); | 305 | 1.00k | } |
|
306 | 182 | void pushFront(Node* t) { |
307 | 182 | insertAfter(this, t); |
308 | 182 | } js::InlineList<js::jit::MUse>::pushFront(js::InlineListNode<js::jit::MUse>*) Line | Count | Source | 306 | 126 | void pushFront(Node* t) { | 307 | 126 | insertAfter(this, t); | 308 | 126 | } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::pushFront(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*) Line | Count | Source | 306 | 56 | void pushFront(Node* t) { | 307 | 56 | insertAfter(this, t); | 308 | 56 | } |
|
309 | 3.18k | void pushFrontUnchecked(Node* t) { |
310 | 3.18k | insertAfterUnchecked(this, t); |
311 | 3.18k | } |
312 | 6.17k | void pushBack(Node* t) { |
313 | 6.17k | insertBefore(this, t); |
314 | 6.17k | } js::InlineList<js::jit::MBasicBlock>::pushBack(js::InlineListNode<js::jit::MBasicBlock>*) Line | Count | Source | 312 | 84 | void pushBack(Node* t) { | 313 | 84 | insertBefore(this, t); | 314 | 84 | } |
Unexecuted instantiation: js::InlineList<js::jit::MPhi>::pushBack(js::InlineListNode<js::jit::MPhi>*) js::InlineList<js::jit::MInstruction>::pushBack(js::InlineListNode<js::jit::MInstruction>*) Line | Count | Source | 312 | 756 | void pushBack(Node* t) { | 313 | 756 | insertBefore(this, t); | 314 | 756 | } |
js::InlineList<js::jit::LInstruction>::pushBack(js::InlineListNode<js::jit::LInstruction>*) Line | Count | Source | 312 | 868 | void pushBack(Node* t) { | 313 | 868 | insertBefore(this, t); | 314 | 868 | } |
js::InlineList<js::jit::MoveResolver::PendingMove>::pushBack(js::InlineListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 312 | 4.46k | void pushBack(Node* t) { | 313 | 4.46k | insertBefore(this, t); | 314 | 4.46k | } |
|
315 | | void pushBackUnchecked(Node* t) { |
316 | | insertBeforeUnchecked(this, t); |
317 | | } |
318 | | T* popFront() { |
319 | | MOZ_ASSERT(!empty()); |
320 | | T* t = static_cast<T*>(this->next); |
321 | | remove(t); |
322 | | return t; |
323 | | } |
324 | 4.45k | T* popBack() { |
325 | 4.45k | MOZ_ASSERT(!empty()); |
326 | 4.45k | T* t = static_cast<T*>(this->prev); |
327 | 4.45k | remove(t); |
328 | 4.45k | return t; |
329 | 4.45k | } Unexecuted instantiation: js::InlineList<js::jit::MPhi>::popBack() js::InlineList<js::jit::MoveResolver::PendingMove>::popBack() Line | Count | Source | 324 | 4.45k | T* popBack() { | 325 | 4.45k | MOZ_ASSERT(!empty()); | 326 | 4.45k | T* t = static_cast<T*>(this->prev); | 327 | 4.45k | remove(t); | 328 | 4.45k | return t; | 329 | 4.45k | } |
|
330 | 2.23k | T* peekBack() const { |
331 | 2.23k | iterator iter = end(); |
332 | 2.23k | iter--; |
333 | 2.23k | return *iter; |
334 | 2.23k | } |
335 | 6.48k | void insertBefore(Node* at, Node* item) { |
336 | 6.48k | MOZ_ASSERT(item->prev == nullptr); |
337 | 6.48k | MOZ_ASSERT(item->next == nullptr); |
338 | 6.48k | insertBeforeUnchecked(at, item); |
339 | 6.48k | } js::InlineList<js::jit::MBasicBlock>::insertBefore(js::InlineListNode<js::jit::MBasicBlock>*, js::InlineListNode<js::jit::MBasicBlock>*) Line | Count | Source | 335 | 84 | void insertBefore(Node* at, Node* item) { | 336 | 84 | MOZ_ASSERT(item->prev == nullptr); | 337 | 84 | MOZ_ASSERT(item->next == nullptr); | 338 | 84 | insertBeforeUnchecked(at, item); | 339 | 84 | } |
Unexecuted instantiation: js::InlineList<js::jit::MPhi>::insertBefore(js::InlineListNode<js::jit::MPhi>*, js::InlineListNode<js::jit::MPhi>*) js::InlineList<js::jit::MInstruction>::insertBefore(js::InlineListNode<js::jit::MInstruction>*, js::InlineListNode<js::jit::MInstruction>*) Line | Count | Source | 335 | 905 | void insertBefore(Node* at, Node* item) { | 336 | 905 | MOZ_ASSERT(item->prev == nullptr); | 337 | 905 | MOZ_ASSERT(item->next == nullptr); | 338 | 905 | insertBeforeUnchecked(at, item); | 339 | 905 | } |
js::InlineList<js::jit::LInstruction>::insertBefore(js::InlineListNode<js::jit::LInstruction>*, js::InlineListNode<js::jit::LInstruction>*) Line | Count | Source | 335 | 1.03k | void insertBefore(Node* at, Node* item) { | 336 | 1.03k | MOZ_ASSERT(item->prev == nullptr); | 337 | 1.03k | MOZ_ASSERT(item->next == nullptr); | 338 | 1.03k | insertBeforeUnchecked(at, item); | 339 | 1.03k | } |
js::InlineList<js::jit::MoveResolver::PendingMove>::insertBefore(js::InlineListNode<js::jit::MoveResolver::PendingMove>*, js::InlineListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 335 | 4.46k | void insertBefore(Node* at, Node* item) { | 336 | 4.46k | MOZ_ASSERT(item->prev == nullptr); | 337 | 4.46k | MOZ_ASSERT(item->next == nullptr); | 338 | 4.46k | insertBeforeUnchecked(at, item); | 339 | 4.46k | } |
|
340 | 6.48k | void insertBeforeUnchecked(Node* at, Node* item) { |
341 | 6.48k | Node* atPrev = at->prev; |
342 | 6.48k | item->next = at; |
343 | 6.48k | item->prev = atPrev; |
344 | 6.48k | atPrev->next = item; |
345 | 6.48k | at->prev = item; |
346 | 6.48k | } js::InlineList<js::jit::MBasicBlock>::insertBeforeUnchecked(js::InlineListNode<js::jit::MBasicBlock>*, js::InlineListNode<js::jit::MBasicBlock>*) Line | Count | Source | 340 | 84 | void insertBeforeUnchecked(Node* at, Node* item) { | 341 | 84 | Node* atPrev = at->prev; | 342 | 84 | item->next = at; | 343 | 84 | item->prev = atPrev; | 344 | 84 | atPrev->next = item; | 345 | 84 | at->prev = item; | 346 | 84 | } |
Unexecuted instantiation: js::InlineList<js::jit::MPhi>::insertBeforeUnchecked(js::InlineListNode<js::jit::MPhi>*, js::InlineListNode<js::jit::MPhi>*) js::InlineList<js::jit::MInstruction>::insertBeforeUnchecked(js::InlineListNode<js::jit::MInstruction>*, js::InlineListNode<js::jit::MInstruction>*) Line | Count | Source | 340 | 905 | void insertBeforeUnchecked(Node* at, Node* item) { | 341 | 905 | Node* atPrev = at->prev; | 342 | 905 | item->next = at; | 343 | 905 | item->prev = atPrev; | 344 | 905 | atPrev->next = item; | 345 | 905 | at->prev = item; | 346 | 905 | } |
js::InlineList<js::jit::LInstruction>::insertBeforeUnchecked(js::InlineListNode<js::jit::LInstruction>*, js::InlineListNode<js::jit::LInstruction>*) Line | Count | Source | 340 | 1.03k | void insertBeforeUnchecked(Node* at, Node* item) { | 341 | 1.03k | Node* atPrev = at->prev; | 342 | 1.03k | item->next = at; | 343 | 1.03k | item->prev = atPrev; | 344 | 1.03k | atPrev->next = item; | 345 | 1.03k | at->prev = item; | 346 | 1.03k | } |
js::InlineList<js::jit::MoveResolver::PendingMove>::insertBeforeUnchecked(js::InlineListNode<js::jit::MoveResolver::PendingMove>*, js::InlineListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 340 | 4.46k | void insertBeforeUnchecked(Node* at, Node* item) { | 341 | 4.46k | Node* atPrev = at->prev; | 342 | 4.46k | item->next = at; | 343 | 4.46k | item->prev = atPrev; | 344 | 4.46k | atPrev->next = item; | 345 | 4.46k | at->prev = item; | 346 | 4.46k | } |
|
347 | 182 | void insertAfter(Node* at, Node* item) { |
348 | 182 | MOZ_ASSERT(item->prev == nullptr); |
349 | 182 | MOZ_ASSERT(item->next == nullptr); |
350 | 182 | insertAfterUnchecked(at, item); |
351 | 182 | } js::InlineList<js::jit::MUse>::insertAfter(js::InlineListNode<js::jit::MUse>*, js::InlineListNode<js::jit::MUse>*) Line | Count | Source | 347 | 126 | void insertAfter(Node* at, Node* item) { | 348 | 126 | MOZ_ASSERT(item->prev == nullptr); | 349 | 126 | MOZ_ASSERT(item->next == nullptr); | 350 | 126 | insertAfterUnchecked(at, item); | 351 | 126 | } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::insertAfter(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*, js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*) Line | Count | Source | 347 | 56 | void insertAfter(Node* at, Node* item) { | 348 | 56 | MOZ_ASSERT(item->prev == nullptr); | 349 | 56 | MOZ_ASSERT(item->next == nullptr); | 350 | 56 | insertAfterUnchecked(at, item); | 351 | 56 | } |
Unexecuted instantiation: js::InlineList<js::jit::LInstruction>::insertAfter(js::InlineListNode<js::jit::LInstruction>*, js::InlineListNode<js::jit::LInstruction>*) Unexecuted instantiation: js::InlineList<js::jit::MBasicBlock>::insertAfter(js::InlineListNode<js::jit::MBasicBlock>*, js::InlineListNode<js::jit::MBasicBlock>*) Unexecuted instantiation: js::InlineList<js::jit::MInstruction>::insertAfter(js::InlineListNode<js::jit::MInstruction>*, js::InlineListNode<js::jit::MInstruction>*) |
352 | 3.37k | void insertAfterUnchecked(Node* at, Node* item) { |
353 | 3.37k | Node* atNext = static_cast<Node*>(at->next); |
354 | 3.37k | item->next = atNext; |
355 | 3.37k | item->prev = at; |
356 | 3.37k | atNext->prev = item; |
357 | 3.37k | at->next = item; |
358 | 3.37k | } js::InlineList<js::jit::MUse>::insertAfterUnchecked(js::InlineListNode<js::jit::MUse>*, js::InlineListNode<js::jit::MUse>*) Line | Count | Source | 352 | 3.31k | void insertAfterUnchecked(Node* at, Node* item) { | 353 | 3.31k | Node* atNext = static_cast<Node*>(at->next); | 354 | 3.31k | item->next = atNext; | 355 | 3.31k | item->prev = at; | 356 | 3.31k | atNext->prev = item; | 357 | 3.31k | at->next = item; | 358 | 3.31k | } |
js::InlineList<js::jit::BacktrackingAllocator::CallRange>::insertAfterUnchecked(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*, js::InlineListNode<js::jit::BacktrackingAllocator::CallRange>*) Line | Count | Source | 352 | 56 | void insertAfterUnchecked(Node* at, Node* item) { | 353 | 56 | Node* atNext = static_cast<Node*>(at->next); | 354 | 56 | item->next = atNext; | 355 | 56 | item->prev = at; | 356 | 56 | atNext->prev = item; | 357 | 56 | at->next = item; | 358 | 56 | } |
Unexecuted instantiation: js::InlineList<js::jit::LInstruction>::insertAfterUnchecked(js::InlineListNode<js::jit::LInstruction>*, js::InlineListNode<js::jit::LInstruction>*) Unexecuted instantiation: js::InlineList<js::jit::MBasicBlock>::insertAfterUnchecked(js::InlineListNode<js::jit::MBasicBlock>*, js::InlineListNode<js::jit::MBasicBlock>*) Unexecuted instantiation: js::InlineList<js::jit::MInstruction>::insertAfterUnchecked(js::InlineListNode<js::jit::MInstruction>*, js::InlineListNode<js::jit::MInstruction>*) |
359 | 5.13k | void remove(Node* t) { |
360 | 5.13k | Node* tNext = static_cast<Node*>(t->next); |
361 | 5.13k | Node* tPrev = t->prev; |
362 | 5.13k | tPrev->next = tNext; |
363 | 5.13k | tNext->prev = tPrev; |
364 | 5.13k | t->next = nullptr; |
365 | 5.13k | t->prev = nullptr; |
366 | 5.13k | } js::InlineList<js::jit::MUse>::remove(js::InlineListNode<js::jit::MUse>*) Line | Count | Source | 359 | 532 | void remove(Node* t) { | 360 | 532 | Node* tNext = static_cast<Node*>(t->next); | 361 | 532 | Node* tPrev = t->prev; | 362 | 532 | tPrev->next = tNext; | 363 | 532 | tNext->prev = tPrev; | 364 | 532 | t->next = nullptr; | 365 | 532 | t->prev = nullptr; | 366 | 532 | } |
js::InlineList<js::jit::MBasicBlock>::remove(js::InlineListNode<js::jit::MBasicBlock>*) Line | Count | Source | 359 | 28 | void remove(Node* t) { | 360 | 28 | Node* tNext = static_cast<Node*>(t->next); | 361 | 28 | Node* tPrev = t->prev; | 362 | 28 | tPrev->next = tNext; | 363 | 28 | tNext->prev = tPrev; | 364 | 28 | t->next = nullptr; | 365 | 28 | t->prev = nullptr; | 366 | 28 | } |
Unexecuted instantiation: js::InlineList<js::jit::MPhi>::remove(js::InlineListNode<js::jit::MPhi>*) js::InlineList<js::jit::MInstruction>::remove(js::InlineListNode<js::jit::MInstruction>*) Line | Count | Source | 359 | 107 | void remove(Node* t) { | 360 | 107 | Node* tNext = static_cast<Node*>(t->next); | 361 | 107 | Node* tPrev = t->prev; | 362 | 107 | tPrev->next = tNext; | 363 | 107 | tNext->prev = tPrev; | 364 | 107 | t->next = nullptr; | 365 | 107 | t->prev = nullptr; | 366 | 107 | } |
js::InlineList<js::jit::MoveResolver::PendingMove>::remove(js::InlineListNode<js::jit::MoveResolver::PendingMove>*) Line | Count | Source | 359 | 4.46k | void remove(Node* t) { | 360 | 4.46k | Node* tNext = static_cast<Node*>(t->next); | 361 | 4.46k | Node* tPrev = t->prev; | 362 | 4.46k | tPrev->next = tNext; | 363 | 4.46k | tNext->prev = tPrev; | 364 | 4.46k | t->next = nullptr; | 365 | 4.46k | t->prev = nullptr; | 366 | 4.46k | } |
|
367 | | // Remove |old| from the list and insert |now| in its place. |
368 | 0 | void replace(Node* old, Node* now) { |
369 | 0 | MOZ_ASSERT(now->next == nullptr && now->prev == nullptr); |
370 | 0 | Node* listNext = static_cast<Node*>(old->next); |
371 | 0 | Node* listPrev = old->prev; |
372 | 0 | listPrev->next = now; |
373 | 0 | listNext->prev = now; |
374 | 0 | now->next = listNext; |
375 | 0 | now->prev = listPrev; |
376 | 0 | old->next = nullptr; |
377 | 0 | old->prev = nullptr; |
378 | 0 | } |
379 | 985 | void clear() { |
380 | 985 | this->next = this->prev = this; |
381 | 985 | } js::InlineList<js::jit::MUse>::clear() Line | Count | Source | 379 | 28 | void clear() { | 380 | 28 | this->next = this->prev = this; | 381 | 28 | } |
Unexecuted instantiation: js::InlineList<js::jit::MPhi>::clear() js::InlineList<js::jit::MoveResolver::PendingMove>::clear() Line | Count | Source | 379 | 957 | void clear() { | 380 | 957 | this->next = this->prev = this; | 381 | 957 | } |
|
382 | 9.34k | bool empty() const { |
383 | 9.34k | return begin() == end(); |
384 | 9.34k | } js::InlineList<js::jit::MoveResolver::PendingMove>::empty() const Line | Count | Source | 382 | 7.64k | bool empty() const { | 383 | 7.64k | return begin() == end(); | 384 | 7.64k | } |
js::InlineList<js::jit::MUse>::empty() const Line | Count | Source | 382 | 1.59k | bool empty() const { | 383 | 1.59k | return begin() == end(); | 384 | 1.59k | } |
Unexecuted instantiation: js::InlineList<js::jit::MInstruction>::empty() const js::InlineList<js::jit::MPhi>::empty() const Line | Count | Source | 382 | 98 | bool empty() const { | 383 | 98 | return begin() == end(); | 384 | 98 | } |
|
385 | 28 | void takeElements(InlineList& l) { |
386 | 28 | MOZ_ASSERT(&l != this, "cannot takeElements from this"); |
387 | 28 | Node* lprev = l.prev; |
388 | 28 | static_cast<Node*>(l.next)->prev = this; |
389 | 28 | lprev->next = this->next; |
390 | 28 | static_cast<Node*>(this->next)->prev = l.prev; |
391 | 28 | this->next = l.next; |
392 | 28 | l.clear(); |
393 | 28 | } |
394 | | }; |
395 | | |
396 | | template <typename T> |
397 | | class InlineListIterator |
398 | | { |
399 | | private: |
400 | | friend class InlineList<T>; |
401 | | |
402 | | typedef InlineListNode<T> Node; |
403 | | |
404 | | explicit InlineListIterator(const Node* iter) |
405 | | : iter(const_cast<Node*>(iter)) |
406 | 66.0k | { } js::InlineListIterator<js::jit::MBasicBlock>::InlineListIterator(js::InlineListNode<js::jit::MBasicBlock> const*) Line | Count | Source | 406 | 2.40k | { } |
js::InlineListIterator<js::jit::MInstruction>::InlineListIterator(js::InlineListNode<js::jit::MInstruction> const*) Line | Count | Source | 406 | 8.71k | { } |
js::InlineListIterator<js::jit::MPhi>::InlineListIterator(js::InlineListNode<js::jit::MPhi> const*) Line | Count | Source | 406 | 20.8k | { } |
js::InlineListIterator<js::jit::LInstruction>::InlineListIterator(js::InlineListNode<js::jit::LInstruction> const*) Line | Count | Source | 406 | 3.35k | { } |
js::InlineListIterator<js::jit::BacktrackingAllocator::CallRange>::InlineListIterator(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange> const*) Line | Count | Source | 406 | 700 | { } |
js::InlineListIterator<js::jit::MUse>::InlineListIterator(js::InlineListNode<js::jit::MUse> const*) Line | Count | Source | 406 | 5.63k | { } |
js::InlineListIterator<js::jit::MoveResolver::PendingMove>::InlineListIterator(js::InlineListNode<js::jit::MoveResolver::PendingMove> const*) Line | Count | Source | 406 | 24.3k | { } |
|
407 | | |
408 | | public: |
409 | 22.1k | InlineListIterator<T> & operator ++() { |
410 | 22.1k | iter = static_cast<Node*>(iter->next); |
411 | 22.1k | return *this; |
412 | 22.1k | } Unexecuted instantiation: js::InlineListIterator<js::jit::MPhi>::operator++() js::InlineListIterator<js::jit::MInstruction>::operator++() Line | Count | Source | 409 | 14.1k | InlineListIterator<T> & operator ++() { | 410 | 14.1k | iter = static_cast<Node*>(iter->next); | 411 | 14.1k | return *this; | 412 | 14.1k | } |
js::InlineListIterator<js::jit::MBasicBlock>::operator++() Line | Count | Source | 409 | 1.59k | InlineListIterator<T> & operator ++() { | 410 | 1.59k | iter = static_cast<Node*>(iter->next); | 411 | 1.59k | return *this; | 412 | 1.59k | } |
js::InlineListIterator<js::jit::LInstruction>::operator++() Line | Count | Source | 409 | 2.76k | InlineListIterator<T> & operator ++() { | 410 | 2.76k | iter = static_cast<Node*>(iter->next); | 411 | 2.76k | return *this; | 412 | 2.76k | } |
js::InlineListIterator<js::jit::BacktrackingAllocator::CallRange>::operator++() Line | Count | Source | 409 | 336 | InlineListIterator<T> & operator ++() { | 410 | 336 | iter = static_cast<Node*>(iter->next); | 411 | 336 | return *this; | 412 | 336 | } |
js::InlineListIterator<js::jit::MUse>::operator++() Line | Count | Source | 409 | 858 | InlineListIterator<T> & operator ++() { | 410 | 858 | iter = static_cast<Node*>(iter->next); | 411 | 858 | return *this; | 412 | 858 | } |
js::InlineListIterator<js::jit::MoveResolver::PendingMove>::operator++() Line | Count | Source | 409 | 2.37k | InlineListIterator<T> & operator ++() { | 410 | 2.37k | iter = static_cast<Node*>(iter->next); | 411 | 2.37k | return *this; | 412 | 2.37k | } |
|
413 | 15.1k | InlineListIterator<T> operator ++(int) { |
414 | 15.1k | InlineListIterator<T> old(*this); |
415 | 15.1k | operator++(); |
416 | 15.1k | return old; |
417 | 15.1k | } js::InlineListIterator<js::jit::MBasicBlock>::operator++(int) Line | Count | Source | 413 | 1.47k | InlineListIterator<T> operator ++(int) { | 414 | 1.47k | InlineListIterator<T> old(*this); | 415 | 1.47k | operator++(); | 416 | 1.47k | return old; | 417 | 1.47k | } |
js::InlineListIterator<js::jit::MInstruction>::operator++(int) Line | Count | Source | 413 | 8.22k | InlineListIterator<T> operator ++(int) { | 414 | 8.22k | InlineListIterator<T> old(*this); | 415 | 8.22k | operator++(); | 416 | 8.22k | return old; | 417 | 8.22k | } |
js::InlineListIterator<js::jit::LInstruction>::operator++(int) Line | Count | Source | 413 | 2.76k | InlineListIterator<T> operator ++(int) { | 414 | 2.76k | InlineListIterator<T> old(*this); | 415 | 2.76k | operator++(); | 416 | 2.76k | return old; | 417 | 2.76k | } |
js::InlineListIterator<js::jit::MUse>::operator++(int) Line | Count | Source | 413 | 328 | InlineListIterator<T> operator ++(int) { | 414 | 328 | InlineListIterator<T> old(*this); | 415 | 328 | operator++(); | 416 | 328 | return old; | 417 | 328 | } |
Unexecuted instantiation: js::InlineListIterator<js::jit::MPhi>::operator++(int) js::InlineListIterator<js::jit::MoveResolver::PendingMove>::operator++(int) Line | Count | Source | 413 | 2.37k | InlineListIterator<T> operator ++(int) { | 414 | 2.37k | InlineListIterator<T> old(*this); | 415 | 2.37k | operator++(); | 416 | 2.37k | return old; | 417 | 2.37k | } |
|
418 | 2.23k | InlineListIterator<T> & operator --() { |
419 | 2.23k | iter = iter->prev; |
420 | 2.23k | return *this; |
421 | 2.23k | } |
422 | 2.23k | InlineListIterator<T> operator --(int) { |
423 | 2.23k | InlineListIterator<T> old(*this); |
424 | 2.23k | operator--(); |
425 | 2.23k | return old; |
426 | 2.23k | } |
427 | 30.4k | T * operator*() const { |
428 | 30.4k | return static_cast<T*>(iter); |
429 | 30.4k | } js::InlineListIterator<js::jit::MBasicBlock>::operator*() const Line | Count | Source | 427 | 1.60k | T * operator*() const { | 428 | 1.60k | return static_cast<T*>(iter); | 429 | 1.60k | } |
js::InlineListIterator<js::jit::MInstruction>::operator*() const Line | Count | Source | 427 | 21.3k | T * operator*() const { | 428 | 21.3k | return static_cast<T*>(iter); | 429 | 21.3k | } |
js::InlineListIterator<js::jit::LInstruction>::operator*() const Line | Count | Source | 427 | 2.73k | T * operator*() const { | 428 | 2.73k | return static_cast<T*>(iter); | 429 | 2.73k | } |
js::InlineListIterator<js::jit::MUse>::operator*() const Line | Count | Source | 427 | 150 | T * operator*() const { | 428 | 150 | return static_cast<T*>(iter); | 429 | 150 | } |
Unexecuted instantiation: js::InlineListIterator<js::jit::MPhi>::operator*() const js::InlineListIterator<js::jit::MoveResolver::PendingMove>::operator*() const Line | Count | Source | 427 | 4.62k | T * operator*() const { | 428 | 4.62k | return static_cast<T*>(iter); | 429 | 4.62k | } |
|
430 | 34.1k | T * operator ->() const { |
431 | 34.1k | return static_cast<T*>(iter); |
432 | 34.1k | } js::InlineListIterator<js::jit::MBasicBlock>::operator->() const Line | Count | Source | 430 | 6.15k | T * operator ->() const { | 431 | 6.15k | return static_cast<T*>(iter); | 432 | 6.15k | } |
Unexecuted instantiation: js::InlineListIterator<js::jit::MPhi>::operator->() const js::InlineListIterator<js::jit::MInstruction>::operator->() const Line | Count | Source | 430 | 15.5k | T * operator ->() const { | 431 | 15.5k | return static_cast<T*>(iter); | 432 | 15.5k | } |
js::InlineListIterator<js::jit::LInstruction>::operator->() const Line | Count | Source | 430 | 10.8k | T * operator ->() const { | 431 | 10.8k | return static_cast<T*>(iter); | 432 | 10.8k | } |
js::InlineListIterator<js::jit::BacktrackingAllocator::CallRange>::operator->() const Line | Count | Source | 430 | 434 | T * operator ->() const { | 431 | 434 | return static_cast<T*>(iter); | 432 | 434 | } |
js::InlineListIterator<js::jit::MUse>::operator->() const Line | Count | Source | 430 | 1.08k | T * operator ->() const { | 431 | 1.08k | return static_cast<T*>(iter); | 432 | 1.08k | } |
|
433 | 40.2k | bool operator !=(const InlineListIterator<T>& where) const { |
434 | 40.2k | return iter != where.iter; |
435 | 40.2k | } js::InlineListIterator<js::jit::MPhi>::operator!=(js::InlineListIterator<js::jit::MPhi> const&) const Line | Count | Source | 433 | 19.4k | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 19.4k | return iter != where.iter; | 435 | 19.4k | } |
js::InlineListIterator<js::jit::MBasicBlock>::operator!=(js::InlineListIterator<js::jit::MBasicBlock> const&) const Line | Count | Source | 433 | 1.89k | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 1.89k | return iter != where.iter; | 435 | 1.89k | } |
js::InlineListIterator<js::jit::MInstruction>::operator!=(js::InlineListIterator<js::jit::MInstruction> const&) const Line | Count | Source | 433 | 8.86k | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 8.86k | return iter != where.iter; | 435 | 8.86k | } |
js::InlineListIterator<js::jit::LInstruction>::operator!=(js::InlineListIterator<js::jit::LInstruction> const&) const Line | Count | Source | 433 | 2.99k | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 2.99k | return iter != where.iter; | 435 | 2.99k | } |
js::InlineListIterator<js::jit::BacktrackingAllocator::CallRange>::operator!=(js::InlineListIterator<js::jit::BacktrackingAllocator::CallRange> const&) const Line | Count | Source | 433 | 518 | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 518 | return iter != where.iter; | 435 | 518 | } |
js::InlineListIterator<js::jit::MUse>::operator!=(js::InlineListIterator<js::jit::MUse> const&) const Line | Count | Source | 433 | 1.89k | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 1.89k | return iter != where.iter; | 435 | 1.89k | } |
js::InlineListIterator<js::jit::MoveResolver::PendingMove>::operator!=(js::InlineListIterator<js::jit::MoveResolver::PendingMove> const&) const Line | Count | Source | 433 | 4.62k | bool operator !=(const InlineListIterator<T>& where) const { | 434 | 4.62k | return iter != where.iter; | 435 | 4.62k | } |
|
436 | 9.38k | bool operator ==(const InlineListIterator<T>& where) const { |
437 | 9.38k | return iter == where.iter; |
438 | 9.38k | } js::InlineListIterator<js::jit::MoveResolver::PendingMove>::operator==(js::InlineListIterator<js::jit::MoveResolver::PendingMove> const&) const Line | Count | Source | 436 | 7.64k | bool operator ==(const InlineListIterator<T>& where) const { | 437 | 7.64k | return iter == where.iter; | 438 | 7.64k | } |
js::InlineListIterator<js::jit::MUse>::operator==(js::InlineListIterator<js::jit::MUse> const&) const Line | Count | Source | 436 | 1.61k | bool operator ==(const InlineListIterator<T>& where) const { | 437 | 1.61k | return iter == where.iter; | 438 | 1.61k | } |
js::InlineListIterator<js::jit::MInstruction>::operator==(js::InlineListIterator<js::jit::MInstruction> const&) const Line | Count | Source | 436 | 28 | bool operator ==(const InlineListIterator<T>& where) const { | 437 | 28 | return iter == where.iter; | 438 | 28 | } |
js::InlineListIterator<js::jit::MPhi>::operator==(js::InlineListIterator<js::jit::MPhi> const&) const Line | Count | Source | 436 | 98 | bool operator ==(const InlineListIterator<T>& where) const { | 437 | 98 | return iter == where.iter; | 438 | 98 | } |
|
439 | | |
440 | | private: |
441 | | Node* iter; |
442 | | }; |
443 | | |
444 | | template <typename T> |
445 | | class InlineListReverseIterator |
446 | | { |
447 | | private: |
448 | | friend class InlineList<T>; |
449 | | |
450 | | typedef InlineListNode<T> Node; |
451 | | |
452 | | explicit InlineListReverseIterator(const Node* iter) |
453 | | : iter(const_cast<Node*>(iter)) |
454 | 15.3k | { } js::InlineListReverseIterator<js::jit::MInstruction>::InlineListReverseIterator(js::InlineListNode<js::jit::MInstruction> const*) Line | Count | Source | 454 | 12.5k | { } |
js::InlineListReverseIterator<js::jit::LInstruction>::InlineListReverseIterator(js::InlineListNode<js::jit::LInstruction> const*) Line | Count | Source | 454 | 1.03k | { } |
js::InlineListReverseIterator<js::jit::BacktrackingAllocator::CallRange>::InlineListReverseIterator(js::InlineListNode<js::jit::BacktrackingAllocator::CallRange> const*) Line | Count | Source | 454 | 574 | { } |
js::InlineListReverseIterator<js::jit::MBasicBlock>::InlineListReverseIterator(js::InlineListNode<js::jit::MBasicBlock> const*) Line | Count | Source | 454 | 1.21k | { } |
|
455 | | |
456 | | public: |
457 | 5.25k | InlineListReverseIterator<T> & operator ++() { |
458 | 5.25k | iter = iter->prev; |
459 | 5.25k | return *this; |
460 | 5.25k | } js::InlineListReverseIterator<js::jit::LInstruction>::operator++() Line | Count | Source | 457 | 868 | InlineListReverseIterator<T> & operator ++() { | 458 | 868 | iter = iter->prev; | 459 | 868 | return *this; | 460 | 868 | } |
js::InlineListReverseIterator<js::jit::BacktrackingAllocator::CallRange>::operator++() Line | Count | Source | 457 | 210 | InlineListReverseIterator<T> & operator ++() { | 458 | 210 | iter = iter->prev; | 459 | 210 | return *this; | 460 | 210 | } |
js::InlineListReverseIterator<js::jit::MInstruction>::operator++() Line | Count | Source | 457 | 3.36k | InlineListReverseIterator<T> & operator ++() { | 458 | 3.36k | iter = iter->prev; | 459 | 3.36k | return *this; | 460 | 3.36k | } |
js::InlineListReverseIterator<js::jit::MBasicBlock>::operator++() Line | Count | Source | 457 | 812 | InlineListReverseIterator<T> & operator ++() { | 458 | 812 | iter = iter->prev; | 459 | 812 | return *this; | 460 | 812 | } |
|
461 | 5.00k | InlineListReverseIterator<T> operator ++(int) { |
462 | 5.00k | InlineListReverseIterator<T> old(*this); |
463 | 5.00k | operator++(); |
464 | 5.00k | return old; |
465 | 5.00k | } js::InlineListReverseIterator<js::jit::LInstruction>::operator++(int) Line | Count | Source | 461 | 868 | InlineListReverseIterator<T> operator ++(int) { | 462 | 868 | InlineListReverseIterator<T> old(*this); | 463 | 868 | operator++(); | 464 | 868 | return old; | 465 | 868 | } |
js::InlineListReverseIterator<js::jit::MBasicBlock>::operator++(int) Line | Count | Source | 461 | 812 | InlineListReverseIterator<T> operator ++(int) { | 462 | 812 | InlineListReverseIterator<T> old(*this); | 463 | 812 | operator++(); | 464 | 812 | return old; | 465 | 812 | } |
js::InlineListReverseIterator<js::jit::MInstruction>::operator++(int) Line | Count | Source | 461 | 3.32k | InlineListReverseIterator<T> operator ++(int) { | 462 | 3.32k | InlineListReverseIterator<T> old(*this); | 463 | 3.32k | operator++(); | 464 | 3.32k | return old; | 465 | 3.32k | } |
|
466 | 0 | InlineListReverseIterator<T> & operator --() { |
467 | 0 | iter = static_cast<Node*>(iter->next); |
468 | 0 | return *this; |
469 | 0 | } |
470 | | InlineListReverseIterator<T> operator --(int) { |
471 | | InlineListReverseIterator<T> old(*this); |
472 | | operator--(); |
473 | | return old; |
474 | | } |
475 | 14.7k | T * operator*() { |
476 | 14.7k | return static_cast<T*>(iter); |
477 | 14.7k | } js::InlineListReverseIterator<js::jit::LInstruction>::operator*() Line | Count | Source | 475 | 11.7k | T * operator*() { | 476 | 11.7k | return static_cast<T*>(iter); | 477 | 11.7k | } |
js::InlineListReverseIterator<js::jit::BacktrackingAllocator::CallRange>::operator*() Line | Count | Source | 475 | 210 | T * operator*() { | 476 | 210 | return static_cast<T*>(iter); | 477 | 210 | } |
js::InlineListReverseIterator<js::jit::MBasicBlock>::operator*() Line | Count | Source | 475 | 500 | T * operator*() { | 476 | 500 | return static_cast<T*>(iter); | 477 | 500 | } |
js::InlineListReverseIterator<js::jit::MInstruction>::operator*() Line | Count | Source | 475 | 2.31k | T * operator*() { | 476 | 2.31k | return static_cast<T*>(iter); | 477 | 2.31k | } |
|
478 | 39.4k | T * operator ->() { |
479 | 39.4k | return static_cast<T*>(iter); |
480 | 39.4k | } js::InlineListReverseIterator<js::jit::MInstruction>::operator->() Line | Count | Source | 478 | 11.9k | T * operator ->() { | 479 | 11.9k | return static_cast<T*>(iter); | 480 | 11.9k | } |
js::InlineListReverseIterator<js::jit::LInstruction>::operator->() Line | Count | Source | 478 | 21.0k | T * operator ->() { | 479 | 21.0k | return static_cast<T*>(iter); | 480 | 21.0k | } |
js::InlineListReverseIterator<js::jit::BacktrackingAllocator::CallRange>::operator->() Line | Count | Source | 478 | 322 | T * operator ->() { | 479 | 322 | return static_cast<T*>(iter); | 480 | 322 | } |
js::InlineListReverseIterator<js::jit::MBasicBlock>::operator->() Line | Count | Source | 478 | 6.04k | T * operator ->() { | 479 | 6.04k | return static_cast<T*>(iter); | 480 | 6.04k | } |
|
481 | 5.98k | bool operator !=(const InlineListReverseIterator<T>& where) const { |
482 | 5.98k | return iter != where.iter; |
483 | 5.98k | } js::InlineListReverseIterator<js::jit::LInstruction>::operator!=(js::InlineListReverseIterator<js::jit::LInstruction> const&) const Line | Count | Source | 481 | 924 | bool operator !=(const InlineListReverseIterator<T>& where) const { | 482 | 924 | return iter != where.iter; | 483 | 924 | } |
js::InlineListReverseIterator<js::jit::BacktrackingAllocator::CallRange>::operator!=(js::InlineListReverseIterator<js::jit::BacktrackingAllocator::CallRange> const&) const Line | Count | Source | 481 | 392 | bool operator !=(const InlineListReverseIterator<T>& where) const { | 482 | 392 | return iter != where.iter; | 483 | 392 | } |
js::InlineListReverseIterator<js::jit::MBasicBlock>::operator!=(js::InlineListReverseIterator<js::jit::MBasicBlock> const&) const Line | Count | Source | 481 | 1.00k | bool operator !=(const InlineListReverseIterator<T>& where) const { | 482 | 1.00k | return iter != where.iter; | 483 | 1.00k | } |
js::InlineListReverseIterator<js::jit::MInstruction>::operator!=(js::InlineListReverseIterator<js::jit::MInstruction> const&) const Line | Count | Source | 481 | 3.66k | bool operator !=(const InlineListReverseIterator<T>& where) const { | 482 | 3.66k | return iter != where.iter; | 483 | 3.66k | } |
|
484 | 0 | bool operator ==(const InlineListReverseIterator<T>& where) const { |
485 | 0 | return iter == where.iter; |
486 | 0 | } |
487 | | |
488 | | private: |
489 | | Node* iter; |
490 | | }; |
491 | | |
492 | | /* This list type is more or less exactly an InlineForwardList without a sentinel |
493 | | * node. It is useful in cases where you are doing algorithms that deal with many |
494 | | * merging singleton lists, rather than often empty ones. |
495 | | */ |
496 | | template <typename T> class InlineConcatListIterator; |
497 | | template <typename T> |
498 | | class InlineConcatList |
499 | | { |
500 | | private: |
501 | | typedef InlineConcatList<T> Node; |
502 | | |
503 | | InlineConcatList<T>* thisFromConstructor() { |
504 | | return this; |
505 | | } |
506 | | |
507 | | public: |
508 | | InlineConcatList() : next(nullptr), tail(thisFromConstructor()) |
509 | | { } |
510 | | |
511 | | typedef InlineConcatListIterator<T> iterator; |
512 | | |
513 | | iterator begin() const { |
514 | | return iterator(this); |
515 | | } |
516 | | |
517 | | iterator end() const { |
518 | | return iterator(nullptr); |
519 | | } |
520 | | |
521 | | void append(InlineConcatList<T>* adding) |
522 | | { |
523 | | MOZ_ASSERT(tail); |
524 | | MOZ_ASSERT(!tail->next); |
525 | | MOZ_ASSERT(adding->tail); |
526 | | MOZ_ASSERT(!adding->tail->next); |
527 | | |
528 | | tail->next = adding; |
529 | | tail = adding->tail; |
530 | | adding->tail = nullptr; |
531 | | } |
532 | | |
533 | | protected: |
534 | | friend class InlineConcatListIterator<T>; |
535 | | Node* next; |
536 | | Node* tail; |
537 | | }; |
538 | | |
539 | | template <typename T> |
540 | | class InlineConcatListIterator |
541 | | { |
542 | | private: |
543 | | friend class InlineConcatList<T>; |
544 | | |
545 | | typedef InlineConcatList<T> Node; |
546 | | |
547 | | explicit InlineConcatListIterator(const Node* iter) |
548 | | : iter(const_cast<Node*>(iter)) |
549 | | { } |
550 | | |
551 | | public: |
552 | | InlineConcatListIterator<T> & operator ++() { |
553 | | iter = static_cast<Node*>(iter->next); |
554 | | return *this; |
555 | | } |
556 | | InlineConcatListIterator<T> operator ++(int) { |
557 | | InlineConcatListIterator<T> old(*this); |
558 | | operator++(); |
559 | | return old; |
560 | | } |
561 | | T * operator*() const { |
562 | | return static_cast<T*>(iter); |
563 | | } |
564 | | T * operator ->() const { |
565 | | return static_cast<T*>(iter); |
566 | | } |
567 | | bool operator !=(const InlineConcatListIterator<T>& where) const { |
568 | | return iter != where.iter; |
569 | | } |
570 | | bool operator ==(const InlineConcatListIterator<T>& where) const { |
571 | | return iter == where.iter; |
572 | | } |
573 | | |
574 | | private: |
575 | | Node* iter; |
576 | | }; |
577 | | |
578 | | template <typename T> class InlineSpaghettiStack; |
579 | | template <typename T> class InlineSpaghettiStackNode; |
580 | | template <typename T> class InlineSpaghettiStackIterator; |
581 | | |
582 | | template <typename T> |
583 | | class InlineSpaghettiStackNode : public InlineForwardListNode<T> |
584 | | { |
585 | | typedef InlineForwardListNode<T> Parent; |
586 | | |
587 | | public: |
588 | | InlineSpaghettiStackNode() : Parent() |
589 | 301 | { } |
590 | | |
591 | | explicit InlineSpaghettiStackNode(InlineSpaghettiStackNode<T>* n) |
592 | | : Parent(n) |
593 | | { } |
594 | | |
595 | | InlineSpaghettiStackNode(const InlineSpaghettiStackNode<T>&) = delete; |
596 | | |
597 | | protected: |
598 | | friend class InlineSpaghettiStack<T>; |
599 | | friend class InlineSpaghettiStackIterator<T>; |
600 | | }; |
601 | | |
602 | | template <typename T> |
603 | | class InlineSpaghettiStack : protected InlineSpaghettiStackNode<T> |
604 | | { |
605 | | friend class InlineSpaghettiStackIterator<T>; |
606 | | |
607 | | typedef InlineSpaghettiStackNode<T> Node; |
608 | | |
609 | | public: |
610 | | InlineSpaghettiStack() |
611 | 301 | { } |
612 | | |
613 | | public: |
614 | | typedef InlineSpaghettiStackIterator<T> iterator; |
615 | | |
616 | | public: |
617 | 175 | iterator begin() const { |
618 | 175 | return iterator(this); |
619 | 175 | } |
620 | 175 | iterator end() const { |
621 | 175 | return iterator(nullptr); |
622 | 175 | } |
623 | | |
624 | 0 | void push(Node* t) { |
625 | 0 | MOZ_ASSERT(t->next == nullptr); |
626 | 0 | t->next = this->next; |
627 | 0 | this->next = t; |
628 | 0 | } |
629 | | |
630 | 0 | void copy(const InlineSpaghettiStack<T>& stack) { |
631 | 0 | this->next = stack.next; |
632 | 0 | } |
633 | | |
634 | | bool empty() const { |
635 | | return this->next == nullptr; |
636 | | } |
637 | | }; |
638 | | |
639 | | template <typename T> |
640 | | class InlineSpaghettiStackIterator |
641 | | { |
642 | | private: |
643 | | friend class InlineSpaghettiStack<T>; |
644 | | |
645 | | typedef InlineSpaghettiStackNode<T> Node; |
646 | | |
647 | | explicit InlineSpaghettiStackIterator<T>(const InlineSpaghettiStack<T>* owner) |
648 | | : iter(owner ? static_cast<Node*>(owner->next) : nullptr) |
649 | 350 | { } |
650 | | |
651 | | public: |
652 | 0 | InlineSpaghettiStackIterator<T> & operator ++() { |
653 | 0 | iter = static_cast<Node*>(iter->next); |
654 | 0 | return *this; |
655 | 0 | } |
656 | | InlineSpaghettiStackIterator<T> operator ++(int) { |
657 | | InlineSpaghettiStackIterator<T> old(*this); |
658 | | operator++(); |
659 | | return old; |
660 | | } |
661 | | T* operator*() const { |
662 | | return static_cast<T*>(iter); |
663 | | } |
664 | 0 | T* operator ->() const { |
665 | 0 | return static_cast<T*>(iter); |
666 | 0 | } |
667 | 175 | bool operator !=(const InlineSpaghettiStackIterator<T>& where) const { |
668 | 175 | return iter != where.iter; |
669 | 175 | } |
670 | 0 | bool operator ==(const InlineSpaghettiStackIterator<T>& where) const { |
671 | 0 | return iter == where.iter; |
672 | 0 | } |
673 | | |
674 | | private: |
675 | | Node* iter; |
676 | | }; |
677 | | |
678 | | } // namespace js |
679 | | |
680 | | #endif /* jit_InlineList_h */ |