Skip to content

Commit 135661b

Browse files
author
Thomas Schatzl
committed
8372179: Remove Unused ConcurrentHashTable::MultiGetHandle
Reviewed-by: dholmes, iwalulya
1 parent afb6a0c commit 135661b

File tree

3 files changed

+3
-37
lines changed

3 files changed

+3
-37
lines changed

src/hotspot/share/utilities/concurrentHashTable.hpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,7 @@ class ConcurrentHashTable : public CHeapObj<MT> {
451451

452452
// All callbacks for get are under critical sections. Other callbacks may be
453453
// under critical section or may have locked parts of table. Calling any
454-
// methods on the table during a callback is not supported.Only MultiGetHandle
455-
// supports multiple gets.
454+
// methods on the table during a callback is not supported.
456455

457456
// Get methods return true on found item with LOOKUP_FUNC and FOUND_FUNC is
458457
// called.
@@ -538,18 +537,6 @@ class ConcurrentHashTable : public CHeapObj<MT> {
538537
// Must be done at a safepoint.
539538
void rehash_nodes_to(Thread* thread, ConcurrentHashTable<CONFIG, MT>* to_cht);
540539

541-
// Scoped multi getter.
542-
class MultiGetHandle : private ScopedCS {
543-
public:
544-
MultiGetHandle(Thread* thread, ConcurrentHashTable<CONFIG, MT>* cht)
545-
: ScopedCS(thread, cht) {}
546-
// In the MultiGetHandle scope you can lookup items matching LOOKUP_FUNC.
547-
// The VALUEs are safe as long as you never save the VALUEs outside the
548-
// scope, e.g. after ~MultiGetHandle().
549-
template <typename LOOKUP_FUNC>
550-
VALUE* get(LOOKUP_FUNC& lookup_f, bool* grow_hint = nullptr);
551-
};
552-
553540
private:
554541
class BucketsOperation;
555542

src/hotspot/share/utilities/concurrentHashTable.inline.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,6 @@ inline ConcurrentHashTable<CONFIG, MT>::
233233
GlobalCounter::critical_section_end(_thread, _cs_context);
234234
}
235235

236-
template <typename CONFIG, MemTag MT>
237-
template <typename LOOKUP_FUNC>
238-
inline typename CONFIG::Value* ConcurrentHashTable<CONFIG, MT>::
239-
MultiGetHandle::get(LOOKUP_FUNC& lookup_f, bool* grow_hint)
240-
{
241-
return ScopedCS::_cht->internal_get(ScopedCS::_thread, lookup_f, grow_hint);
242-
}
243-
244236
// HaveDeletables
245237
template <typename CONFIG, MemTag MT>
246238
template <typename EVALUATE_FUNC>

test/hotspot/gtest/utilities/test_concurrentHashtable.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ struct Config : public AllStatic {
9797
};
9898

9999
typedef ConcurrentHashTable<Pointer, mtInternal> SimpleTestTable;
100-
typedef ConcurrentHashTable<Pointer, mtInternal>::MultiGetHandle SimpleTestGetHandle;
101100
typedef ConcurrentHashTable<Config, mtInternal> CustomTestTable;
102101

103102
struct SimpleTestLookup {
@@ -345,10 +344,6 @@ static void cht_scope(Thread* thr) {
345344
SimpleTestLookup stl(val);
346345
SimpleTestTable* cht = new SimpleTestTable();
347346
EXPECT_TRUE(cht->insert(thr, stl, val)) << "Insert unique value failed.";
348-
{
349-
SimpleTestGetHandle get_handle(thr, cht);
350-
EXPECT_EQ(*get_handle.get(stl), val) << "Getting a pre-existing value failed.";
351-
}
352347
// We do remove here to make sure the value-handle 'unlocked' the table when leaving the scope.
353348
EXPECT_TRUE(cht->remove(thr, stl)) << "Removing a pre-existing value failed.";
354349
EXPECT_FALSE(cht_get_copy(cht, thr, stl) == val) << "Got a removed value.";
@@ -556,7 +551,6 @@ class TestInterface : public AllStatic {
556551
};
557552

558553
typedef ConcurrentHashTable<TestInterface, mtInternal> TestTable;
559-
typedef ConcurrentHashTable<TestInterface, mtInternal>::MultiGetHandle TestGetHandle;
560554

561555
struct TestLookup {
562556
uintptr_t _val;
@@ -788,15 +782,8 @@ class RunnerDeleteInserterThread : public CHTTestThread {
788782
bool test_loop() {
789783
for (uintptr_t v = 0x1; v < 0xFFF; v++ ) {
790784
uintptr_t tv;
791-
if (v & 0x1) {
792-
TestLookup tl(v);
793-
tv = cht_get_copy(_cht, this, tl);
794-
} else {
795-
TestLookup tl(v);
796-
TestGetHandle value_handle(this, _cht);
797-
uintptr_t* tmp = value_handle.get(tl);
798-
tv = tmp != nullptr ? *tmp : 0;
799-
}
785+
TestLookup tl(v);
786+
tv = cht_get_copy(_cht, this, tl);
800787
EXPECT_TRUE(tv == 0 || tv == v) << "Got unknown value.";
801788
}
802789
return true;

0 commit comments

Comments
 (0)