Skip to content

8365264: Rename ResourceHashtable to HashTable #26729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/asm/codeBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ class CodeBuffer: public StackObj DEBUG_ONLY(COMMA private Scrubber) {
};

typedef LinkedListImpl<int> Offsets;
typedef ResizeableResourceHashtable<address, Offsets, AnyObj::C_HEAP, mtCompiler> SharedTrampolineRequests;
typedef ResizeableHashTable<address, Offsets, AnyObj::C_HEAP, mtCompiler> SharedTrampolineRequests;

private:
enum {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/aotArtifactFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "oops/instanceKlass.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/trainingData.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/hashtable.hpp"

// All the classes that should be included in the AOT cache (in at least the "allocated" state)
static GrowableArrayCHeap<Klass*, mtClassShared>* _all_cached_classes = nullptr;
Expand All @@ -47,7 +47,7 @@ static GrowableArrayCHeap<Klass*, mtClassShared>* _all_cached_classes = nullptr;
static GrowableArrayCHeap<InstanceKlass*, mtClassShared>* _pending_aot_inited_classes = nullptr;

static const int TABLE_SIZE = 15889; // prime number
using ClassesTable = ResourceHashtable<Klass*, bool, TABLE_SIZE, AnyObj::C_HEAP, mtClassShared>;
using ClassesTable = HashTable<Klass*, bool, TABLE_SIZE, AnyObj::C_HEAP, mtClassShared>;
static ClassesTable* _seen_classes; // all classes that have been seen by AOTArtifactFinder
static ClassesTable* _aot_inited_classes; // all classes that need to be AOT-initialized.

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/aotClassLinker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "oops/oopsHierarchy.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
#include "utilities/resourceHash.hpp"

class AOTLinkedClassTable;
class InstanceKlass;
Expand Down Expand Up @@ -69,7 +69,7 @@ enum class AOTLinkedClassCategory : int;
//
class AOTClassLinker : AllStatic {
static const int TABLE_SIZE = 15889; // prime number
using ClassesTable = ResourceHashtable<InstanceKlass*, bool, TABLE_SIZE, AnyObj::C_HEAP, mtClassShared>;
using ClassesTable = HashTable<InstanceKlass*, bool, TABLE_SIZE, AnyObj::C_HEAP, mtClassShared>;

// Classes loaded inside vmClasses::resolve_all()
static ClassesTable* _vm_classes;
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/aotConstantPoolResolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "oops/oopsHierarchy.hpp"
#include "runtime/handles.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
#include "utilities/resourceHash.hpp"

class ConstantPool;
class constantPoolHandle;
Expand All @@ -53,7 +53,7 @@ template <typename T> class GrowableArray;
// if all of its supertypes are loaded from the CDS archive.
class AOTConstantPoolResolver : AllStatic {
static const int TABLE_SIZE = 15889; // prime number
using ClassesTable = ResourceHashtable<InstanceKlass*, bool, TABLE_SIZE, AnyObj::C_HEAP, mtClassShared> ;
using ClassesTable = HashTable<InstanceKlass*, bool, TABLE_SIZE, AnyObj::C_HEAP, mtClassShared> ;
static ClassesTable* _processed_classes;

#ifdef ASSERT
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/aotReferenceObjSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "oops/oopHandle.inline.hpp"
#include "runtime/fieldDescriptor.inline.hpp"
#include "runtime/javaCalls.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/hashtable.hpp"

// Handling of java.lang.ref.Reference objects in the AOT cache
// ============================================================
Expand Down Expand Up @@ -92,7 +92,7 @@

#if INCLUDE_CDS_JAVA_HEAP

class KeepAliveObjectsTable : public ResourceHashtable<oop, bool,
class KeepAliveObjectsTable : public HashTable<oop, bool,
36137, // prime number
AnyObj::C_HEAP,
mtClassShared,
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/archiveBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include "runtime/os.hpp"
#include "utilities/bitMap.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/resizeableResourceHash.hpp"
#include "utilities/resourceHash.hpp"

class ArchiveHeapInfo;
class CHeapBitMap;
Expand Down Expand Up @@ -229,8 +229,8 @@ class ArchiveBuilder : public StackObj {

SourceObjList _rw_src_objs; // objs to put in rw region
SourceObjList _ro_src_objs; // objs to put in ro region
ResizeableResourceHashtable<address, SourceObjInfo, AnyObj::C_HEAP, mtClassShared> _src_obj_table;
ResizeableResourceHashtable<address, address, AnyObj::C_HEAP, mtClassShared> _buffered_to_src_table;
ResizeableHashTable<address, SourceObjInfo, AnyObj::C_HEAP, mtClassShared> _src_obj_table;
ResizeableHashTable<address, address, AnyObj::C_HEAP, mtClassShared> _buffered_to_src_table;
GrowableArray<Klass*>* _klasses;
GrowableArray<Symbol*>* _symbols;
unsigned int _entropy_seed;
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/archiveHeapLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ bool ArchiveHeapLoader::load_heap_region(FileMapInfo* mapinfo) {
}

class VerifyLoadedHeapEmbeddedPointers: public BasicOopIterateClosure {
ResourceHashtable<uintptr_t, bool>* _table;
HashTable<uintptr_t, bool>* _table;

public:
VerifyLoadedHeapEmbeddedPointers(ResourceHashtable<uintptr_t, bool>* table) : _table(table) {}
VerifyLoadedHeapEmbeddedPointers(HashTable<uintptr_t, bool>* table) : _table(table) {}

virtual void do_oop(narrowOop* p) {
// This should be called before the loaded region is modified, so all the embedded pointers
Expand Down Expand Up @@ -411,7 +411,7 @@ void ArchiveHeapLoader::verify_loaded_heap() {
log_info(aot, heap)("Verify all oops and pointers in loaded heap");

ResourceMark rm;
ResourceHashtable<uintptr_t, bool> table;
HashTable<uintptr_t, bool> table;
VerifyLoadedHeapEmbeddedPointers verifier(&table);
HeapWord* bottom = (HeapWord*)_loaded_heap_bottom;
HeapWord* top = (HeapWord*)_loaded_heap_top;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/archiveHeapWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ArchiveHeapWriter::BufferOffsetToSourceObjectTable*
ArchiveHeapWriter::_buffer_offset_to_source_obj_table = nullptr;


typedef ResourceHashtable<
typedef HashTable<
size_t, // offset of a filler from ArchiveHeapWriter::buffer_bottom()
size_t, // size of this filler (in bytes)
127, // prime number
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/archiveHeapWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include "utilities/bitMap.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
#include "utilities/resourceHash.hpp"

class MemRegion;

Expand Down Expand Up @@ -152,7 +152,7 @@ class ArchiveHeapWriter : AllStatic {
};
static GrowableArrayCHeap<HeapObjOrder, mtClassShared>* _source_objs_order;

typedef ResizeableResourceHashtable<size_t, oop,
typedef ResizeableHashTable<size_t, oop,
AnyObj::C_HEAP,
mtClassShared> BufferOffsetToSourceObjectTable;
static BufferOffsetToSourceObjectTable* _buffer_offset_to_source_obj_table;
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/cdsHeapVerifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "cds/heapShared.hpp"
#include "memory/iterator.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/hashtable.hpp"

class InstanceKlass;
class Symbol;
Expand All @@ -47,7 +47,7 @@ class CDSHeapVerifier : public KlassClosure {
Symbol* _name;
};

ResourceHashtable<oop, StaticFieldInfo,
HashTable<oop, StaticFieldInfo,
15889, // prime number
AnyObj::C_HEAP,
mtClassShared,
Expand Down Expand Up @@ -79,7 +79,7 @@ class CDSHeapVerifier : public KlassClosure {
// Overrides KlassClosure::do_klass()
virtual void do_klass(Klass* k);

// For ResourceHashtable::iterate()
// For HashTable::iterate()
inline bool do_entry(oop& orig_obj, HeapShared::CachedOopInfo& value);

static void verify();
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/classListParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ClassListParser : public StackObj {

private:
// Must be C_HEAP allocated -- we don't want nested resource allocations.
typedef ResizeableResourceHashtable<int, InstanceKlass*,
typedef ResizeableHashTable<int, InstanceKlass*,
AnyObj::C_HEAP, mtClassShared> ID2KlassTable;

enum {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/classListWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void ClassListWriter::write(const InstanceKlass* k, const ClassFileStream* cfs)
write_to_stream(k, w.stream(), cfs);
}

class ClassListWriter::IDTable : public ResourceHashtable<
class ClassListWriter::IDTable : public HashTable<
const InstanceKlass*, int,
15889, // prime number
AnyObj::C_HEAP> {};
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/dumpTimeClassInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ inline unsigned DumpTimeSharedClassTable_hash(T* const& k) {
}
}

using DumpTimeSharedClassTableBaseType = ResourceHashtable<
using DumpTimeSharedClassTableBaseType = HashTable<
InstanceKlass*,
DumpTimeClassInfo,
15889, // prime number
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ bool HeapShared::archive_object(oop obj, oop referrer, KlassSubGraphInfo* subgra
}
}

class MetaspaceObjToOopHandleTable: public ResourceHashtable<MetaspaceObj*, OopHandle,
class MetaspaceObjToOopHandleTable: public HashTable<MetaspaceObj*, OopHandle,
36137, // prime number
AnyObj::C_HEAP,
mtClassShared> {
Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/share/cds/heapShared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "oops/oopHandle.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/hashtable.hpp"

#if INCLUDE_CDS_JAVA_HEAP
class DumpedInternedStrings;
Expand Down Expand Up @@ -202,14 +202,14 @@ class HeapShared: AllStatic {
private:
static const int INITIAL_TABLE_SIZE = 15889; // prime number
static const int MAX_TABLE_SIZE = 1000000;
typedef ResizeableResourceHashtable<oop, CachedOopInfo,
typedef ResizeableHashTable<oop, CachedOopInfo,
AnyObj::C_HEAP,
mtClassShared,
HeapShared::oop_hash> ArchivedObjectCache;
static ArchivedObjectCache* _archived_object_cache;

class DumpTimeKlassSubGraphInfoTable
: public ResourceHashtable<Klass*, KlassSubGraphInfo,
: public HashTable<Klass*, KlassSubGraphInfo,
137, // prime number
AnyObj::C_HEAP,
mtClassShared,
Expand Down Expand Up @@ -264,7 +264,7 @@ class HeapShared: AllStatic {
// !UseCompressedOops only: used to relocate pointers to the archived objects
static ptrdiff_t _runtime_delta;

typedef ResizeableResourceHashtable<oop, bool,
typedef ResizeableHashTable<oop, bool,
AnyObj::C_HEAP,
mtClassShared,
HeapShared::oop_hash> SeenObjectsTable;
Expand Down Expand Up @@ -468,14 +468,14 @@ class HeapShared: AllStatic {

#if INCLUDE_CDS_JAVA_HEAP
class DumpedInternedStrings :
public ResizeableResourceHashtable<oop, bool,
public ResizeableHashTable<oop, bool,
AnyObj::C_HEAP,
mtClassShared,
HeapShared::string_oop_hash>
{
public:
DumpedInternedStrings(unsigned size, unsigned max_size) :
ResizeableResourceHashtable<oop, bool,
ResizeableHashTable<oop, bool,
AnyObj::C_HEAP,
mtClassShared,
HeapShared::string_oop_hash>(size, max_size) {}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/lambdaProxyClassDictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "classfile/javaClasses.hpp"
#include "memory/metaspaceClosure.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/hashtable.hpp"

// This file contains *legacy* optimization for lambdas before JEP 483. May be removed in the future.
//
Expand Down Expand Up @@ -249,7 +249,7 @@ class RunTimeLambdaProxyClassInfo {
};

class DumpTimeLambdaProxyClassDictionary
: public ResourceHashtable<LambdaProxyClassKey,
: public HashTable<LambdaProxyClassKey,
DumpTimeLambdaProxyClassInfo,
137, // prime number
AnyObj::C_HEAP,
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/metaspaceShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
#include "utilities/align.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"
#include "utilities/resourceHash.hpp"

#include <sys/stat.h>

Expand Down Expand Up @@ -178,7 +178,7 @@ class DumpClassListCLDClosure : public CLDClosure {
static const int MAX_TABLE_SIZE = 61333;

fileStream *_stream;
ResizeableResourceHashtable<InstanceKlass*, bool,
ResizeableHashTable<InstanceKlass*, bool,
AnyObj::C_HEAP, mtClassShared> _dumped_classes;

void dump(InstanceKlass* ik) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/cds/regeneratedClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include "runtime/mutexLocker.hpp"
#include "runtime/thread.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/hashtable.hpp"

using RegeneratedObjTable = ResourceHashtable<address, address, 15889, AnyObj::C_HEAP, mtClassShared>;
using RegeneratedObjTable = HashTable<address, address, 15889, AnyObj::C_HEAP, mtClassShared>;
static RegeneratedObjTable* _regenerated_objs = nullptr; // InstanceKlass* and Method* orig_obj -> regen_obj
static RegeneratedObjTable* _original_objs = nullptr; // InstanceKlass* and Method* regen_obj -> orig_obj
static GrowableArrayCHeap<OopHandle, mtClassShared>* _regenerated_mirrors = nullptr;
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/classfile/bytecodeAssembler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#include "oops/symbol.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/resourceHash.hpp"

#include "utilities/hashtable.hpp"

/**
* Bytecode Assembler
Expand Down Expand Up @@ -125,7 +124,7 @@ class BytecodeCPEntry {

class BytecodeConstantPool : public ResourceObj {
private:
typedef ResourceHashtable<BytecodeCPEntry, u2,
typedef HashTable<BytecodeCPEntry, u2,
256, AnyObj::RESOURCE_AREA, mtInternal,
&BytecodeCPEntry::hash, &BytecodeCPEntry::equals> IndexHash;

Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/classfile/classFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
#include "utilities/formatBuffer.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"
#include "utilities/resourceHash.hpp"
#include "utilities/utf8.hpp"
#if INCLUDE_CDS
#include "classfile/systemDictionaryShared.hpp"
Expand Down Expand Up @@ -782,7 +782,7 @@ class NameSigHash: public ResourceObj {
}
};

using NameSigHashtable = ResourceHashtable<NameSigHash, int,
using NameSigHashtable = HashTable<NameSigHash, int,
NameSigHash::HASH_ROW_SIZE,
AnyObj::RESOURCE_AREA, mtInternal,
&NameSigHash::hash, &NameSigHash::equals>;
Expand Down Expand Up @@ -849,7 +849,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
// Check if there's any duplicates in interfaces
ResourceMark rm(THREAD);
// Set containing interface names
ResourceHashtable<Symbol*, int>* interface_names = new ResourceHashtable<Symbol*, int>();
HashTable<Symbol*, int>* interface_names = new HashTable<Symbol*, int>();
for (index = 0; index < itfs_len; index++) {
const InstanceKlass* const k = _local_interfaces->at(index);
Symbol* interface_name = k->name();
Expand Down Expand Up @@ -2022,7 +2022,7 @@ void ClassFileParser::copy_localvariable_table(const ConstMethod* cm,

ResourceMark rm(THREAD);

typedef ResourceHashtable<LocalVariableTableElement, LocalVariableTableElement*,
typedef HashTable<LocalVariableTableElement, LocalVariableTableElement*,
256, AnyObj::RESOURCE_AREA, mtInternal,
&LVT_Hash::hash, &LVT_Hash::equals> LVT_HashTable;

Expand Down
Loading