# HG changeset patch # User Gilles Duboscq # Date 1433847997 -7200 # Node ID 431b127fc0d1edc5870be2e0466e7db7a72f7e44 # Parent f79218584d3721a898c5263a256b783519f5310b Renaming of classes around jvmciOptions for clarity diff -r f79218584d37 -r 431b127fc0d1 src/share/vm/jvmci/jvmciOptions.cpp --- a/src/share/vm/jvmci/jvmciOptions.cpp Tue Jun 09 12:49:55 2015 +0200 +++ b/src/share/vm/jvmci/jvmciOptions.cpp Tue Jun 09 13:06:37 2015 +0200 @@ -27,10 +27,10 @@ #include "runtime/arguments.hpp" #include "utilities/hashtable.inline.hpp" -class OptionsParseClosure : public ParseClosure { - OptionsTable* _table; +class OptionDescParseClosure : public ParseClosure { + OptionDescsTable* _table; public: - OptionsParseClosure(OptionsTable* table) : _table(table) {} + OptionDescParseClosure(OptionDescsTable* table) : _table(table) {} void do_line(char* line) { char* idx = strchr(line, '\t'); if (idx == NULL) { @@ -118,13 +118,13 @@ } }; -OptionsTable::~OptionsTable() { +OptionDescsTable::~OptionDescsTable() { FreeNamesClosure closure; for_each(&closure); } -OptionsTable* OptionsTable::load_options() { - OptionsTable* table = new OptionsTable(); +OptionDescsTable* OptionDescsTable::load_options() { + OptionDescsTable* table = new OptionDescsTable(); // Add PrintFlags option manually OptionDesc printFlagsDesc; printFlagsDesc.name = PRINT_FLAGS_ARG; @@ -142,7 +142,7 @@ if (dir != NULL) { struct dirent *entry; char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(optionsDir), mtInternal); - OptionsParseClosure closure(table); + OptionDescParseClosure closure(table); while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL && !closure.is_aborted()) { const char* name = entry->d_name; char optionFilePath[JVM_MAXPATHLEN]; @@ -162,7 +162,7 @@ return table; } -OptionDesc* OptionsTable::get(const char* name, size_t arglen) { +OptionDesc* OptionDescsTable::get(const char* name, size_t arglen) { char nameOnly[256]; guarantee(arglen < 256, "Max supported option name len is 256"); strncpy(nameOnly, name, arglen); @@ -213,7 +213,7 @@ } }; -OptionDesc * OptionsTable::fuzzy_match(const char* name, size_t length) { +OptionDesc * OptionDescsTable::fuzzy_match(const char* name, size_t length) { FuzzyMatchClosure closure(name); for_each(&closure); return closure.get_match(); @@ -227,7 +227,7 @@ } }; -OptionsValueTable::~OptionsValueTable() { +OptionValuesTable::~OptionValuesTable() { FreeStringsClosure closure; for_each(&closure); delete _table; @@ -235,7 +235,7 @@ -OptionValue* OptionsValueTable::get(const char* name, size_t arglen) { +OptionValue* OptionValuesTable::get(const char* name, size_t arglen) { char nameOnly[256]; guarantee(arglen < 256, "Max supported option name len is 256"); strncpy(nameOnly, name, arglen); diff -r f79218584d37 -r 431b127fc0d1 src/share/vm/jvmci/jvmciOptions.hpp --- a/src/share/vm/jvmci/jvmciOptions.hpp Tue Jun 09 12:49:55 2015 +0200 +++ b/src/share/vm/jvmci/jvmciOptions.hpp Tue Jun 09 13:06:37 2015 +0200 @@ -56,20 +56,20 @@ return val; } -class OptionsTable : public JVMCIHashtable { +class OptionDescsTable : public JVMCIHashtable { protected: unsigned int compute_hash(const char* key) { return compute_string_hash(key, (int)strlen(key)); } bool key_equals(const char* k1, const char* k2) { return strcmp(k1, k2) == 0; } const char* get_key(OptionDesc value) { return value.name; } ; const char* get_key(OptionDesc* value) { return value->name; } ; public: - OptionsTable() : JVMCIHashtable(100) {} - ~OptionsTable(); + OptionDescsTable() : JVMCIHashtable(100) {} + ~OptionDescsTable(); using JVMCIHashtable::get; OptionDesc* get(const char* name, size_t arglen); OptionDesc * fuzzy_match(const char* name, size_t length); - static OptionsTable* load_options(); + static OptionDescsTable* load_options(); }; struct OptionValue { @@ -84,19 +84,19 @@ }; }; -class OptionsValueTable : public JVMCIHashtable { - OptionsTable* _table; +class OptionValuesTable : public JVMCIHashtable { + OptionDescsTable* _table; protected: unsigned int compute_hash(const char* key) { return compute_string_hash(key, (int)strlen(key)); } bool key_equals(const char* k1, const char* k2) { return strcmp(k1, k2) == 0; } const char* get_key(OptionValue value) { return value.desc.name; } ; const char* get_key(OptionValue* value) { return value->desc.name; } ; public: - OptionsValueTable(OptionsTable* table) : _table(table), JVMCIHashtable(100) {} - ~OptionsValueTable(); + OptionValuesTable(OptionDescsTable* table) : _table(table), JVMCIHashtable(100) {} + ~OptionValuesTable(); using JVMCIHashtable::get; OptionValue* get(const char* name, size_t arglen); - OptionsTable* options_table() { return _table; } + OptionDescsTable* options_table() { return _table; } }; diff -r f79218584d37 -r 431b127fc0d1 src/share/vm/jvmci/jvmciRuntime.cpp --- a/src/share/vm/jvmci/jvmciRuntime.cpp Tue Jun 09 12:49:55 2015 +0200 +++ b/src/share/vm/jvmci/jvmciRuntime.cpp Tue Jun 09 13:06:37 2015 +0200 @@ -729,13 +729,13 @@ } } -OptionsValueTable* JVMCIRuntime::parse_arguments() { - OptionsTable* table = OptionsTable::load_options(); +OptionValuesTable* JVMCIRuntime::parse_arguments() { + OptionDescsTable* table = OptionDescsTable::load_options(); if (table == NULL) { return NULL; } - OptionsValueTable* options = new OptionsValueTable(table); + OptionValuesTable* options = new OptionValuesTable(table); // Process option overrides from jvmci.options first parse_jvmci_options_file(options); @@ -752,7 +752,7 @@ return options; } -void not_found(OptionsTable* table, const char* argname, size_t namelen) { +void not_found(OptionDescsTable* table, const char* argname, size_t namelen) { jio_fprintf(defaultStream::error_stream(),"Unrecognized VM option '%.*s'\n", namelen, argname); OptionDesc* fuzzy_matched = table->fuzzy_match(argname, strlen(argname)); if (fuzzy_matched != NULL) { @@ -764,8 +764,8 @@ } } -bool JVMCIRuntime::parse_argument(OptionsValueTable* options, const char* arg) { - OptionsTable* table = options->options_table(); +bool JVMCIRuntime::parse_argument(OptionValuesTable* options, const char* arg) { + OptionDescsTable* table = options->options_table(); char first = arg[0]; const char* name; size_t name_len; @@ -862,9 +862,9 @@ } class JVMCIOptionParseClosure : public ParseClosure { - OptionsValueTable* _options; + OptionValuesTable* _options; public: - JVMCIOptionParseClosure(OptionsValueTable* options) : _options(options) {} + JVMCIOptionParseClosure(OptionValuesTable* options) : _options(options) {} void do_line(char* line) { if (!JVMCIRuntime::parse_argument(_options, line)) { warn("There was an error parsing an argument. Skipping it."); @@ -872,7 +872,7 @@ } }; -void JVMCIRuntime::parse_jvmci_options_file(OptionsValueTable* options) { +void JVMCIRuntime::parse_jvmci_options_file(OptionValuesTable* options) { const char* home = Arguments::get_java_home(); size_t path_len = strlen(home) + strlen("/lib/jvmci.options") + 1; char path[JVM_MAXPATHLEN]; @@ -1010,7 +1010,7 @@ } }; -void JVMCIRuntime::set_options(OptionsValueTable* options, TRAPS) { +void JVMCIRuntime::set_options(OptionValuesTable* options, TRAPS) { ensure_jvmci_class_loader_is_initialized(); { ResourceMark rm; diff -r f79218584d37 -r 431b127fc0d1 src/share/vm/jvmci/jvmciRuntime.hpp --- a/src/share/vm/jvmci/jvmciRuntime.hpp Tue Jun 09 12:49:55 2015 +0200 +++ b/src/share/vm/jvmci/jvmciRuntime.hpp Tue Jun 09 13:06:37 2015 +0200 @@ -67,7 +67,7 @@ * leading "-G:" prefix. These option values are set prior to processing of any JVMCI * options present on the command line. */ - static void parse_jvmci_options_file(OptionsValueTable* options); + static void parse_jvmci_options_file(OptionValuesTable* options); static void print_flags_helper(TRAPS); @@ -84,11 +84,11 @@ * Parses the JVMCI specific VM options that were presented by the launcher and sets * the relevants Java fields. */ - static OptionsValueTable* parse_arguments(); + static OptionValuesTable* parse_arguments(); - static bool parse_argument(OptionsValueTable* options, const char* arg); + static bool parse_argument(OptionValuesTable* options, const char* arg); - static void set_options(OptionsValueTable* options, TRAPS); + static void set_options(OptionValuesTable* options, TRAPS); /** * Ensures that the JVMCI class loader is initialized and the well known JVMCI classes are loaded. diff -r f79218584d37 -r 431b127fc0d1 src/share/vm/runtime/thread.cpp --- a/src/share/vm/runtime/thread.cpp Tue Jun 09 12:49:55 2015 +0200 +++ b/src/share/vm/runtime/thread.cpp Tue Jun 09 13:06:37 2015 +0200 @@ -3396,7 +3396,7 @@ if (parse_result != JNI_OK) return parse_result; #ifdef JVMCI - OptionsValueTable* options = JVMCIRuntime::parse_arguments(); + OptionValuesTable* options = JVMCIRuntime::parse_arguments(); if (options == NULL) { return JNI_ERR; }