Skip to content
Permalink
Browse files
8267089: Use typedef KVHashtable for ID2KlassTable
Reviewed-by: iklam, coleenp
  • Loading branch information
Yi Yang authored and iklam committed Jun 1, 2021
1 parent ccfcd92 commit c2c0208dfd986eef19a65727e875b023fb595436
Showing with 5 additions and 7 deletions.
  1. +1 −1 src/hotspot/share/cds/classListParser.cpp
  2. +4 −6 src/hotspot/share/cds/classListParser.hpp
@@ -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()
@@ -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 CDSIndyInfo {
};

class ClassListParser : public StackObj {
typedef KVHashtable<int, InstanceKlass*, mtInternal> 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);

1 comment on commit c2c0208

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on c2c0208 Jun 1, 2021

Please sign in to comment.