8267089: Use typedef KVHashtable for ID2KlassTable
Reviewed-by: iklam, coleenp
diff --git a/src/hotspot/share/cds/classListParser.cpp b/src/hotspot/share/cds/classListParser.cpp
index b1d777b..cec8652 100644
--- a/src/hotspot/share/cds/classListParser.cpp
+++ b/src/hotspot/share/cds/classListParser.cpp
@@ -54,7 +54,7 @@
volatile Thread* ClassListParser::_parsing_thread = NULL;
ClassListParser* ClassListParser::_instance = NULL;
-ClassListParser::ClassListParser(const char* file) {
+ClassListParser::ClassListParser(const char* file) : _id2klass_table(INITIAL_TABLE_SIZE) {
_classlist_file = file;
_file = NULL;
// Use os::open() because neither fopen() nor os::fopen()
diff --git a/src/hotspot/share/cds/classListParser.hpp b/src/hotspot/share/cds/classListParser.hpp
index 87b0a34..9929cdc 100644
--- a/src/hotspot/share/cds/classListParser.hpp
+++ b/src/hotspot/share/cds/classListParser.hpp
@@ -35,11 +35,6 @@
class Thread;
-class ID2KlassTable : public KVHashtable<int, InstanceKlass*, mtInternal> {
-public:
- ID2KlassTable() : KVHashtable<int, InstanceKlass*, mtInternal>(1987) {}
-};
-
class CDSIndyInfo {
GrowableArray<const char*>* _items;
public:
@@ -71,6 +66,8 @@
};
class ClassListParser : public StackObj {
+ typedef KVHashtable<int, InstanceKlass*, mtInternal> ID2KlassTable;
+
enum {
_unspecified = -999,
@@ -83,6 +80,7 @@
_line_buf_size = _max_allowed_line_len + _line_buf_extra
};
+ static const int INITIAL_TABLE_SIZE = 1987;
static volatile Thread* _parsing_thread; // the thread that created _instance
static ClassListParser* _instance; // the singleton.
const char* _classlist_file;
@@ -108,7 +106,7 @@
bool parse_int_option(const char* option_name, int* value);
bool parse_uint_option(const char* option_name, int* value);
InstanceKlass* load_class_from_source(Symbol* class_name, TRAPS);
- ID2KlassTable *table() {
+ ID2KlassTable* table() {
return &_id2klass_table;
}
InstanceKlass* lookup_class_by_id(int id);