author | stefank |
Mon, 25 Nov 2019 12:33:15 +0100 | |
changeset 59252 | 623722a6aeb9 |
parent 54764 | 865ec913f916 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52688
diff
changeset
|
2 |
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52688
diff
changeset
|
25 |
#ifndef SHARE_UTILITIES_HASHTABLE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52688
diff
changeset
|
26 |
#define SHARE_UTILITIES_HASHTABLE_HPP |
7397 | 27 |
|
28 |
#include "memory/allocation.hpp" |
|
29 |
#include "oops/oop.hpp" |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
30 |
#include "oops/symbol.hpp" |
7397 | 31 |
#include "runtime/handles.hpp" |
52631
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
32 |
#include "utilities/growableArray.hpp" |
54764 | 33 |
#include "utilities/tableStatistics.hpp" |
7397 | 34 |
|
1 | 35 |
// This is a generic hashtable, designed to be used for the symbol |
36 |
// and string tables. |
|
37 |
// |
|
38 |
// It is implemented as an open hash table with a fixed number of buckets. |
|
39 |
// |
|
40 |
// %note: |
|
41 |
// - TableEntrys are allocated in blocks to reduce the space overhead. |
|
42 |
||
43 |
||
44 |
||
13195 | 45 |
template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> { |
1 | 46 |
friend class VMStructs; |
47 |
private: |
|
48 |
unsigned int _hash; // 32-bit hash for item |
|
49 |
||
50 |
// Link to next element in the linked list for this bucket. EXCEPT |
|
51 |
// bit 0 set indicates that this entry is shared and must not be |
|
52 |
// unlinked from the table. Bit 0 is set during the dumping of the |
|
53 |
// archive. Since shared entries are immutable, _next fields in the |
|
54 |
// shared entries will not change. New entries will always be |
|
55 |
// unshared and since pointers are align, bit 0 will always remain 0 |
|
56 |
// with no extra effort. |
|
13195 | 57 |
BasicHashtableEntry<F>* _next; |
1 | 58 |
|
59 |
// Windows IA64 compiler requires subclasses to be able to access these |
|
60 |
protected: |
|
61 |
// Entry objects should not be created, they should be taken from the |
|
62 |
// free list with BasicHashtable.new_entry(). |
|
63 |
BasicHashtableEntry() { ShouldNotReachHere(); } |
|
64 |
// Entry objects should not be destroyed. They should be placed on |
|
65 |
// the free list instead with BasicHashtable.free_entry(). |
|
66 |
~BasicHashtableEntry() { ShouldNotReachHere(); } |
|
67 |
||
68 |
public: |
|
69 |
||
70 |
unsigned int hash() const { return _hash; } |
|
71 |
void set_hash(unsigned int hash) { _hash = hash; } |
|
72 |
unsigned int* hash_addr() { return &_hash; } |
|
73 |
||
13195 | 74 |
static BasicHashtableEntry<F>* make_ptr(BasicHashtableEntry<F>* p) { |
1 | 75 |
return (BasicHashtableEntry*)((intptr_t)p & -2); |
76 |
} |
|
77 |
||
13195 | 78 |
BasicHashtableEntry<F>* next() const { |
1 | 79 |
return make_ptr(_next); |
80 |
} |
|
81 |
||
13195 | 82 |
void set_next(BasicHashtableEntry<F>* next) { |
1 | 83 |
_next = next; |
84 |
} |
|
85 |
||
13195 | 86 |
BasicHashtableEntry<F>** next_addr() { |
1 | 87 |
return &_next; |
88 |
} |
|
89 |
||
90 |
bool is_shared() const { |
|
91 |
return ((intptr_t)_next & 1) != 0; |
|
92 |
} |
|
93 |
||
94 |
void set_shared() { |
|
13195 | 95 |
_next = (BasicHashtableEntry<F>*)((intptr_t)_next | 1); |
1 | 96 |
} |
97 |
}; |
|
98 |
||
99 |
||
100 |
||
13195 | 101 |
template <class T, MEMFLAGS F> class HashtableEntry : public BasicHashtableEntry<F> { |
1 | 102 |
friend class VMStructs; |
103 |
private: |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
104 |
T _literal; // ref to item in table. |
1 | 105 |
|
106 |
public: |
|
107 |
// Literal |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
108 |
T literal() const { return _literal; } |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
109 |
T* literal_addr() { return &_literal; } |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
110 |
void set_literal(T s) { _literal = s; } |
1 | 111 |
|
112 |
HashtableEntry* next() const { |
|
13195 | 113 |
return (HashtableEntry*)BasicHashtableEntry<F>::next(); |
1 | 114 |
} |
115 |
HashtableEntry** next_addr() { |
|
13195 | 116 |
return (HashtableEntry**)BasicHashtableEntry<F>::next_addr(); |
1 | 117 |
} |
118 |
}; |
|
119 |
||
120 |
||
121 |
||
13195 | 122 |
template <MEMFLAGS F> class HashtableBucket : public CHeapObj<F> { |
1 | 123 |
friend class VMStructs; |
124 |
private: |
|
125 |
// Instance variable |
|
13195 | 126 |
BasicHashtableEntry<F>* _entry; |
1 | 127 |
|
128 |
public: |
|
129 |
// Accessing |
|
46475
75902cea18af
8166848: Performance bug: SystemDictionary - optimization
coleenp
parents:
46435
diff
changeset
|
130 |
void clear() { _entry = NULL; } |
1 | 131 |
|
132 |
// The following methods use order access methods to avoid race |
|
133 |
// conditions in multiprocessor systems. |
|
13195 | 134 |
BasicHashtableEntry<F>* get_entry() const; |
135 |
void set_entry(BasicHashtableEntry<F>* l); |
|
1 | 136 |
|
137 |
// The following method is not MT-safe and must be done under lock. |
|
13195 | 138 |
BasicHashtableEntry<F>** entry_addr() { return &_entry; } |
39982
1a3808e3f4d9
8138760: [JVMCI] VM warning: Performance bug: SystemDictionary lookup_count=21831450 lookup_length=1275207287 average=58.411479 load=5.572844
gziemski
parents:
34666
diff
changeset
|
139 |
|
1 | 140 |
}; |
141 |
||
142 |
||
13195 | 143 |
template <MEMFLAGS F> class BasicHashtable : public CHeapObj<F> { |
1 | 144 |
friend class VMStructs; |
145 |
||
146 |
public: |
|
147 |
BasicHashtable(int table_size, int entry_size); |
|
148 |
BasicHashtable(int table_size, int entry_size, |
|
13195 | 149 |
HashtableBucket<F>* buckets, int number_of_entries); |
52631
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
150 |
~BasicHashtable(); |
1 | 151 |
|
152 |
// Bucket handling |
|
34666 | 153 |
int hash_to_index(unsigned int full_hash) const { |
1 | 154 |
int h = full_hash % _table_size; |
155 |
assert(h >= 0 && h < _table_size, "Illegal hash value"); |
|
156 |
return h; |
|
157 |
} |
|
158 |
||
159 |
private: |
|
160 |
// Instance variables |
|
161 |
int _table_size; |
|
13195 | 162 |
HashtableBucket<F>* _buckets; |
45114
45644c5f6b8e
8180048: Interned string and symbol table leak memory during parallel unlinking
tschatzl
parents:
42073
diff
changeset
|
163 |
BasicHashtableEntry<F>* volatile _free_list; |
1 | 164 |
char* _first_free_entry; |
165 |
char* _end_block; |
|
166 |
int _entry_size; |
|
45114
45644c5f6b8e
8180048: Interned string and symbol table leak memory during parallel unlinking
tschatzl
parents:
42073
diff
changeset
|
167 |
volatile int _number_of_entries; |
52631
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
168 |
GrowableArray<char*>* _entry_blocks; |
1 | 169 |
|
170 |
protected: |
|
171 |
||
54764 | 172 |
TableRateStatistics _stats_rate; |
173 |
||
1 | 174 |
void initialize(int table_size, int entry_size, int number_of_entries); |
175 |
||
176 |
// Accessor |
|
177 |
int entry_size() const { return _entry_size; } |
|
178 |
||
179 |
// The following method is MT-safe and may be used with caution. |
|
34666 | 180 |
BasicHashtableEntry<F>* bucket(int i) const; |
1 | 181 |
|
182 |
// The following method is not MT-safe and must be done under lock. |
|
13195 | 183 |
BasicHashtableEntry<F>** bucket_addr(int i) { return _buckets[i].entry_addr(); } |
1 | 184 |
|
26421
37d88e604ad0
8056084: Refactor Hashtable to allow implementations without rehashing support
mgerdin
parents:
23187
diff
changeset
|
185 |
// Attempt to get an entry from the free list |
37d88e604ad0
8056084: Refactor Hashtable to allow implementations without rehashing support
mgerdin
parents:
23187
diff
changeset
|
186 |
BasicHashtableEntry<F>* new_entry_free_list(); |
37d88e604ad0
8056084: Refactor Hashtable to allow implementations without rehashing support
mgerdin
parents:
23187
diff
changeset
|
187 |
|
1 | 188 |
// Table entry management |
13195 | 189 |
BasicHashtableEntry<F>* new_entry(unsigned int hashValue); |
1 | 190 |
|
13087 | 191 |
// Used when moving the entry to another table |
192 |
// Clean up links, but do not add to free_list |
|
13195 | 193 |
void unlink_entry(BasicHashtableEntry<F>* entry) { |
13087 | 194 |
entry->set_next(NULL); |
195 |
--_number_of_entries; |
|
196 |
} |
|
197 |
||
198 |
// Move over freelist and free block for allocation |
|
199 |
void copy_freelist(BasicHashtable* src) { |
|
200 |
_free_list = src->_free_list; |
|
201 |
src->_free_list = NULL; |
|
202 |
_first_free_entry = src->_first_free_entry; |
|
203 |
src->_first_free_entry = NULL; |
|
204 |
_end_block = src->_end_block; |
|
205 |
src->_end_block = NULL; |
|
206 |
} |
|
207 |
||
208 |
// Free the buckets in this hashtable |
|
13097
c146b608d91f
7178670: runtime/7158800/BadUtf8.java fails in SymbolTable::rehash_table
coleenp
parents:
13087
diff
changeset
|
209 |
void free_buckets(); |
1 | 210 |
public: |
46742 | 211 |
int table_size() const { return _table_size; } |
13195 | 212 |
void set_entry(int index, BasicHashtableEntry<F>* entry); |
1 | 213 |
|
13195 | 214 |
void add_entry(int index, BasicHashtableEntry<F>* entry); |
1 | 215 |
|
13195 | 216 |
void free_entry(BasicHashtableEntry<F>* entry); |
1 | 217 |
|
46742 | 218 |
int number_of_entries() const { return _number_of_entries; } |
1 | 219 |
|
47774 | 220 |
bool resize(int new_size); |
221 |
||
52631
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
222 |
// Grow the number of buckets if the average entries per bucket is over the load_factor |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
223 |
bool maybe_grow(int max_size, int load_factor = 8); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
224 |
|
46475
75902cea18af
8166848: Performance bug: SystemDictionary - optimization
coleenp
parents:
46435
diff
changeset
|
225 |
template <class T> void verify_table(const char* table_name) PRODUCT_RETURN; |
1 | 226 |
}; |
227 |
||
228 |
||
13195 | 229 |
template <class T, MEMFLAGS F> class Hashtable : public BasicHashtable<F> { |
1 | 230 |
friend class VMStructs; |
231 |
||
232 |
public: |
|
233 |
Hashtable(int table_size, int entry_size) |
|
13195 | 234 |
: BasicHashtable<F>(table_size, entry_size) { } |
1 | 235 |
|
236 |
Hashtable(int table_size, int entry_size, |
|
13195 | 237 |
HashtableBucket<F>* buckets, int number_of_entries) |
238 |
: BasicHashtable<F>(table_size, entry_size, buckets, number_of_entries) { } |
|
1 | 239 |
|
240 |
// Debugging |
|
241 |
void print() PRODUCT_RETURN; |
|
242 |
||
46729 | 243 |
unsigned int compute_hash(const Symbol* name) const { |
1 | 244 |
return (unsigned int) name->identity_hash(); |
245 |
} |
|
246 |
||
46729 | 247 |
int index_for(const Symbol* name) const { |
13342
76a5de64aa62
7186278: Build error after CR#6995781 / 7151532 with GCC 4.7.0
andrew
parents:
13199
diff
changeset
|
248 |
return this->hash_to_index(compute_hash(name)); |
1 | 249 |
} |
250 |
||
54764 | 251 |
TableStatistics statistics_calculate(T (*literal_load_barrier)(HashtableEntry<T, F>*) = NULL); |
50233 | 252 |
void print_table_statistics(outputStream* st, const char *table_name, T (*literal_load_barrier)(HashtableEntry<T, F>*) = NULL); |
46742 | 253 |
|
254 |
protected: |
|
46729 | 255 |
|
1 | 256 |
// Table entry management |
13195 | 257 |
HashtableEntry<T, F>* new_entry(unsigned int hashValue, T obj); |
46729 | 258 |
// Don't create and use freelist of HashtableEntry. |
259 |
HashtableEntry<T, F>* allocate_new_entry(unsigned int hashValue, T obj); |
|
1 | 260 |
|
261 |
// The following method is MT-safe and may be used with caution. |
|
34666 | 262 |
HashtableEntry<T, F>* bucket(int i) const { |
13195 | 263 |
return (HashtableEntry<T, F>*)BasicHashtable<F>::bucket(i); |
1 | 264 |
} |
265 |
||
266 |
// The following method is not MT-safe and must be done under lock. |
|
13195 | 267 |
HashtableEntry<T, F>** bucket_addr(int i) { |
268 |
return (HashtableEntry<T, F>**)BasicHashtable<F>::bucket_addr(i); |
|
1 | 269 |
} |
26421
37d88e604ad0
8056084: Refactor Hashtable to allow implementations without rehashing support
mgerdin
parents:
23187
diff
changeset
|
270 |
}; |
37d88e604ad0
8056084: Refactor Hashtable to allow implementations without rehashing support
mgerdin
parents:
23187
diff
changeset
|
271 |
|
52631
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
272 |
// A subclass of BasicHashtable that allows you to do a simple K -> V mapping |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
273 |
// without using tons of boilerplate code. |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
274 |
template< |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
275 |
typename K, typename V, MEMFLAGS F, |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
276 |
unsigned (*HASH) (K const&) = primitive_hash<K>, |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
277 |
bool (*EQUALS)(K const&, K const&) = primitive_equals<K> |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
278 |
> |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
279 |
class KVHashtable : public BasicHashtable<F> { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
280 |
class KVHashtableEntry : public BasicHashtableEntry<F> { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
281 |
public: |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
282 |
K _key; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
283 |
V _value; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
284 |
KVHashtableEntry* next() { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
285 |
return (KVHashtableEntry*)BasicHashtableEntry<F>::next(); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
286 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
287 |
}; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
288 |
|
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
289 |
protected: |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
290 |
KVHashtableEntry* bucket(int i) const { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
291 |
return (KVHashtableEntry*)BasicHashtable<F>::bucket(i); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
292 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
293 |
|
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
294 |
KVHashtableEntry* new_entry(unsigned int hashValue, K key, V value) { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
295 |
KVHashtableEntry* entry = (KVHashtableEntry*)BasicHashtable<F>::new_entry(hashValue); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
296 |
entry->_key = key; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
297 |
entry->_value = value; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
298 |
return entry; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
299 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
300 |
|
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
301 |
public: |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
302 |
KVHashtable(int table_size) : BasicHashtable<F>(table_size, sizeof(KVHashtableEntry)) {} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
303 |
|
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
304 |
void add(K key, V value) { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
305 |
unsigned int hash = HASH(key); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
306 |
KVHashtableEntry* entry = new_entry(hash, key, value); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
307 |
BasicHashtable<F>::add_entry(BasicHashtable<F>::hash_to_index(hash), entry); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
308 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
309 |
|
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
310 |
V* lookup(K key) { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
311 |
unsigned int hash = HASH(key); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
312 |
int index = BasicHashtable<F>::hash_to_index(hash); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
313 |
for (KVHashtableEntry* e = bucket(index); e != NULL; e = e->next()) { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
314 |
if (e->hash() == hash && e->_key == key) { |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
315 |
return &(e->_value); |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
316 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
317 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
318 |
return NULL; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
319 |
} |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
320 |
}; |
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
321 |
|
3009ca99de32
8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents:
52514
diff
changeset
|
322 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52688
diff
changeset
|
323 |
#endif // SHARE_UTILITIES_HASHTABLE_HPP |