diff -r 13588c901957 -r 9cf78a70fa4f src/hotspot/share/prims/resolvedMethodTable.cpp --- a/src/hotspot/share/prims/resolvedMethodTable.cpp Thu Oct 17 20:27:44 2019 +0100 +++ b/src/hotspot/share/prims/resolvedMethodTable.cpp Thu Oct 17 20:53:35 2019 +0100 @@ -25,13 +25,14 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" #include "gc/shared/oopStorage.inline.hpp" +#include "gc/shared/oopStorageSet.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/access.inline.hpp" +#include "oops/method.hpp" #include "oops/oop.inline.hpp" -#include "oops/method.hpp" #include "oops/weakHandle.inline.hpp" #include "prims/resolvedMethodTable.hpp" #include "runtime/handles.inline.hpp" @@ -56,15 +57,15 @@ return name_hash ^ signature_hash; } -typedef ConcurrentHashTable, - ResolvedMethodTableConfig, +typedef ConcurrentHashTable ResolvedMethodTableHash; -class ResolvedMethodTableConfig : public ResolvedMethodTableHash::BaseConfig { +class ResolvedMethodTableConfig : public AllStatic { private: public: - static uintx get_hash(WeakHandle const& value, - bool* is_dead) { + typedef WeakHandle Value; + + static uintx get_hash(Value const& value, bool* is_dead) { oop val_oop = value.peek(); if (val_oop == NULL) { *is_dead = true; @@ -76,13 +77,13 @@ } // We use default allocation/deallocation but counted - static void* allocate_node(size_t size, WeakHandle const& value) { + static void* allocate_node(size_t size, Value const& value) { ResolvedMethodTable::item_added(); - return ResolvedMethodTableHash::BaseConfig::allocate_node(size, value); + return AllocateHeap(size, mtClass); } - static void free_node(void* memory, WeakHandle const& value) { + static void free_node(void* memory, Value const& value) { value.release(); - ResolvedMethodTableHash::BaseConfig::free_node(memory, value); + FreeHeap(memory); ResolvedMethodTable::item_removed(); } }; @@ -90,7 +91,6 @@ static ResolvedMethodTableHash* _local_table = NULL; static size_t _current_size = (size_t)1 << ResolvedMethodTableSizeLog; -OopStorage* ResolvedMethodTable::_weak_handles = NULL; volatile bool ResolvedMethodTable::_has_work = false; volatile size_t _items_count = 0; @@ -98,9 +98,6 @@ void ResolvedMethodTable::create_table() { _local_table = new ResolvedMethodTableHash(ResolvedMethodTableSizeLog, END_SIZE, GROW_HINT); - _weak_handles = new OopStorage("ResolvedMethodTable weak", - ResolvedMethodTableWeakAlloc_lock, - ResolvedMethodTableWeakActive_lock); log_trace(membername, table)("Start size: " SIZE_FORMAT " (" SIZE_FORMAT ")", _current_size, ResolvedMethodTableSizeLog); }