mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8214029: Remove dead code BasicHashtable::bulk_free_entries
Reviewed-by: dholmes
This commit is contained in:
parent
1d01b4d22f
commit
52664cb14a
2 changed files with 0 additions and 49 deletions
|
@ -107,36 +107,6 @@ template <MEMFLAGS F> void BasicHashtable<F>::free_buckets() {
|
|||
}
|
||||
}
|
||||
|
||||
template <MEMFLAGS F> void BasicHashtable<F>::BucketUnlinkContext::free_entry(BasicHashtableEntry<F>* entry) {
|
||||
entry->set_next(_removed_head);
|
||||
_removed_head = entry;
|
||||
if (_removed_tail == NULL) {
|
||||
_removed_tail = entry;
|
||||
}
|
||||
_num_removed++;
|
||||
}
|
||||
|
||||
template <MEMFLAGS F> void BasicHashtable<F>::bulk_free_entries(BucketUnlinkContext* context) {
|
||||
if (context->_num_removed == 0) {
|
||||
assert(context->_removed_head == NULL && context->_removed_tail == NULL,
|
||||
"Zero entries in the unlink context, but elements linked from " PTR_FORMAT " to " PTR_FORMAT,
|
||||
p2i(context->_removed_head), p2i(context->_removed_tail));
|
||||
return;
|
||||
}
|
||||
|
||||
// MT-safe add of the list of BasicHashTableEntrys from the context to the free list.
|
||||
BasicHashtableEntry<F>* current = _free_list;
|
||||
while (true) {
|
||||
context->_removed_tail->set_next(current);
|
||||
BasicHashtableEntry<F>* old = Atomic::cmpxchg(context->_removed_head, &_free_list, current);
|
||||
if (old == current) {
|
||||
break;
|
||||
}
|
||||
current = old;
|
||||
}
|
||||
Atomic::add(-context->_num_removed, &_number_of_entries);
|
||||
}
|
||||
|
||||
// For oops and Strings the size of the literal is interesting. For other types, nobody cares.
|
||||
static int literal_size(ConstantPool*) { return 0; }
|
||||
static int literal_size(Klass*) { return 0; }
|
||||
|
|
|
@ -204,25 +204,6 @@ protected:
|
|||
|
||||
// Free the buckets in this hashtable
|
||||
void free_buckets();
|
||||
|
||||
// Helper data structure containing context for the bucket entry unlink process,
|
||||
// storing the unlinked buckets in a linked list.
|
||||
// Also avoids the need to pass around these four members as parameters everywhere.
|
||||
struct BucketUnlinkContext {
|
||||
int _num_processed;
|
||||
int _num_removed;
|
||||
// Head and tail pointers for the linked list of removed entries.
|
||||
BasicHashtableEntry<F>* _removed_head;
|
||||
BasicHashtableEntry<F>* _removed_tail;
|
||||
|
||||
BucketUnlinkContext() : _num_processed(0), _num_removed(0), _removed_head(NULL), _removed_tail(NULL) {
|
||||
}
|
||||
|
||||
void free_entry(BasicHashtableEntry<F>* entry);
|
||||
};
|
||||
// Add of bucket entries linked together in the given context to the global free list. This method
|
||||
// is mt-safe wrt. to other calls of this method.
|
||||
void bulk_free_entries(BucketUnlinkContext* context);
|
||||
public:
|
||||
int table_size() const { return _table_size; }
|
||||
void set_entry(int index, BasicHashtableEntry<F>* entry);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue