Skip to content

Commit c2c0208

Browse files
y1yang0iklam
authored andcommittedJun 1, 2021
8267089: Use typedef KVHashtable for ID2KlassTable
Reviewed-by: iklam, coleenp
1 parent ccfcd92 commit c2c0208

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed
 

‎src/hotspot/share/cds/classListParser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
volatile Thread* ClassListParser::_parsing_thread = NULL;
5555
ClassListParser* ClassListParser::_instance = NULL;
5656

57-
ClassListParser::ClassListParser(const char* file) {
57+
ClassListParser::ClassListParser(const char* file) : _id2klass_table(INITIAL_TABLE_SIZE) {
5858
_classlist_file = file;
5959
_file = NULL;
6060
// Use os::open() because neither fopen() nor os::fopen()

‎src/hotspot/share/cds/classListParser.hpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535

3636
class Thread;
3737

38-
class ID2KlassTable : public KVHashtable<int, InstanceKlass*, mtInternal> {
39-
public:
40-
ID2KlassTable() : KVHashtable<int, InstanceKlass*, mtInternal>(1987) {}
41-
};
42-
4338
class CDSIndyInfo {
4439
GrowableArray<const char*>* _items;
4540
public:
@@ -71,6 +66,8 @@ class CDSIndyInfo {
7166
};
7267

7368
class ClassListParser : public StackObj {
69+
typedef KVHashtable<int, InstanceKlass*, mtInternal> ID2KlassTable;
70+
7471
enum {
7572
_unspecified = -999,
7673

@@ -83,6 +80,7 @@ class ClassListParser : public StackObj {
8380
_line_buf_size = _max_allowed_line_len + _line_buf_extra
8481
};
8582

83+
static const int INITIAL_TABLE_SIZE = 1987;
8684
static volatile Thread* _parsing_thread; // the thread that created _instance
8785
static ClassListParser* _instance; // the singleton.
8886
const char* _classlist_file;
@@ -108,7 +106,7 @@ class ClassListParser : public StackObj {
108106
bool parse_int_option(const char* option_name, int* value);
109107
bool parse_uint_option(const char* option_name, int* value);
110108
InstanceKlass* load_class_from_source(Symbol* class_name, TRAPS);
111-
ID2KlassTable *table() {
109+
ID2KlassTable* table() {
112110
return &_id2klass_table;
113111
}
114112
InstanceKlass* lookup_class_by_id(int id);

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jun 1, 2021

@openjdk-notifier[bot]
Please sign in to comment.