From 135661b4389663b8c2e348d9e61e72cc628636bb Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 3 Dec 2025 13:36:55 +0000 Subject: [PATCH] 8372179: Remove Unused ConcurrentHashTable::MultiGetHandle Reviewed-by: dholmes, iwalulya --- .../share/utilities/concurrentHashTable.hpp | 15 +-------------- .../utilities/concurrentHashTable.inline.hpp | 8 -------- .../utilities/test_concurrentHashtable.cpp | 17 ++--------------- 3 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/hotspot/share/utilities/concurrentHashTable.hpp b/src/hotspot/share/utilities/concurrentHashTable.hpp index 48166b22126..a837a56a19a 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.hpp @@ -451,8 +451,7 @@ class ConcurrentHashTable : public CHeapObj { // 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 { // Must be done at a safepoint. void rehash_nodes_to(Thread* thread, ConcurrentHashTable* to_cht); - // Scoped multi getter. - class MultiGetHandle : private ScopedCS { - public: - MultiGetHandle(Thread* thread, ConcurrentHashTable* 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 - VALUE* get(LOOKUP_FUNC& lookup_f, bool* grow_hint = nullptr); - }; - private: class BucketsOperation; diff --git a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp index 908405d3617..eeaff0167b2 100644 --- a/src/hotspot/share/utilities/concurrentHashTable.inline.hpp +++ b/src/hotspot/share/utilities/concurrentHashTable.inline.hpp @@ -233,14 +233,6 @@ inline ConcurrentHashTable:: GlobalCounter::critical_section_end(_thread, _cs_context); } -template -template -inline typename CONFIG::Value* ConcurrentHashTable:: - MultiGetHandle::get(LOOKUP_FUNC& lookup_f, bool* grow_hint) -{ - return ScopedCS::_cht->internal_get(ScopedCS::_thread, lookup_f, grow_hint); -} - // HaveDeletables template template diff --git a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp index 927b5ff3d42..775f0e17409 100644 --- a/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp +++ b/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp @@ -97,7 +97,6 @@ struct Config : public AllStatic { }; typedef ConcurrentHashTable SimpleTestTable; -typedef ConcurrentHashTable::MultiGetHandle SimpleTestGetHandle; typedef ConcurrentHashTable 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 TestTable; -typedef ConcurrentHashTable::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;