| 1 | /* |
| 2 | * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 | * Copyright (C) 2008 David Levin <[email protected]> |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Library General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Library General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Library General Public License |
| 16 | * along with this library; see the file COPYING.LIB. If not, write to |
| 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | * Boston, MA 02110-1301, USA. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #ifndef WTF_HashTable_h |
| 23 | #define WTF_HashTable_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:23:9`! |
| 24 | |
| 25 | #include "FastMalloc.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h`/ |
| 26 | #include "HashTraits.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTraits.h`/ |
| 27 | #include <wtf/Assertions.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h`/ |
| 28 | #include <wtf/Threading.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h`/ |
| 29 | |
| 30 | namespace WTFcxx . . $ `<built-in>:467:9`! { |
| 31 | |
| 32 | #define DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! 0 |
| 33 | #define CHECK_HASHTABLE_CONSISTENCYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:33:9`! 0 |
| 34 | |
| 35 | #ifdef NDEBUGcxx . . $ `<built-in>:472:9`! |
| 36 | #define CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! 0 |
| 37 | #define CHECK_HASHTABLE_USE_AFTER_DESTRUCTIONcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:37:9`! 0 |
| 38 | #else |
| 39 | #define CHECK_HASHTABLE_ITERATORS 1 |
| 40 | #define CHECK_HASHTABLE_USE_AFTER_DESTRUCTION 1 |
| 41 | #endif |
| 42 | |
| 43 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 44 | |
| 45 | struct HashTableStats { |
| 46 | ~HashTableStats(); |
| 47 | // All of the variables are accessed in ~HashTableStats when the static struct is destroyed. |
| 48 | |
| 49 | // The following variables are all atomically incremented when modified. |
| 50 | static int numAccesses; |
| 51 | static int numRehashes; |
| 52 | static int numRemoves; |
| 53 | static int numReinserts; |
| 54 | |
| 55 | // The following variables are only modified in the recordCollisionAtCount method within a mutex. |
| 56 | static int maxCollisions; |
| 57 | static int numCollisions; |
| 58 | static int collisionGraph[4096]; |
| 59 | |
| 60 | static void recordCollisionAtCount(int count); |
| 61 | }; |
| 62 | |
| 63 | #endif |
| 64 | |
| 65 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 66 | class HashTablecxx . . $ QTWTF/HashTable#; |
| 67 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 68 | class HashTableIteratorcxx . . $ QTWTF/HashTableIterator#; |
| 69 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 70 | class HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#; |
| 71 | |
| 72 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 73 | void addIteratorcxx . . $ QTWTF/addIterator(5aa27e242096454a).(const HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>*, |
| 74 | HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>*); |
| 75 | |
| 76 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 77 | void removeIteratorcxx . . $ QTWTF/removeIterator(5adb451054871b49).(HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>*); |
| 78 | |
| 79 | #if !CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 80 | |
| 81 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 82 | inline void addIteratorcxx . . $ QTWTF/addIterator(5aa27e242096454a).(const HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>*, |
| 83 | HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>*) { } |
| 84 | |
| 85 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 86 | inline void removeIteratorcxx . . $ QTWTF/removeIterator(5adb451054871b49).(HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>*) { } |
| 87 | |
| 88 | #endif |
| 89 | |
| 90 | typedef enumcxx . . $ QTWTF/$anonymous_type_30348c2662033c9e_0# { HashItemKnownGoodcxx . . $ QTWTF/HashItemKnownGood. } HashItemKnownGoodTagcxx . . $ QTWTF/HashItemKnownGoodTag#; |
| 91 | |
| 92 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 93 | class HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator# { |
| 94 | private: |
| 95 | typedef HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableTypecxx . . $ QTWTF/HashTableConstIterator#HashTableType#; |
| 96 | typedef HashTableIteratorcxx . . $ QTWTF/HashTableIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iteratorcxx . . $ QTWTF/HashTableConstIterator#iterator#; |
| 97 | typedef HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iteratorcxx . . $ QTWTF/HashTableConstIterator#const_iterator#; |
| 98 | typedef Value ValueTypecxx . . $ QTWTF/HashTableConstIterator#ValueType#; |
| 99 | typedef const ValueTypecxx . . $ QTWTF/HashTableConstIterator#ValueType#& ReferenceTypecxx . . $ QTWTF/HashTableConstIterator#ReferenceType#; |
| 100 | typedef const ValueTypecxx . . $ QTWTF/HashTableConstIterator#ValueType#* PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType#; |
| 101 | |
| 102 | friend class HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; |
| 103 | friend class HashTableIteratorcxx . . $ QTWTF/HashTableIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; |
| 104 | |
| 105 | void skipEmptyBucketscxx . . $ QTWTF/HashTableConstIterator#skipEmptyBuckets(49f6e7a06ebc5aa8).() |
| 106 | { |
| 107 | while (m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position. !=cxx . . $ QTWTF/`operator!=`(80d3fa33a1df3c2c). m_endPositioncxx . . $ QTWTF/HashTableConstIterator#m_endPosition. && HashTableTypecxx . . $ QTWTF/HashTableConstIterator#HashTableType#::isEmptyOrDeletedBucket(*m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.)) |
| 108 | ++m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.; |
| 109 | } |
| 110 | |
| 111 | HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#`HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(c97c664bf2eb297d).(const HashTableTypecxx . . $ QTWTF/HashTableConstIterator#HashTableType#* table, PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# position, PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# endPosition) |
| 112 | : m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.(position), m_endPositioncxx . . $ QTWTF/HashTableConstIterator#m_endPosition.(endPosition) |
| 113 | { |
| 114 | addIteratorcxx . . $ QTWTF/addIterator(5aa27e242096454a).(table, this); |
| 115 | skipEmptyBucketscxx . . $ QTWTF/HashTableConstIterator#skipEmptyBuckets(49f6e7a06ebc5aa8).(); |
| 116 | } |
| 117 | |
| 118 | HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#`HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(d5cb7a8ccdf5d6b0).(const HashTableTypecxx . . $ QTWTF/HashTableConstIterator#HashTableType#* table, PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# position, PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# endPosition, HashItemKnownGoodTagcxx . . $ QTWTF/HashItemKnownGoodTag#) |
| 119 | : m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.(position), m_endPositioncxx . . $ QTWTF/HashTableConstIterator#m_endPosition.(endPosition) |
| 120 | { |
| 121 | addIteratorcxx . . $ QTWTF/addIterator(5aa27e242096454a).(table, this); |
| 122 | } |
| 123 | |
| 124 | public: |
| 125 | HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#`HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(49f6e7a06ebc5aa8).() |
| 126 | { |
| 127 | addIteratorcxx . . $ QTWTF/addIterator(5aa27e242096454a).(0, this); |
| 128 | } |
| 129 | |
| 130 | // default copy, assignment and destructor are OK if CHECK_HASHTABLE_ITERATORS is 0 |
| 131 | |
| 132 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 133 | ~HashTableConstIterator() |
| 134 | { |
| 135 | removeIterator(this); |
| 136 | } |
| 137 | |
| 138 | HashTableConstIterator(const const_iterator& other) |
| 139 | : m_position(other.m_position), m_endPosition(other.m_endPosition) |
| 140 | { |
| 141 | addIterator(other.m_table, this); |
| 142 | } |
| 143 | |
| 144 | const_iterator& operator=(const const_iterator& other) |
| 145 | { |
| 146 | m_position = other.m_position; |
| 147 | m_endPosition = other.m_endPosition; |
| 148 | |
| 149 | removeIterator(this); |
| 150 | addIterator(other.m_table, this); |
| 151 | |
| 152 | return *this; |
| 153 | } |
| 154 | #endif |
| 155 | |
| 156 | PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# getcxx . . $ QTWTF/HashTableConstIterator#get(32bc73b8cd924efb).() const |
| 157 | { |
| 158 | checkValiditycxx . . $ QTWTF/HashTableConstIterator#checkValidity(83f5f38750778ac8).(); |
| 159 | return m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.; |
| 160 | } |
| 161 | ReferenceTypecxx . . $ QTWTF/HashTableConstIterator#ReferenceType# operatorcxx . . $ QTWTF/HashTableConstIterator#`operator*`(bdbd05d619d62250).*() const { return *getcxx . . $ QTWTF/HashTableConstIterator#get(32bc73b8cd924efb).(); } |
| 162 | PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# operatorcxx . . $ QTWTF/HashTableConstIterator#`operator->`(32bc73b8cd924efb).->() const { return getcxx . . $ QTWTF/HashTableConstIterator#get(32bc73b8cd924efb).(); } |
| 163 | |
| 164 | const_iteratorcxx . . $ QTWTF/HashTableConstIterator#const_iterator#& operatorcxx . . $ QTWTF/HashTableConstIterator#operator++(46452a651d66176b).++() |
| 165 | { |
| 166 | checkValiditycxx . . $ QTWTF/HashTableConstIterator#checkValidity(83f5f38750778ac8).(); |
| 167 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_position != m_endPosition); |
| 168 | ++m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.; |
| 169 | skipEmptyBucketscxx . . $ QTWTF/HashTableConstIterator#skipEmptyBuckets(49f6e7a06ebc5aa8).(); |
| 170 | return *this; |
| 171 | } |
| 172 | |
| 173 | // postfix ++ intentionally omitted |
| 174 | |
| 175 | // Comparison. |
| 176 | bool operatorcxx . . $ QTWTF/HashTableConstIterator#`operator==`(303f2eec076387b9).==(const const_iteratorcxx . . $ QTWTF/HashTableConstIterator#const_iterator#& other) const |
| 177 | { |
| 178 | checkValiditycxx . . $ QTWTF/HashTableConstIterator#checkValidity(79d6e20713c74473).(other); |
| 179 | return m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position. ==cxx . . $ QTWTF/`operator==`(8bba44cd2316e962). other.m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.; |
| 180 | } |
| 181 | bool operatorcxx . . $ QTWTF/HashTableConstIterator#`operator!=`(303f2eec076387b9).!=(const const_iteratorcxx . . $ QTWTF/HashTableConstIterator#const_iterator#& other) const |
| 182 | { |
| 183 | checkValiditycxx . . $ QTWTF/HashTableConstIterator#checkValidity(79d6e20713c74473).(other); |
| 184 | return m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position. !=cxx . . $ QTWTF/`operator!=`(69feba05d53a7241). other.m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.; |
| 185 | } |
| 186 | |
| 187 | private: |
| 188 | void checkValiditycxx . . $ QTWTF/HashTableConstIterator#checkValidity(83f5f38750778ac8).() const |
| 189 | { |
| 190 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 191 | ASSERT(m_table); |
| 192 | #endif |
| 193 | } |
| 194 | |
| 195 | |
| 196 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 197 | void checkValidity(const const_iterator& other) const |
| 198 | { |
| 199 | ASSERT(m_table); |
| 200 | ASSERT_UNUSED(other, other.m_table); |
| 201 | ASSERT(m_table == other.m_table); |
| 202 | } |
| 203 | #else |
| 204 | void checkValiditycxx . . $ QTWTF/HashTableConstIterator#checkValidity(79d6e20713c74473).(const const_iteratorcxx . . $ QTWTF/HashTableConstIterator#const_iterator#&) const { } |
| 205 | #endif |
| 206 | |
| 207 | PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# m_positioncxx . . $ QTWTF/HashTableConstIterator#m_position.; |
| 208 | PointerTypecxx . . $ QTWTF/HashTableConstIterator#PointerType# m_endPositioncxx . . $ QTWTF/HashTableConstIterator#m_endPosition.; |
| 209 | |
| 210 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 211 | public: |
| 212 | // Any modifications of the m_next or m_previous of an iterator that is in a linked list of a HashTable::m_iterator, |
| 213 | // should be guarded with m_table->m_mutex. |
| 214 | mutable const HashTableType* m_table; |
| 215 | mutable const_iterator* m_next; |
| 216 | mutable const_iterator* m_previous; |
| 217 | #endif |
| 218 | }; |
| 219 | |
| 220 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 221 | class HashTableIteratorcxx . . $ QTWTF/HashTableIterator# { |
| 222 | private: |
| 223 | typedef HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableTypecxx . . $ QTWTF/HashTableIterator#HashTableType#; |
| 224 | typedef HashTableIteratorcxx . . $ QTWTF/HashTableIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iteratorcxx . . $ QTWTF/HashTableIterator#iterator#; |
| 225 | typedef HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iteratorcxx . . $ QTWTF/HashTableIterator#const_iterator#; |
| 226 | typedef Value ValueTypecxx . . $ QTWTF/HashTableIterator#ValueType#; |
| 227 | typedef ValueTypecxx . . $ QTWTF/HashTableIterator#ValueType#& ReferenceTypecxx . . $ QTWTF/HashTableIterator#ReferenceType#; |
| 228 | typedef ValueTypecxx . . $ QTWTF/HashTableIterator#ValueType#* PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType#; |
| 229 | |
| 230 | friend class HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>; |
| 231 | |
| 232 | HashTableIteratorcxx . . $ QTWTF/HashTableIterator#`HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(4bae51870225aa77).(HashTableTypecxx . . $ QTWTF/HashTableIterator#HashTableType#* table, PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType# pos, PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType# end) : m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.(table, pos, end) { } |
| 233 | HashTableIteratorcxx . . $ QTWTF/HashTableIterator#`HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(56214c3e7bc3b53b).(HashTableTypecxx . . $ QTWTF/HashTableIterator#HashTableType#* table, PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType# pos, PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType# end, HashItemKnownGoodTagcxx . . $ QTWTF/HashItemKnownGoodTag# tag) : m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.(table, pos, end, tag) { } |
| 234 | |
| 235 | public: |
| 236 | HashTableIteratorcxx . . $ QTWTF/HashTableIterator#`HashTableIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(49f6e7a06ebc5aa8).() { } |
| 237 | |
| 238 | // default copy, assignment and destructor are OK |
| 239 | |
| 240 | PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType# getcxx . . $ QTWTF/HashTableIterator#get(1d1e4aba2bba624b).() const { return const_cast<PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType#>(m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator..getcxx . . $ QTWTF/HashTableConstIterator#get(32bc73b8cd924efb).()); } |
| 241 | ReferenceTypecxx . . $ QTWTF/HashTableIterator#ReferenceType# operatorcxx . . $ QTWTF/HashTableIterator#`operator*`(51f62fb05f27f6a2).*() const { return *getcxx . . $ QTWTF/HashTableIterator#get(1d1e4aba2bba624b).(); } |
| 242 | PointerTypecxx . . $ QTWTF/HashTableIterator#PointerType# operatorcxx . . $ QTWTF/HashTableIterator#`operator->`(1d1e4aba2bba624b).->() const { return getcxx . . $ QTWTF/HashTableIterator#get(1d1e4aba2bba624b).(); } |
| 243 | |
| 244 | iteratorcxx . . $ QTWTF/HashTableIterator#iterator#& operatorcxx . . $ QTWTF/HashTableIterator#operator++(868f024e0141b347).++() { ++m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.; return *this; } |
| 245 | |
| 246 | // postfix ++ intentionally omitted |
| 247 | |
| 248 | // Comparison. |
| 249 | bool operatorcxx . . $ QTWTF/HashTableIterator#`operator==`(5eb3ed45717a8c9a).==(const iteratorcxx . . $ QTWTF/HashTableIterator#iterator#& other) const { return m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator. ==cxx . . $ QTWTF/`operator==`(80d3fa33a1df3c2c). other.m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.; } |
| 250 | bool operatorcxx . . $ QTWTF/HashTableIterator#`operator!=`(5eb3ed45717a8c9a).!=(const iteratorcxx . . $ QTWTF/HashTableIterator#iterator#& other) const { return m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator. !=cxx . . $ QTWTF/`operator!=`(80d3fa33a1df3c2c). other.m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.; } |
| 251 | |
| 252 | operatorcxx . . $ QTWTF/HashTableIterator#`operator HashTableConstIterator<type-parameter-0-0, type-parameter-0-1, type-parameter-0-2, type-parameter-0-3, type-parameter-0-4, type-parameter-0-5>`(6bb497947033b321). const_iteratorcxx . . $ QTWTF/HashTableIterator#const_iterator#() const { return m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.; } |
| 253 | |
| 254 | private: |
| 255 | const_iteratorcxx . . $ QTWTF/HashTableIterator#const_iterator# m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator.; |
| 256 | }; |
| 257 | |
| 258 | using stdcxx . . $ std/::swapcxx . . $ std/swap(4f7bccc0a19c88cd).; |
| 259 | |
| 260 | // Work around MSVC's standard library, whose swap for pairs does not swap by component. |
| 261 | template<typename T> inline void hashTableSwapcxx . . $ QTWTF/hashTableSwap(9e0270548159b170).(T& a, T& b) |
| 262 | { |
| 263 | swapcxx . . $ QTWTF/swap(7004b4b3dd5a7789).(a, b); |
| 264 | } |
| 265 | |
| 266 | template<typename T, typename U> inline void hashTableSwapcxx . . $ QTWTF/hashTableSwap(48a7729746d9d46a).(paircxx . . $ QTWTF/pair#<T, U>& a, paircxx . . $ QTWTF/pair#<T, U>& b) |
| 267 | { |
| 268 | swapcxx . . $ QTWTF/swap(e9aa9b1aa62dbcf6).(a.firstcxx . . $ std/pair#first., b.firstcxx . . $ std/pair#first.); |
| 269 | swapcxx . . $ QTWTF/swap(a82ae8f1d52ef9ba).(a.secondcxx . . $ std/pair#second., b.secondcxx . . $ std/pair#second.); |
| 270 | } |
| 271 | |
| 272 | template<typename T, bool useSwap> struct Movercxx . . $ QTWTF/Mover#; |
| 273 | template<typename T> struct Movercxx . . $ QTWTF/Mover#<T, true> { static void movecxx . . $ QTWTF/Mover#move(9e0270548159b170).(T& from, T& to) { hashTableSwapcxx . . $ QTWTF/hashTableSwap(9e0270548159b170).(from, to); } }; |
| 274 | template<typename T> struct Movercxx . . $ QTWTF/Mover#<T, false> { static void movecxx . . $ QTWTF/Mover#move(9e0270548159b170).(T& from, T& to) { to = from; } }; |
| 275 | |
| 276 | template<typename Key, typename Value, typename HashFunctions> class IdentityHashTranslatorcxx . . $ QTWTF/IdentityHashTranslator# { |
| 277 | public: |
| 278 | static unsigned hashcxx . . $ QTWTF/IdentityHashTranslator#hash(bada9624baa6da56).(const Key& key) { return HashFunctions::hash(key); } |
| 279 | static bool equalcxx . . $ QTWTF/IdentityHashTranslator#equal(9c67b3b6cbcd0cef).(const Key& a, const Key& b) { return HashFunctions::equal(a, b); } |
| 280 | static void translatecxx . . $ QTWTF/IdentityHashTranslator#translate(37dcb763f84c862b).(Value& location, const Key&, const Value& value) { location = value; } |
| 281 | }; |
| 282 | |
| 283 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 284 | class HashTablecxx . . $ QTWTF/HashTable# { |
| 285 | public: |
| 286 | typedef HashTableIteratorcxx . . $ QTWTF/HashTableIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> iteratorcxx . . $ QTWTF/HashTable#iterator#; |
| 287 | typedef HashTableConstIteratorcxx . . $ QTWTF/HashTableConstIterator#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iteratorcxx . . $ QTWTF/HashTable#const_iterator#; |
| 288 | typedef Traits ValueTraitscxx . . $ QTWTF/HashTable#ValueTraits#; |
| 289 | typedef Key KeyTypecxx . . $ QTWTF/HashTable#KeyType#; |
| 290 | typedef Value ValueTypecxx . . $ QTWTF/HashTable#ValueType#; |
| 291 | typedef IdentityHashTranslatorcxx . . $ QTWTF/IdentityHashTranslator#<Key, Value, HashFunctions> IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#; |
| 292 | |
| 293 | HashTablecxx . . $ QTWTF/HashTable#`HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(49f6e7a06ebc5aa8).(); |
| 294 | ~cxx . . $ QTWTF/HashTable#`~HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(49f6e7a06ebc5aa8).HashTable() |
| 295 | { |
| 296 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 297 | deallocateTablecxx . . $ QTWTF/HashTable#deallocateTable(9ffd286421daa9fa).(m_tablecxx . . $ QTWTF/HashTable#m_table., m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.); |
| 298 | #if CHECK_HASHTABLE_USE_AFTER_DESTRUCTIONcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:37:9`! |
| 299 | m_table = (ValueType*)(uintptr_t)0xbbadbeef; |
| 300 | #endif |
| 301 | } |
| 302 | |
| 303 | HashTablecxx . . $ QTWTF/HashTable#`HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(12febce6a33637c).(const HashTable&); |
| 304 | void swapcxx . . $ QTWTF/HashTable#swap(4c3dc139c52ec836).(HashTable&); |
| 305 | HashTable& operatorcxx . . $ QTWTF/HashTable#`operator=`(438b1efec9ea7a41).=(const HashTable&); |
| 306 | |
| 307 | iteratorcxx . . $ QTWTF/HashTable#iterator# begincxx . . $ QTWTF/HashTable#begin(400fc12dfeddc5c0).() { return makeIteratorcxx . . $ QTWTF/HashTable#makeIterator(8d0a12578375dcaf).(m_tablecxx . . $ QTWTF/HashTable#m_table.); } |
| 308 | iteratorcxx . . $ QTWTF/HashTable#iterator# endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).() { return makeKnownGoodIteratorcxx . . $ QTWTF/HashTable#makeKnownGoodIterator(8d0a12578375dcaf).(m_tablecxx . . $ QTWTF/HashTable#m_table. +cxx . . $ operator+(f3789794639247d3). m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.); } |
| 309 | const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# begincxx . . $ QTWTF/HashTable#begin(6bb497947033b321).() const { return makeConstIteratorcxx . . $ QTWTF/HashTable#makeConstIterator(6205679099940e3b).(m_tablecxx . . $ QTWTF/HashTable#m_table.); } |
| 310 | const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# endcxx . . $ QTWTF/HashTable#end(6bb497947033b321).() const { return makeKnownGoodConstIteratorcxx . . $ QTWTF/HashTable#makeKnownGoodConstIterator(6205679099940e3b).(m_tablecxx . . $ QTWTF/HashTable#m_table. +cxx . . $ operator+(665ce30667a89d56). m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.); } |
| 311 | |
| 312 | int sizecxx . . $ QTWTF/HashTable#size(455f465bc33b4cdf).() const { return m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; } |
| 313 | int capacitycxx . . $ QTWTF/HashTable#capacity(455f465bc33b4cdf).() const { return m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; } |
| 314 | bool isEmptycxx . . $ QTWTF/HashTable#isEmpty(50ce9a9e25b4a850).() const { return !m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; } |
| 315 | |
| 316 | paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> addcxx . . $ QTWTF/HashTable#add(b8ed51a42316103f).(const ValueTypecxx . . $ QTWTF/HashTable#ValueType#& value) { return addcxx . . $ QTWTF/HashTable#add(b8ed51a42316103f).<KeyTypecxx . . $ QTWTF/HashTable#KeyType#, ValueTypecxx . . $ QTWTF/HashTable#ValueType#, IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#>(Extractor::extract(value), value); } |
| 317 | |
| 318 | // A special version of add() that finds the object by hashing and comparing |
| 319 | // with some other type, to avoid the cost of type conversion if the object is already |
| 320 | // in the table. |
| 321 | template<typename T, typename Extra, typename HashTranslator> paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> addcxx . . $ QTWTF/HashTable#add(f69b394842063ec6).(const T& key, const Extra&); |
| 322 | template<typename T, typename Extra, typename HashTranslator> paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> addPassingHashCodecxx . . $ QTWTF/HashTable#addPassingHashCode(f69b394842063ec6).(const T& key, const Extra&); |
| 323 | |
| 324 | iteratorcxx . . $ QTWTF/HashTable#iterator# findcxx . . $ QTWTF/HashTable#find(82ffd35d6795a744).(const KeyTypecxx . . $ QTWTF/HashTable#KeyType#& key) { return findcxx . . $ QTWTF/HashTable#find(10c59f90f1b43478).<KeyTypecxx . . $ QTWTF/HashTable#KeyType#, IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#>(key); } |
| 325 | const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# findcxx . . $ QTWTF/HashTable#find(10c59f90f1b43478).(const KeyTypecxx . . $ QTWTF/HashTable#KeyType#& key) const { return findcxx . . $ QTWTF/HashTable#find(10c59f90f1b43478).<KeyTypecxx . . $ QTWTF/HashTable#KeyType#, IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#>(key); } |
| 326 | bool containscxx . . $ QTWTF/HashTable#contains(8877ebe272b9620d).(const KeyTypecxx . . $ QTWTF/HashTable#KeyType#& key) const { return containscxx . . $ QTWTF/HashTable#contains(8877ebe272b9620d).<KeyTypecxx . . $ QTWTF/HashTable#KeyType#, IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#>(key); } |
| 327 | |
| 328 | template <typename T, typename HashTranslator> iteratorcxx . . $ QTWTF/HashTable#iterator# findcxx . . $ QTWTF/HashTable#find(1e3ee97707b0f923).(const T&); |
| 329 | template <typename T, typename HashTranslator> const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# findcxx . . $ QTWTF/HashTable#find(603723abac615714).(const T&) const; |
| 330 | template <typename T, typename HashTranslator> bool containscxx . . $ QTWTF/HashTable#contains(52aad8a5ba75b80f).(const T&) const; |
| 331 | |
| 332 | void removecxx . . $ QTWTF/HashTable#remove(77d9f17553126ecb).(const KeyTypecxx . . $ QTWTF/HashTable#KeyType#&); |
| 333 | void removecxx . . $ QTWTF/HashTable#remove(90fee5ddac1206fd).(iteratorcxx . . $ QTWTF/HashTable#iterator#); |
| 334 | void removeWithoutEntryConsistencyCheckcxx . . $ QTWTF/HashTable#removeWithoutEntryConsistencyCheck(90fee5ddac1206fd).(iteratorcxx . . $ QTWTF/HashTable#iterator#); |
| 335 | void clearcxx . . $ QTWTF/HashTable#clear(49f6e7a06ebc5aa8).(); |
| 336 | |
| 337 | static bool isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(const ValueTypecxx . . $ QTWTF/HashTable#ValueType#& value) { return Extractor::extract(value) ==cxx . . $ QTWTF/`operator==`(4bad3d8cb7496246). KeyTraits::emptyValue(); } |
| 338 | static bool isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(const ValueTypecxx . . $ QTWTF/HashTable#ValueType#& value) { return KeyTraits::isDeletedValue(Extractor::extract(value)); } |
| 339 | static bool isEmptyOrDeletedBucketcxx . . $ QTWTF/HashTable#isEmptyOrDeletedBucket(1d049672e63bd4c).(const ValueTypecxx . . $ QTWTF/HashTable#ValueType#& value) { return isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(value) || isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(value); } |
| 340 | |
| 341 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).(const Key& key) { return lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).<Key, IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#>(key); } |
| 342 | template<typename T, typename HashTranslator> ValueTypecxx . . $ QTWTF/HashTable#ValueType#* lookupcxx . . $ QTWTF/HashTable#lookup(a11d933062ddfb3a).(const T&); |
| 343 | |
| 344 | #if CHECK_HASHTABLE_CONSISTENCYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:33:9`! |
| 345 | void checkTableConsistency() const; |
| 346 | #else |
| 347 | static void checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).() { } |
| 348 | #endif |
| 349 | |
| 350 | private: |
| 351 | static ValueTypecxx . . $ QTWTF/HashTable#ValueType#* allocateTablecxx . . $ QTWTF/HashTable#allocateTable(ab50a713b7b44ad7).(int size); |
| 352 | static void deallocateTablecxx . . $ QTWTF/HashTable#deallocateTable(9ffd286421daa9fa).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* table, int size); |
| 353 | |
| 354 | typedef paircxx . . $ QTWTF/pair#<ValueTypecxx . . $ QTWTF/HashTable#ValueType#*, bool> LookupTypecxx . . $ QTWTF/HashTable#LookupType#; |
| 355 | typedef paircxx . . $ QTWTF/pair#<LookupTypecxx . . $ QTWTF/HashTable#LookupType#, unsigned> FullLookupTypecxx . . $ QTWTF/HashTable#FullLookupType#; |
| 356 | |
| 357 | LookupTypecxx . . $ QTWTF/HashTable#LookupType# lookupForWritingcxx . . $ QTWTF/HashTable#lookupForWriting(e1a034d65e84f49e).(const Key& key) { return lookupForWritingcxx . . $ QTWTF/HashTable#lookupForWriting(e1a034d65e84f49e).<Key, IdentityTranslatorTypecxx . . $ QTWTF/HashTable#IdentityTranslatorType#>(key); }; |
| 358 | template<typename T, typename HashTranslator> FullLookupTypecxx . . $ QTWTF/HashTable#FullLookupType# fullLookupForWritingcxx . . $ QTWTF/HashTable#fullLookupForWriting(33955da92c0d2cb2).(const T&); |
| 359 | template<typename T, typename HashTranslator> LookupTypecxx . . $ QTWTF/HashTable#LookupType# lookupForWritingcxx . . $ QTWTF/HashTable#lookupForWriting(8e323b442bbed983).(const T&); |
| 360 | |
| 361 | template<typename T, typename HashTranslator> void checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).(const T&); |
| 362 | |
| 363 | void removeAndInvalidateWithoutEntryConsistencyCheckcxx . . $ QTWTF/HashTable#removeAndInvalidateWithoutEntryConsistencyCheck(b86249c387e65cb9).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#*); |
| 364 | void removeAndInvalidatecxx . . $ QTWTF/HashTable#removeAndInvalidate(b86249c387e65cb9).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#*); |
| 365 | void removecxx . . $ QTWTF/HashTable#remove(b86249c387e65cb9).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#*); |
| 366 | |
| 367 | bool shouldExpandcxx . . $ QTWTF/HashTable#shouldExpand(50ce9a9e25b4a850).() const { return (m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount. + m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.) * m_maxLoadcxx . . $ QTWTF/HashTable#m_maxLoad. >= m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; } |
| 368 | bool mustRehashInPlacecxx . . $ QTWTF/HashTable#mustRehashInPlace(50ce9a9e25b4a850).() const { return m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount. * m_minLoadcxx . . $ QTWTF/HashTable#m_minLoad. < m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. * 2; } |
| 369 | bool shouldShrinkcxx . . $ QTWTF/HashTable#shouldShrink(50ce9a9e25b4a850).() const { return m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount. * m_minLoadcxx . . $ QTWTF/HashTable#m_minLoad. < m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. && m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. > m_minTableSizecxx . . $ QTWTF/HashTable#m_minTableSize.; } |
| 370 | void expandcxx . . $ QTWTF/HashTable#expand(49f6e7a06ebc5aa8).(); |
| 371 | void shrinkcxx . . $ QTWTF/HashTable#shrink(49f6e7a06ebc5aa8).() { rehashcxx . . $ QTWTF/HashTable#rehash(d4f767463ce0a6b3).(m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. / 2); } |
| 372 | |
| 373 | void rehashcxx . . $ QTWTF/HashTable#rehash(d4f767463ce0a6b3).(int newTableSize); |
| 374 | void reinsertcxx . . $ QTWTF/HashTable#reinsert(b32c8f942b92bd92).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#&); |
| 375 | |
| 376 | static void initializeBucketcxx . . $ QTWTF/HashTable#initializeBucket(b32c8f942b92bd92).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#& bucket) { new (&bucket) ValueTypecxx . . $ QTWTF/HashTable#ValueType#(Traits::emptyValue()); } |
| 377 | static void deleteBucketcxx . . $ QTWTF/HashTable#deleteBucket(b32c8f942b92bd92).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#& bucket) { bucket.~ValueTypecxx . . $ QTWTF/HashTable#ValueType#(); Traits::constructDeletedValue(bucket); } |
| 378 | |
| 379 | FullLookupTypecxx . . $ QTWTF/HashTable#FullLookupType# makeLookupResultcxx . . $ QTWTF/HashTable#makeLookupResult(c2cafa44238dc6cb).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* position, bool found, unsigned hash) |
| 380 | { return FullLookupTypecxx . . $ QTWTF/HashTable#FullLookupType#(LookupTypecxx . . $ QTWTF/HashTable#LookupType#(position, found), hash); } |
| 381 | |
| 382 | iteratorcxx . . $ QTWTF/HashTable#iterator# makeIteratorcxx . . $ QTWTF/HashTable#makeIterator(8d0a12578375dcaf).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) { return iteratorcxx . . $ QTWTF/HashTable#iterator#(this, pos, m_tablecxx . . $ QTWTF/HashTable#m_table. +cxx . . $ operator+(665ce30667a89d56). m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.); } |
| 383 | const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# makeConstIteratorcxx . . $ QTWTF/HashTable#makeConstIterator(6205679099940e3b).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) const { return const_iteratorcxx . . $ QTWTF/HashTable#const_iterator#(this, pos, m_tablecxx . . $ QTWTF/HashTable#m_table. +cxx . . $ operator+(f3789794639247d3). m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.); } |
| 384 | iteratorcxx . . $ QTWTF/HashTable#iterator# makeKnownGoodIteratorcxx . . $ QTWTF/HashTable#makeKnownGoodIterator(8d0a12578375dcaf).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) { return iteratorcxx . . $ QTWTF/HashTable#iterator#(this, pos, m_tablecxx . . $ QTWTF/HashTable#m_table. +cxx . . $ operator+(f3789794639247d3). m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize., HashItemKnownGoodcxx . . $ QTWTF/HashItemKnownGood.); } |
| 385 | const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# makeKnownGoodConstIteratorcxx . . $ QTWTF/HashTable#makeKnownGoodConstIterator(6205679099940e3b).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) const { return const_iteratorcxx . . $ QTWTF/HashTable#const_iterator#(this, pos, m_tablecxx . . $ QTWTF/HashTable#m_table. +cxx . . $ operator+(665ce30667a89d56). m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize., HashItemKnownGoodcxx . . $ QTWTF/HashItemKnownGood.); } |
| 386 | |
| 387 | #if CHECK_HASHTABLE_CONSISTENCYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:33:9`! |
| 388 | void checkTableConsistencyExceptSize() const; |
| 389 | #else |
| 390 | static void checkTableConsistencyExceptSizecxx . . $ QTWTF/HashTable#checkTableConsistencyExceptSize(49f6e7a06ebc5aa8).() { } |
| 391 | #endif |
| 392 | |
| 393 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 394 | void invalidateIterators(); |
| 395 | #else |
| 396 | static void invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).() { } |
| 397 | #endif |
| 398 | |
| 399 | static const int m_minTableSizecxx . . $ QTWTF/HashTable#m_minTableSize. = 64; |
| 400 | static const int m_maxLoadcxx . . $ QTWTF/HashTable#m_maxLoad. = 2; |
| 401 | static const int m_minLoadcxx . . $ QTWTF/HashTable#m_minLoad. = 6; |
| 402 | |
| 403 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 404 | int m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; |
| 405 | int m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 406 | int m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; |
| 407 | int m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.; |
| 408 | |
| 409 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 410 | public: |
| 411 | // All access to m_iterators should be guarded with m_mutex. |
| 412 | mutable const_iterator* m_iterators; |
| 413 | mutable Mutex m_mutex; |
| 414 | #endif |
| 415 | }; |
| 416 | |
| 417 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 418 | inline HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::HashTablecxx . . $ QTWTF/HashTable#`HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(49f6e7a06ebc5aa8).() |
| 419 | : m_tablecxx . . $ QTWTF/HashTable#m_table.(0) |
| 420 | , m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.(0) |
| 421 | , m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.(0) |
| 422 | , m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.(0) |
| 423 | , m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.(0) |
| 424 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 425 | , m_iterators(0) |
| 426 | #endif |
| 427 | { |
| 428 | } |
| 429 | |
| 430 | static inline unsigned doubleHashcxx . . $ QTWTF/doubleHash(2141b656ce2cc063).(unsigned key) |
| 431 | { |
| 432 | key = ~key + (key >> 23); |
| 433 | key ^= (key << 12); |
| 434 | key ^= (key >> 7); |
| 435 | key ^= (key << 2); |
| 436 | key ^= (key >> 20); |
| 437 | return key; |
| 438 | } |
| 439 | |
| 440 | #if ASSERT_DISABLEDcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:71:9`! |
| 441 | |
| 442 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 443 | template<typename T, typename HashTranslator> |
| 444 | inline void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).(const T&) |
| 445 | { |
| 446 | } |
| 447 | |
| 448 | #else |
| 449 | |
| 450 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 451 | template<typename T, typename HashTranslator> |
| 452 | void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkKey(const T& key) |
| 453 | { |
| 454 | if (!HashFunctions::safeToCompareToEmptyOrDeleted) |
| 455 | return; |
| 456 | ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key)); |
| 457 | ValueType deletedValue = Traits::emptyValue(); |
| 458 | deletedValue.~ValueType(); |
| 459 | Traits::constructDeletedValue(deletedValue); |
| 460 | ASSERT(!HashTranslator::equal(Extractor::extract(deletedValue), key)); |
| 461 | new (&deletedValue) ValueType(Traits::emptyValue()); |
| 462 | } |
| 463 | |
| 464 | #endif |
| 465 | |
| 466 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 467 | template<typename T, typename HashTranslator> |
| 468 | inline Value* HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::lookupcxx . . $ QTWTF/HashTable#lookup(a11d933062ddfb3a).(const T& key) |
| 469 | { |
| 470 | checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).<T, HashTranslator>(key); |
| 471 | |
| 472 | int k = 0; |
| 473 | int sizeMask = m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 474 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* table = m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 475 | unsigned h = HashTranslator::hash(key); |
| 476 | int i = h & sizeMask; |
| 477 | |
| 478 | if (!table) |
| 479 | return 0; |
| 480 | |
| 481 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 482 | atomicIncrement(&HashTableStats::numAccesses); |
| 483 | int probeCount = 0; |
| 484 | #endif |
| 485 | |
| 486 | while (1) { |
| 487 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry = table +cxx . . $ operator+(f3789794639247d3). i; |
| 488 | |
| 489 | // we count on the compiler to optimize out this branch |
| 490 | if (HashFunctions::safeToCompareToEmptyOrDeleted) { |
| 491 | if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 492 | return entry; |
| 493 | |
| 494 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 495 | return 0; |
| 496 | } else { |
| 497 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 498 | return 0; |
| 499 | |
| 500 | if (!isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry) && HashTranslator::equal(Extractor::extract(*entry), key)) |
| 501 | return entry; |
| 502 | } |
| 503 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 504 | ++probeCount; |
| 505 | HashTableStats::recordCollisionAtCount(probeCount); |
| 506 | #endif |
| 507 | if (k == 0) |
| 508 | k = 1 | doubleHashcxx . . $ QTWTF/doubleHash(2141b656ce2cc063).(h); |
| 509 | i = (i + k) & sizeMask; |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 514 | template<typename T, typename HashTranslator> |
| 515 | inline typename HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::LookupTypecxx . . $ QTWTF/HashTable#LookupType# HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::lookupForWritingcxx . . $ QTWTF/HashTable#lookupForWriting(8e323b442bbed983).(const T& key) |
| 516 | { |
| 517 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_table); |
| 518 | checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).<T, HashTranslator>(key); |
| 519 | |
| 520 | int k = 0; |
| 521 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* table = m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 522 | int sizeMask = m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 523 | unsigned h = HashTranslator::hash(key); |
| 524 | int i = h & sizeMask; |
| 525 | |
| 526 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 527 | atomicIncrement(&HashTableStats::numAccesses); |
| 528 | int probeCount = 0; |
| 529 | #endif |
| 530 | |
| 531 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* deletedEntry = 0; |
| 532 | |
| 533 | while (1) { |
| 534 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry = table +cxx . . $ operator+(665ce30667a89d56). i; |
| 535 | |
| 536 | // we count on the compiler to optimize out this branch |
| 537 | if (HashFunctions::safeToCompareToEmptyOrDeleted) { |
| 538 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 539 | return LookupTypecxx . . $ QTWTF/HashTable#LookupType#(deletedEntry ? deletedEntry : entry, false); |
| 540 | |
| 541 | if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 542 | return LookupTypecxx . . $ QTWTF/HashTable#LookupType#(entry, true); |
| 543 | |
| 544 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) |
| 545 | deletedEntry = entry; |
| 546 | } else { |
| 547 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 548 | return LookupTypecxx . . $ QTWTF/HashTable#LookupType#(deletedEntry ? deletedEntry : entry, false); |
| 549 | |
| 550 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) |
| 551 | deletedEntry = entry; |
| 552 | else if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 553 | return LookupTypecxx . . $ QTWTF/HashTable#LookupType#(entry, true); |
| 554 | } |
| 555 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 556 | ++probeCount; |
| 557 | HashTableStats::recordCollisionAtCount(probeCount); |
| 558 | #endif |
| 559 | if (k == 0) |
| 560 | k = 1 | doubleHashcxx . . $ QTWTF/doubleHash(2141b656ce2cc063).(h); |
| 561 | i = (i + k) & sizeMask; |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 566 | template<typename T, typename HashTranslator> |
| 567 | inline typename HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::FullLookupTypecxx . . $ QTWTF/HashTable#FullLookupType# HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::fullLookupForWritingcxx . . $ QTWTF/HashTable#fullLookupForWriting(33955da92c0d2cb2).(const T& key) |
| 568 | { |
| 569 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_table); |
| 570 | checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).<T, HashTranslator>(key); |
| 571 | |
| 572 | int k = 0; |
| 573 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* table = m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 574 | int sizeMask = m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 575 | unsigned h = HashTranslator::hash(key); |
| 576 | int i = h & sizeMask; |
| 577 | |
| 578 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 579 | atomicIncrement(&HashTableStats::numAccesses); |
| 580 | int probeCount = 0; |
| 581 | #endif |
| 582 | |
| 583 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* deletedEntry = 0; |
| 584 | |
| 585 | while (1) { |
| 586 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry = table +cxx . . $ operator+(665ce30667a89d56). i; |
| 587 | |
| 588 | // we count on the compiler to optimize out this branch |
| 589 | if (HashFunctions::safeToCompareToEmptyOrDeleted) { |
| 590 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 591 | return makeLookupResultcxx . . $ QTWTF/HashTable#makeLookupResult(c2cafa44238dc6cb).(deletedEntry ? deletedEntry : entry, false, h); |
| 592 | |
| 593 | if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 594 | return makeLookupResultcxx . . $ QTWTF/HashTable#makeLookupResult(c2cafa44238dc6cb).(entry, true, h); |
| 595 | |
| 596 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) |
| 597 | deletedEntry = entry; |
| 598 | } else { |
| 599 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 600 | return makeLookupResultcxx . . $ QTWTF/HashTable#makeLookupResult(c2cafa44238dc6cb).(deletedEntry ? deletedEntry : entry, false, h); |
| 601 | |
| 602 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) |
| 603 | deletedEntry = entry; |
| 604 | else if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 605 | return makeLookupResultcxx . . $ QTWTF/HashTable#makeLookupResult(c2cafa44238dc6cb).(entry, true, h); |
| 606 | } |
| 607 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 608 | ++probeCount; |
| 609 | HashTableStats::recordCollisionAtCount(probeCount); |
| 610 | #endif |
| 611 | if (k == 0) |
| 612 | k = 1 | doubleHashcxx . . $ QTWTF/doubleHash(2141b656ce2cc063).(h); |
| 613 | i = (i + k) & sizeMask; |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 618 | template<typename T, typename Extra, typename HashTranslator> |
| 619 | inline paircxx . . $ QTWTF/pair#<typename HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::addcxx . . $ QTWTF/HashTable#add(f69b394842063ec6).(const T& key, const Extra& extra) |
| 620 | { |
| 621 | checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).<T, HashTranslator>(key); |
| 622 | |
| 623 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 624 | |
| 625 | if (!m_tablecxx . . $ QTWTF/HashTable#m_table.) |
| 626 | expandcxx . . $ QTWTF/HashTable#expand(49f6e7a06ebc5aa8).(); |
| 627 | |
| 628 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 629 | |
| 630 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_table); |
| 631 | |
| 632 | int k = 0; |
| 633 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* table = m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 634 | int sizeMask = m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 635 | unsigned h = HashTranslator::hash(key); |
| 636 | int i = h & sizeMask; |
| 637 | |
| 638 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 639 | atomicIncrement(&HashTableStats::numAccesses); |
| 640 | int probeCount = 0; |
| 641 | #endif |
| 642 | |
| 643 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* deletedEntry = 0; |
| 644 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry; |
| 645 | while (1) { |
| 646 | entry = table +cxx . . $ operator+(665ce30667a89d56). i; |
| 647 | |
| 648 | // we count on the compiler to optimize out this branch |
| 649 | if (HashFunctions::safeToCompareToEmptyOrDeleted) { |
| 650 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 651 | break; |
| 652 | |
| 653 | if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 654 | return std::make_pair(makeKnownGoodIterator(entry), false); |
| 655 | |
| 656 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) |
| 657 | deletedEntry = entry; |
| 658 | } else { |
| 659 | if (isEmptyBucketcxx . . $ QTWTF/HashTable#isEmptyBucket(1d049672e63bd4c).(*entry)) |
| 660 | break; |
| 661 | |
| 662 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) |
| 663 | deletedEntry = entry; |
| 664 | else if (HashTranslator::equal(Extractor::extract(*entry), key)) |
| 665 | return std::make_pair(makeKnownGoodIterator(entry), false); |
| 666 | } |
| 667 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 668 | ++probeCount; |
| 669 | HashTableStats::recordCollisionAtCount(probeCount); |
| 670 | #endif |
| 671 | if (k == 0) |
| 672 | k = 1 | doubleHashcxx . . $ QTWTF/doubleHash(2141b656ce2cc063).(h); |
| 673 | i = (i + k) & sizeMask; |
| 674 | } |
| 675 | |
| 676 | if (deletedEntry) { |
| 677 | initializeBucketcxx . . $ QTWTF/HashTable#initializeBucket(b32c8f942b92bd92).(*deletedEntry); |
| 678 | entry = deletedEntry; |
| 679 | --m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.; |
| 680 | } |
| 681 | |
| 682 | HashTranslator::translate(*entry, key, extra); |
| 683 | |
| 684 | ++m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; |
| 685 | |
| 686 | if (shouldExpandcxx . . $ QTWTF/HashTable#shouldExpand(50ce9a9e25b4a850).()) { |
| 687 | // FIXME: This makes an extra copy on expand. Probably not that bad since |
| 688 | // expand is rare, but would be better to have a version of expand that can |
| 689 | // follow a pivot entry and return the new position. |
| 690 | KeyTypecxx . . $ QTWTF/HashTable#KeyType# enteredKey = Extractor::extract(*entry); |
| 691 | expandcxx . . $ QTWTF/HashTable#expand(49f6e7a06ebc5aa8).(); |
| 692 | paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> p = std::make_pair(find(enteredKey), true); |
| 693 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(p.first != end()); |
| 694 | return p; |
| 695 | } |
| 696 | |
| 697 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 698 | |
| 699 | return std::make_pair(makeKnownGoodIterator(entry), true); |
| 700 | } |
| 701 | |
| 702 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 703 | template<typename T, typename Extra, typename HashTranslator> |
| 704 | inline paircxx . . $ QTWTF/pair#<typename HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::addPassingHashCodecxx . . $ QTWTF/HashTable#addPassingHashCode(f69b394842063ec6).(const T& key, const Extra& extra) |
| 705 | { |
| 706 | checkKeycxx . . $ QTWTF/HashTable#checkKey(edcd8b2679e9bd1a).<T, HashTranslator>(key); |
| 707 | |
| 708 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 709 | |
| 710 | if (!m_tablecxx . . $ QTWTF/HashTable#m_table.) |
| 711 | expandcxx . . $ QTWTF/HashTable#expand(49f6e7a06ebc5aa8).(); |
| 712 | |
| 713 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 714 | |
| 715 | FullLookupTypecxx . . $ QTWTF/HashTable#FullLookupType# lookupResult = fullLookupForWritingcxx . . $ QTWTF/HashTable#fullLookupForWriting(33955da92c0d2cb2).<T, HashTranslator>(key); |
| 716 | |
| 717 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry = lookupResult.firstcxx . . $ std/pair#first..first; |
| 718 | bool found = lookupResult.firstcxx . . $ std/pair#first..second; |
| 719 | unsigned h = lookupResult.secondcxx . . $ std/pair#second.; |
| 720 | |
| 721 | if (found) |
| 722 | return std::make_pair(makeKnownGoodIterator(entry), false); |
| 723 | |
| 724 | if (isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(*entry)) { |
| 725 | initializeBucketcxx . . $ QTWTF/HashTable#initializeBucket(b32c8f942b92bd92).(*entry); |
| 726 | --m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.; |
| 727 | } |
| 728 | |
| 729 | HashTranslator::translate(*entry, key, extra, h); |
| 730 | ++m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; |
| 731 | if (shouldExpandcxx . . $ QTWTF/HashTable#shouldExpand(50ce9a9e25b4a850).()) { |
| 732 | // FIXME: This makes an extra copy on expand. Probably not that bad since |
| 733 | // expand is rare, but would be better to have a version of expand that can |
| 734 | // follow a pivot entry and return the new position. |
| 735 | KeyTypecxx . . $ QTWTF/HashTable#KeyType# enteredKey = Extractor::extract(*entry); |
| 736 | expandcxx . . $ QTWTF/HashTable#expand(49f6e7a06ebc5aa8).(); |
| 737 | paircxx . . $ QTWTF/pair#<iteratorcxx . . $ QTWTF/HashTable#iterator#, bool> p = std::make_pair(find(enteredKey), true); |
| 738 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(p.first != end()); |
| 739 | return p; |
| 740 | } |
| 741 | |
| 742 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 743 | |
| 744 | return std::make_pair(makeKnownGoodIterator(entry), true); |
| 745 | } |
| 746 | |
| 747 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 748 | inline void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::reinsertcxx . . $ QTWTF/HashTable#reinsert(b32c8f942b92bd92).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#& entry) |
| 749 | { |
| 750 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(m_table); |
| 751 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!lookupForWriting(Extractor::extract(entry)).second); |
| 752 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(!isDeletedBucket(*(lookupForWriting(Extractor::extract(entry)).first))); |
| 753 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 754 | atomicIncrement(&HashTableStats::numReinserts); |
| 755 | #endif |
| 756 | |
| 757 | Movercxx . . $ QTWTF/Mover#<ValueType, Traits::needsDestruction>::move(entry, *lookupForWritingcxx . . $ QTWTF/HashTable#lookupForWriting(e1a034d65e84f49e).(Extractor::extract(entry)).first); |
| 758 | } |
| 759 | |
| 760 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 761 | template <typename T, typename HashTranslator> |
| 762 | typename HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::iteratorcxx . . $ QTWTF/HashTable#iterator# HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::findcxx . . $ QTWTF/HashTable#find(1e3ee97707b0f923).(const T& key) |
| 763 | { |
| 764 | if (!m_tablecxx . . $ QTWTF/HashTable#m_table.) |
| 765 | return endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).(); |
| 766 | |
| 767 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry = lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).<T, HashTranslator>(key); |
| 768 | if (!entry) |
| 769 | return endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).(); |
| 770 | |
| 771 | return makeKnownGoodIteratorcxx . . $ QTWTF/HashTable#makeKnownGoodIterator(8d0a12578375dcaf).(entry); |
| 772 | } |
| 773 | |
| 774 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 775 | template <typename T, typename HashTranslator> |
| 776 | typename HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::findcxx . . $ QTWTF/HashTable#find(603723abac615714).(const T& key) const |
| 777 | { |
| 778 | if (!m_tablecxx . . $ QTWTF/HashTable#m_table.) |
| 779 | return endcxx . . $ QTWTF/HashTable#end(6bb497947033b321).(); |
| 780 | |
| 781 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* entry = const_cast<HashTable*>(this)->lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).<T, HashTranslator>(key); |
| 782 | if (!entry) |
| 783 | return endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).(); |
| 784 | |
| 785 | return makeKnownGoodConstIteratorcxx . . $ QTWTF/HashTable#makeKnownGoodConstIterator(6205679099940e3b).(entry); |
| 786 | } |
| 787 | |
| 788 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 789 | template <typename T, typename HashTranslator> |
| 790 | bool HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::containscxx . . $ QTWTF/HashTable#contains(52aad8a5ba75b80f).(const T& key) const |
| 791 | { |
| 792 | if (!m_tablecxx . . $ QTWTF/HashTable#m_table.) |
| 793 | return false; |
| 794 | |
| 795 | return const_cast<HashTable*>(this)->lookupcxx . . $ QTWTF/HashTable#lookup(b8803fc2f699eb8b).<T, HashTranslator>(key); |
| 796 | } |
| 797 | |
| 798 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 799 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removeAndInvalidateWithoutEntryConsistencyCheckcxx . . $ QTWTF/HashTable#removeAndInvalidateWithoutEntryConsistencyCheck(b86249c387e65cb9).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) |
| 800 | { |
| 801 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 802 | removecxx . . $ QTWTF/HashTable#remove(b86249c387e65cb9).(pos); |
| 803 | } |
| 804 | |
| 805 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 806 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removeAndInvalidatecxx . . $ QTWTF/HashTable#removeAndInvalidate(b86249c387e65cb9).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) |
| 807 | { |
| 808 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 809 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 810 | removecxx . . $ QTWTF/HashTable#remove(b86249c387e65cb9).(pos); |
| 811 | } |
| 812 | |
| 813 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 814 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removecxx . . $ QTWTF/HashTable#remove(b86249c387e65cb9).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* pos) |
| 815 | { |
| 816 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 817 | atomicIncrement(&HashTableStats::numRemoves); |
| 818 | #endif |
| 819 | |
| 820 | deleteBucketcxx . . $ QTWTF/HashTable#deleteBucket(b32c8f942b92bd92).(*pos); |
| 821 | ++m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.; |
| 822 | --m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; |
| 823 | |
| 824 | if (shouldShrinkcxx . . $ QTWTF/HashTable#shouldShrink(50ce9a9e25b4a850).()) |
| 825 | shrinkcxx . . $ QTWTF/HashTable#shrink(49f6e7a06ebc5aa8).(); |
| 826 | |
| 827 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 828 | } |
| 829 | |
| 830 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 831 | inline void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removecxx . . $ QTWTF/HashTable#remove(90fee5ddac1206fd).(iteratorcxx . . $ QTWTF/HashTable#iterator# it) |
| 832 | { |
| 833 | if (it ==cxx . . $ QTWTF/`operator==`(80d3fa33a1df3c2c). endcxx . . $ QTWTF/HashTable#end(6bb497947033b321).()) |
| 834 | return; |
| 835 | |
| 836 | removeAndInvalidatecxx . . $ QTWTF/HashTable#removeAndInvalidate(b86249c387e65cb9).(const_cast<ValueTypecxx . . $ QTWTF/HashTable#ValueType#*>(it.m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator..m_position)); |
| 837 | } |
| 838 | |
| 839 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 840 | inline void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removeWithoutEntryConsistencyCheckcxx . . $ QTWTF/HashTable#removeWithoutEntryConsistencyCheck(90fee5ddac1206fd).(iteratorcxx . . $ QTWTF/HashTable#iterator# it) |
| 841 | { |
| 842 | if (it ==cxx . . $ QTWTF/`operator==`(74c38ce5a82188a5). endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).()) |
| 843 | return; |
| 844 | |
| 845 | removeAndInvalidateWithoutEntryConsistencyCheckcxx . . $ QTWTF/HashTable#removeAndInvalidateWithoutEntryConsistencyCheck(b86249c387e65cb9).(const_cast<ValueTypecxx . . $ QTWTF/HashTable#ValueType#*>(it.m_iteratorcxx . . $ QTWTF/HashTableIterator#m_iterator..m_position)); |
| 846 | } |
| 847 | |
| 848 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 849 | inline void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::removecxx . . $ QTWTF/HashTable#remove(77d9f17553126ecb).(const KeyTypecxx . . $ QTWTF/HashTable#KeyType#& key) |
| 850 | { |
| 851 | removecxx . . $ QTWTF/HashTable#remove(b86249c387e65cb9).(findcxx . . $ QTWTF/HashTable#find(82ffd35d6795a744).(key)); |
| 852 | } |
| 853 | |
| 854 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 855 | Value* HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::allocateTablecxx . . $ QTWTF/HashTable#allocateTable(ab50a713b7b44ad7).(int size) |
| 856 | { |
| 857 | // would use a template member function with explicit specializations here, but |
| 858 | // gcc doesn't appear to support that |
| 859 | if (Traits::emptyValueIsZero) |
| 860 | return static_cast<ValueTypecxx . . $ QTWTF/HashTable#ValueType#*>(fastZeroedMalloccxx . . $ QTWTF/fastZeroedMalloc(bfcfa4d6b7f7ef64).(size * sizeof(ValueTypecxx . . $ QTWTF/HashTable#ValueType#))); |
| 861 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* result = static_cast<ValueTypecxx . . $ QTWTF/HashTable#ValueType#*>(fastMalloccxx . . $ QTWTF/fastMalloc(bfcfa4d6b7f7ef64).(size * sizeof(ValueTypecxx . . $ QTWTF/HashTable#ValueType#))); |
| 862 | for (int i = 0; i < size; i++) |
| 863 | initializeBucketcxx . . $ QTWTF/HashTable#initializeBucket(b32c8f942b92bd92).(result[i]); |
| 864 | return result; |
| 865 | } |
| 866 | |
| 867 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 868 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::deallocateTablecxx . . $ QTWTF/HashTable#deallocateTable(9ffd286421daa9fa).(ValueTypecxx . . $ QTWTF/HashTable#ValueType#* table, int size) |
| 869 | { |
| 870 | if (Traits::needsDestruction) { |
| 871 | for (int i = 0; i < size; ++i) { |
| 872 | if (!isDeletedBucketcxx . . $ QTWTF/HashTable#isDeletedBucket(1d049672e63bd4c).(table[i])) |
| 873 | table[i].~ValueTypecxx . . $ QTWTF/HashTable#ValueType#(); |
| 874 | } |
| 875 | } |
| 876 | fastFreecxx . . $ QTWTF/fastFree(5d22bdacc48458e8).(table); |
| 877 | } |
| 878 | |
| 879 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 880 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::expandcxx . . $ QTWTF/HashTable#expand(49f6e7a06ebc5aa8).() |
| 881 | { |
| 882 | int newSize; |
| 883 | if (m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. == 0) |
| 884 | newSize = m_minTableSizecxx . . $ QTWTF/HashTable#m_minTableSize.; |
| 885 | else if (mustRehashInPlacecxx . . $ QTWTF/HashTable#mustRehashInPlace(50ce9a9e25b4a850).()) |
| 886 | newSize = m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; |
| 887 | else |
| 888 | newSize = m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. * 2; |
| 889 | |
| 890 | rehashcxx . . $ QTWTF/HashTable#rehash(d4f767463ce0a6b3).(newSize); |
| 891 | } |
| 892 | |
| 893 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 894 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::rehashcxx . . $ QTWTF/HashTable#rehash(d4f767463ce0a6b3).(int newTableSize) |
| 895 | { |
| 896 | checkTableConsistencyExceptSizecxx . . $ QTWTF/HashTable#checkTableConsistencyExceptSize(49f6e7a06ebc5aa8).(); |
| 897 | |
| 898 | int oldTableSize = m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; |
| 899 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* oldTable = m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 900 | |
| 901 | #if DUMP_HASHTABLE_STATScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:32:9`! |
| 902 | if (oldTableSize != 0) |
| 903 | atomicIncrement(&HashTableStats::numRehashes); |
| 904 | #endif |
| 905 | |
| 906 | m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. = newTableSize; |
| 907 | m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask. = newTableSize - 1; |
| 908 | m_tablecxx . . $ QTWTF/HashTable#m_table. = allocateTablecxx . . $ QTWTF/HashTable#allocateTable(ab50a713b7b44ad7).(newTableSize); |
| 909 | |
| 910 | for (int i = 0; i != oldTableSize; ++i) |
| 911 | if (!isEmptyOrDeletedBucketcxx . . $ QTWTF/HashTable#isEmptyOrDeletedBucket(1d049672e63bd4c).(oldTable[i])) |
| 912 | reinsertcxx . . $ QTWTF/HashTable#reinsert(b32c8f942b92bd92).(oldTable[i]); |
| 913 | |
| 914 | m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount. = 0; |
| 915 | |
| 916 | deallocateTablecxx . . $ QTWTF/HashTable#deallocateTable(9ffd286421daa9fa).(oldTable, oldTableSize); |
| 917 | |
| 918 | checkTableConsistencycxx . . $ QTWTF/HashTable#checkTableConsistency(49f6e7a06ebc5aa8).(); |
| 919 | } |
| 920 | |
| 921 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 922 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::clearcxx . . $ QTWTF/HashTable#clear(49f6e7a06ebc5aa8).() |
| 923 | { |
| 924 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 925 | deallocateTablecxx . . $ QTWTF/HashTable#deallocateTable(9ffd286421daa9fa).(m_tablecxx . . $ QTWTF/HashTable#m_table., m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.); |
| 926 | m_tablecxx . . $ QTWTF/HashTable#m_table. = 0; |
| 927 | m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. = 0; |
| 928 | m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask. = 0; |
| 929 | m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount. = 0; |
| 930 | } |
| 931 | |
| 932 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 933 | HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::HashTablecxx . . $ QTWTF/HashTable#`HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>`(12febce6a33637c).(const HashTable& other) |
| 934 | : m_tablecxx . . $ QTWTF/HashTable#m_table.(0) |
| 935 | , m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.(0) |
| 936 | , m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.(0) |
| 937 | , m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.(0) |
| 938 | , m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.(0) |
| 939 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 940 | , m_iterators(0) |
| 941 | #endif |
| 942 | { |
| 943 | // Copy the hash table the dumb way, by adding each element to the new table. |
| 944 | // It might be more efficient to copy the table slots, but it's not clear that efficiency is needed. |
| 945 | const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# end = other.endcxx . . $ QTWTF/HashTable#end(400fc12dfeddc5c0).(); |
| 946 | for (const_iteratorcxx . . $ QTWTF/HashTable#const_iterator# it = other.begincxx . . $ QTWTF/HashTable#begin(6bb497947033b321).(); it !=cxx . . $ QTWTF/`operator!=`(b1a6445b02f80637). end; ++it) |
| 947 | addcxx . . $ QTWTF/HashTable#add(b8ed51a42316103f).(*it); |
| 948 | } |
| 949 | |
| 950 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 951 | void HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::swapcxx . . $ QTWTF/HashTable#swap(4c3dc139c52ec836).(HashTable& other) |
| 952 | { |
| 953 | invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 954 | other.invalidateIteratorscxx . . $ QTWTF/HashTable#invalidateIterators(49f6e7a06ebc5aa8).(); |
| 955 | |
| 956 | ValueTypecxx . . $ QTWTF/HashTable#ValueType#* tmp_table = m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 957 | m_tablecxx . . $ QTWTF/HashTable#m_table. = other.m_tablecxx . . $ QTWTF/HashTable#m_table.; |
| 958 | other.m_tablecxx . . $ QTWTF/HashTable#m_table. = tmp_table; |
| 959 | |
| 960 | int tmp_tableSize = m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; |
| 961 | m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. = other.m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize.; |
| 962 | other.m_tableSizecxx . . $ QTWTF/HashTable#m_tableSize. = tmp_tableSize; |
| 963 | |
| 964 | int tmp_tableSizeMask = m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 965 | m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask. = other.m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask.; |
| 966 | other.m_tableSizeMaskcxx . . $ QTWTF/HashTable#m_tableSizeMask. = tmp_tableSizeMask; |
| 967 | |
| 968 | int tmp_keyCount = m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; |
| 969 | m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount. = other.m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount.; |
| 970 | other.m_keyCountcxx . . $ QTWTF/HashTable#m_keyCount. = tmp_keyCount; |
| 971 | |
| 972 | int tmp_deletedCount = m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.; |
| 973 | m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount. = other.m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount.; |
| 974 | other.m_deletedCountcxx . . $ QTWTF/HashTable#m_deletedCount. = tmp_deletedCount; |
| 975 | } |
| 976 | |
| 977 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 978 | HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>& HashTablecxx . . $ QTWTF/HashTable#<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::operatorcxx . . $ QTWTF/HashTable#`operator=`(438b1efec9ea7a41).=(const HashTable& other) |
| 979 | { |
| 980 | HashTable tmp(other); |
| 981 | swapcxx . . $ QTWTF/HashTable#swap(4c3dc139c52ec836).(tmp); |
| 982 | return *this; |
| 983 | } |
| 984 | |
| 985 | #if CHECK_HASHTABLE_CONSISTENCYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:33:9`! |
| 986 | |
| 987 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 988 | void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkTableConsistency() const |
| 989 | { |
| 990 | checkTableConsistencyExceptSize(); |
| 991 | ASSERT(!shouldExpand()); |
| 992 | ASSERT(!shouldShrink()); |
| 993 | } |
| 994 | |
| 995 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 996 | void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkTableConsistencyExceptSize() const |
| 997 | { |
| 998 | if (!m_table) |
| 999 | return; |
| 1000 | |
| 1001 | int count = 0; |
| 1002 | int deletedCount = 0; |
| 1003 | for (int j = 0; j < m_tableSize; ++j) { |
| 1004 | ValueType* entry = m_table + j; |
| 1005 | if (isEmptyBucket(*entry)) |
| 1006 | continue; |
| 1007 | |
| 1008 | if (isDeletedBucket(*entry)) { |
| 1009 | ++deletedCount; |
| 1010 | continue; |
| 1011 | } |
| 1012 | |
| 1013 | const_iterator it = find(Extractor::extract(*entry)); |
| 1014 | ASSERT(entry == it.m_position); |
| 1015 | ++count; |
| 1016 | } |
| 1017 | |
| 1018 | ASSERT(count == m_keyCount); |
| 1019 | ASSERT(deletedCount == m_deletedCount); |
| 1020 | ASSERT(m_tableSize >= m_minTableSize); |
| 1021 | ASSERT(m_tableSizeMask); |
| 1022 | ASSERT(m_tableSize == m_tableSizeMask + 1); |
| 1023 | } |
| 1024 | |
| 1025 | #endif // CHECK_HASHTABLE_CONSISTENCY |
| 1026 | |
| 1027 | #if CHECK_HASHTABLE_ITERATORScxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h:36:9`! |
| 1028 | |
| 1029 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 1030 | void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::invalidateIterators() |
| 1031 | { |
| 1032 | MutexLocker lock(m_mutex); |
| 1033 | const_iterator* next; |
| 1034 | for (const_iterator* p = m_iterators; p; p = next) { |
| 1035 | next = p->m_next; |
| 1036 | p->m_table = 0; |
| 1037 | p->m_next = 0; |
| 1038 | p->m_previous = 0; |
| 1039 | } |
| 1040 | m_iterators = 0; |
| 1041 | } |
| 1042 | |
| 1043 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 1044 | void addIterator(const HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>* table, |
| 1045 | HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>* it) |
| 1046 | { |
| 1047 | it->m_table = table; |
| 1048 | it->m_previous = 0; |
| 1049 | |
| 1050 | // Insert iterator at head of doubly-linked list of iterators. |
| 1051 | if (!table) { |
| 1052 | it->m_next = 0; |
| 1053 | } else { |
| 1054 | MutexLocker lock(table->m_mutex); |
| 1055 | ASSERT(table->m_iterators != it); |
| 1056 | it->m_next = table->m_iterators; |
| 1057 | table->m_iterators = it; |
| 1058 | if (it->m_next) { |
| 1059 | ASSERT(!it->m_next->m_previous); |
| 1060 | it->m_next->m_previous = it; |
| 1061 | } |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits> |
| 1066 | void removeIterator(HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>* it) |
| 1067 | { |
| 1068 | typedef HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableType; |
| 1069 | typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator; |
| 1070 | |
| 1071 | // Delete iterator from doubly-linked list of iterators. |
| 1072 | if (!it->m_table) { |
| 1073 | ASSERT(!it->m_next); |
| 1074 | ASSERT(!it->m_previous); |
| 1075 | } else { |
| 1076 | MutexLocker lock(it->m_table->m_mutex); |
| 1077 | if (it->m_next) { |
| 1078 | ASSERT(it->m_next->m_previous == it); |
| 1079 | it->m_next->m_previous = it->m_previous; |
| 1080 | } |
| 1081 | if (it->m_previous) { |
| 1082 | ASSERT(it->m_table->m_iterators != it); |
| 1083 | ASSERT(it->m_previous->m_next == it); |
| 1084 | it->m_previous->m_next = it->m_next; |
| 1085 | } else { |
| 1086 | ASSERT(it->m_table->m_iterators == it); |
| 1087 | it->m_table->m_iterators = it->m_next; |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | it->m_table = 0; |
| 1092 | it->m_next = 0; |
| 1093 | it->m_previous = 0; |
| 1094 | } |
| 1095 | |
| 1096 | #endif // CHECK_HASHTABLE_ITERATORS |
| 1097 | |
| 1098 | // iterator adapters |
| 1099 | |
| 1100 | template<typename HashTableType, typename ValueType> struct HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter# { |
| 1101 | HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#`HashTableConstIteratorAdapter<HashTableType, ValueType>`(fc037751a2d5d586).(const typename HashTableType::const_iterator& impl) : m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl.(impl) {} |
| 1102 | |
| 1103 | const ValueType* getcxx . . $ QTWTF/HashTableConstIteratorAdapter#get(32bc73b8cd924efb).() const { return (const ValueType*)m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl..get(); } |
| 1104 | const ValueType& operatorcxx . . $ QTWTF/HashTableConstIteratorAdapter#`operator*`(bdbd05d619d62250).*() const { return *getcxx . . $ QTWTF/HashTableConstIteratorAdapter#get(32bc73b8cd924efb).(); } |
| 1105 | const ValueType* operatorcxx . . $ QTWTF/HashTableConstIteratorAdapter#`operator->`(32bc73b8cd924efb).->() const { return getcxx . . $ QTWTF/HashTableConstIteratorAdapter#get(32bc73b8cd924efb).(); } |
| 1106 | |
| 1107 | HashTableConstIteratorAdapter& operatorcxx . . $ QTWTF/HashTableConstIteratorAdapter#operator++(287c668a392cce23).++() { ++m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl.; return *this; } |
| 1108 | // postfix ++ intentionally omitted |
| 1109 | |
| 1110 | typename HashTableType::const_iterator m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl.; |
| 1111 | }; |
| 1112 | |
| 1113 | template<typename HashTableType, typename ValueType> struct HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter# { |
| 1114 | HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter#`HashTableIteratorAdapter<HashTableType, ValueType>`(b67e1f7289adcf5d).(const typename HashTableType::iterator& impl) : m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.(impl) {} |
| 1115 | |
| 1116 | ValueType* getcxx . . $ QTWTF/HashTableIteratorAdapter#get(1d1e4aba2bba624b).() const { return (ValueType*)m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl..get(); } |
| 1117 | ValueType& operatorcxx . . $ QTWTF/HashTableIteratorAdapter#`operator*`(51f62fb05f27f6a2).*() const { return *getcxx . . $ QTWTF/HashTableIteratorAdapter#get(1d1e4aba2bba624b).(); } |
| 1118 | ValueType* operatorcxx . . $ QTWTF/HashTableIteratorAdapter#`operator->`(1d1e4aba2bba624b).->() const { return getcxx . . $ QTWTF/HashTableIteratorAdapter#get(1d1e4aba2bba624b).(); } |
| 1119 | |
| 1120 | HashTableIteratorAdapter& operatorcxx . . $ QTWTF/HashTableIteratorAdapter#operator++(d8d094d0949feb44).++() { ++m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.; return *this; } |
| 1121 | // postfix ++ intentionally omitted |
| 1122 | |
| 1123 | operatorcxx . . $ QTWTF/HashTableIteratorAdapter#`operator HashTableConstIteratorAdapter<type-parameter-0-0, type-parameter-0-1>`(3fb9f48b1c613aae). HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#<HashTableType, ValueType>() { |
| 1124 | typename HashTableType::const_iterator i = m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.; |
| 1125 | return i; |
| 1126 | } |
| 1127 | |
| 1128 | typename HashTableType::iterator m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.; |
| 1129 | }; |
| 1130 | |
| 1131 | template<typename T, typename U> |
| 1132 | inline bool operatorcxx . . $ QTWTF/`operator==`(a84e0eb909a2e1ac).==(const HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#<T, U>& a, const HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#<T, U>& b) |
| 1133 | { |
| 1134 | return a.m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl. ==cxx . . $ QTWTF/`operator==`(f838b2bc7e5b4b06). b.m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl.; |
| 1135 | } |
| 1136 | |
| 1137 | template<typename T, typename U> |
| 1138 | inline bool operatorcxx . . $ QTWTF/`operator!=`(a84e0eb909a2e1ac).!=(const HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#<T, U>& a, const HashTableConstIteratorAdaptercxx . . $ QTWTF/HashTableConstIteratorAdapter#<T, U>& b) |
| 1139 | { |
| 1140 | return a.m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl. !=cxx . . $ QTWTF/`operator!=`(74c38ce5a82188a5). b.m_implcxx . . $ QTWTF/HashTableConstIteratorAdapter#m_impl.; |
| 1141 | } |
| 1142 | |
| 1143 | template<typename T, typename U> |
| 1144 | inline bool operatorcxx . . $ QTWTF/`operator==`(d9a25fe16b4fb2f8).==(const HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter#<T, U>& a, const HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter#<T, U>& b) |
| 1145 | { |
| 1146 | return a.m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl. ==cxx . . $ QTWTF/`operator==`(e47811f5710122ad). b.m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.; |
| 1147 | } |
| 1148 | |
| 1149 | template<typename T, typename U> |
| 1150 | inline bool operatorcxx . . $ QTWTF/`operator!=`(d9a25fe16b4fb2f8).!=(const HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter#<T, U>& a, const HashTableIteratorAdaptercxx . . $ QTWTF/HashTableIteratorAdapter#<T, U>& b) |
| 1151 | { |
| 1152 | return a.m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl. !=cxx . . $ QTWTF/`operator!=`(d9a25fe16b4fb2f8). b.m_implcxx . . $ QTWTF/HashTableIteratorAdapter#m_impl.; |
| 1153 | } |
| 1154 | |
| 1155 | } // namespace WTF |
| 1156 | |
| 1157 | #include "HashIterators.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashIterators.h`/ |
| 1158 | |
| 1159 | #endif // WTF_HashTable_h |