Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8267089: Use typedef KVHashtable for ID2KlassTable
Reviewed-by: iklam, coleenp
  • Loading branch information
y1yang0 authored and iklam committed Jun 1, 2021
1 parent ccfcd92 commit c2c0208
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/classListParser.cpp
Expand Up @@ -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()
Expand Down
10 changes: 4 additions & 6 deletions src/hotspot/share/cds/classListParser.hpp
Expand Up @@ -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:
Expand Down Expand Up @@ -71,6 +66,8 @@ class CDSIndyInfo {
};

class ClassListParser : public StackObj {
typedef KVHashtable<int, InstanceKlass*, mtInternal> ID2KlassTable;

enum {
_unspecified = -999,

Expand All @@ -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;
Expand All @@ -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);
Expand Down

1 comment on commit c2c0208

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.