Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 5a25cea

Browse files
author
Kim Barrett
committedFeb 20, 2021
8261998: Remove unused shared entry support from utilities/hashtable
Reviewed-by: coleenp, iklam
1 parent 4755958 commit 5a25cea

File tree

3 files changed

+5
-28
lines changed

3 files changed

+5
-28
lines changed
 

‎src/hotspot/share/prims/jvmtiTagMapTable.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void JvmtiTagMapTable::remove_dead_entries(JvmtiEnv* env, bool post_object_free)
215215

216216
}
217217
// get next entry
218-
entry = (JvmtiTagMapEntry*)HashtableEntry<WeakHandle, mtServiceability>::make_ptr(*p);
218+
entry = *p;
219219
}
220220
}
221221

@@ -252,7 +252,7 @@ void JvmtiTagMapTable::rehash() {
252252
p = entry->next_addr();
253253
}
254254
// get next entry
255-
entry = (JvmtiTagMapEntry*)HashtableEntry<WeakHandle, mtServiceability>::make_ptr(*p);
255+
entry = *p;
256256
}
257257
}
258258

‎src/hotspot/share/utilities/hashtable.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,10 @@ template <MEMFLAGS F> bool BasicHashtable<F>::resize(int new_size) {
179179
for (int index_old = 0; index_old < table_size_old; index_old++) {
180180
for (BasicHashtableEntry<F>* p = _buckets[index_old].get_entry(); p != NULL; ) {
181181
BasicHashtableEntry<F>* next = p->next();
182-
bool keep_shared = p->is_shared();
183182
int index_new = hash_to_index(p->hash());
184183

185184
p->set_next(buckets_new[index_new].get_entry());
186185
buckets_new[index_new].set_entry(p);
187-
188-
if (keep_shared) {
189-
p->set_shared();
190-
}
191186
p = next;
192187
}
193188
}

‎src/hotspot/share/utilities/hashtable.hpp

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -47,13 +47,7 @@ template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
4747
private:
4848
unsigned int _hash; // 32-bit hash for item
4949

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.
50+
// Link to next element in the linked list for this bucket.
5751
BasicHashtableEntry<F>* _next;
5852

5953
// Windows IA64 compiler requires subclasses to be able to access these
@@ -71,12 +65,8 @@ template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
7165
void set_hash(unsigned int hash) { _hash = hash; }
7266
unsigned int* hash_addr() { return &_hash; }
7367

74-
static BasicHashtableEntry<F>* make_ptr(BasicHashtableEntry<F>* p) {
75-
return (BasicHashtableEntry*)((intptr_t)p & -2);
76-
}
77-
7868
BasicHashtableEntry<F>* next() const {
79-
return make_ptr(_next);
69+
return _next;
8070
}
8171

8272
void set_next(BasicHashtableEntry<F>* next) {
@@ -86,14 +76,6 @@ template <MEMFLAGS F> class BasicHashtableEntry : public CHeapObj<F> {
8676
BasicHashtableEntry<F>** next_addr() {
8777
return &_next;
8878
}
89-
90-
bool is_shared() const {
91-
return ((intptr_t)_next & 1) != 0;
92-
}
93-
94-
void set_shared() {
95-
_next = (BasicHashtableEntry<F>*)((intptr_t)_next | 1);
96-
}
9779
};
9880

9981

0 commit comments

Comments
 (0)