8372179: Remove Unused ConcurrentHashTable::MultiGetHandle

Reviewed-by: dholmes, iwalulya
This commit is contained in:
Thomas Schatzl 2025-12-03 13:36:55 +00:00
parent afb6a0c2fe
commit 135661b438
3 changed files with 3 additions and 37 deletions

View File

@ -451,8 +451,7 @@ class ConcurrentHashTable : public CHeapObj<MT> {
// All callbacks for get are under critical sections. Other callbacks may be
// under critical section or may have locked parts of table. Calling any
// methods on the table during a callback is not supported.Only MultiGetHandle
// supports multiple gets.
// methods on the table during a callback is not supported.
// Get methods return true on found item with LOOKUP_FUNC and FOUND_FUNC is
// called.
@ -538,18 +537,6 @@ class ConcurrentHashTable : public CHeapObj<MT> {
// Must be done at a safepoint.
void rehash_nodes_to(Thread* thread, ConcurrentHashTable<CONFIG, MT>* to_cht);
// Scoped multi getter.
class MultiGetHandle : private ScopedCS {
public:
MultiGetHandle(Thread* thread, ConcurrentHashTable<CONFIG, MT>* cht)
: ScopedCS(thread, cht) {}
// In the MultiGetHandle scope you can lookup items matching LOOKUP_FUNC.
// The VALUEs are safe as long as you never save the VALUEs outside the
// scope, e.g. after ~MultiGetHandle().
template <typename LOOKUP_FUNC>
VALUE* get(LOOKUP_FUNC& lookup_f, bool* grow_hint = nullptr);
};
private:
class BucketsOperation;

View File

@ -233,14 +233,6 @@ inline ConcurrentHashTable<CONFIG, MT>::
GlobalCounter::critical_section_end(_thread, _cs_context);
}
template <typename CONFIG, MemTag MT>
template <typename LOOKUP_FUNC>
inline typename CONFIG::Value* ConcurrentHashTable<CONFIG, MT>::
MultiGetHandle::get(LOOKUP_FUNC& lookup_f, bool* grow_hint)
{
return ScopedCS::_cht->internal_get(ScopedCS::_thread, lookup_f, grow_hint);
}
// HaveDeletables
template <typename CONFIG, MemTag MT>
template <typename EVALUATE_FUNC>

View File

@ -97,7 +97,6 @@ struct Config : public AllStatic {
};
typedef ConcurrentHashTable<Pointer, mtInternal> SimpleTestTable;
typedef ConcurrentHashTable<Pointer, mtInternal>::MultiGetHandle SimpleTestGetHandle;
typedef ConcurrentHashTable<Config, mtInternal> CustomTestTable;
struct SimpleTestLookup {
@ -345,10 +344,6 @@ static void cht_scope(Thread* thr) {
SimpleTestLookup stl(val);
SimpleTestTable* cht = new SimpleTestTable();
EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed.";
{
SimpleTestGetHandle get_handle(thr, cht);
EXPECT_EQ(*get_handle.get(stl), val) << "Getting a pre-existing value failed.";
}
// We do remove here to make sure the value-handle 'unlocked' the table when leaving the scope.
EXPECT_TRUE(cht->remove(thr, stl)) << "Removing a pre-existing value failed.";
EXPECT_FALSE(cht_get_copy(cht, thr, stl) == val) << "Got a removed value.";
@ -556,7 +551,6 @@ public:
};
typedef ConcurrentHashTable<TestInterface, mtInternal> TestTable;
typedef ConcurrentHashTable<TestInterface, mtInternal>::MultiGetHandle TestGetHandle;
struct TestLookup {
uintptr_t _val;
@ -788,15 +782,8 @@ public:
bool test_loop() {
for (uintptr_t v = 0x1; v < 0xFFF; v++ ) {
uintptr_t tv;
if (v & 0x1) {
TestLookup tl(v);
tv = cht_get_copy(_cht, this, tl);
} else {
TestLookup tl(v);
TestGetHandle value_handle(this, _cht);
uintptr_t* tmp = value_handle.get(tl);
tv = tmp != nullptr ? *tmp : 0;
}
TestLookup tl(v);
tv = cht_get_copy(_cht, this, tl);
EXPECT_TRUE(tv == 0 || tv == v) << "Got unknown value.";
}
return true;