From c2c0208dfd986eef19a65727e875b023fb595436 Mon Sep 17 00:00:00 2001 From: Yi Yang Date: Tue, 1 Jun 2021 19:56:57 +0000 Subject: [PATCH] 8267089: Use typedef KVHashtable for ID2KlassTable Reviewed-by: iklam, coleenp --- src/hotspot/share/cds/classListParser.cpp | 2 +- src/hotspot/share/cds/classListParser.hpp | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/cds/classListParser.cpp b/src/hotspot/share/cds/classListParser.cpp index b1d777b58c6..cec8652f5ec 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 87b0a343bd7..9929cdca609 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 { -public: - ID2KlassTable() : KVHashtable(1987) {} -}; - class CDSIndyInfo { GrowableArray* _items; public: @@ -71,6 +66,8 @@ public: }; class ClassListParser : public StackObj { + typedef KVHashtable ID2KlassTable; + enum { _unspecified = -999, @@ -83,6 +80,7 @@ class ClassListParser : public StackObj { _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 @@ class ClassListParser : public StackObj { 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);