src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8024545 Cdiff src/share/vm/runtime/arguments.cpp

src/share/vm/runtime/arguments.cpp

Print this page

        

*** 623,637 **** default: ShouldNotReachHere(); } } ! static bool set_bool_flag(char* name, bool value, FlagValueOrigin origin) { return CommandLineFlags::boolAtPut(name, &value, origin); } ! static bool set_fp_numeric_flag(char* name, char* value, FlagValueOrigin origin) { double v; if (sscanf(value, "%lf", &v) != 1) { return false; } --- 623,637 ---- default: ShouldNotReachHere(); } } ! static bool set_bool_flag(char* name, bool value, Flag::Flags origin) { return CommandLineFlags::boolAtPut(name, &value, origin); } ! static bool set_fp_numeric_flag(char* name, char* value, Flag::Flags origin) { double v; if (sscanf(value, "%lf", &v) != 1) { return false; }
*** 639,649 **** return true; } return false; } ! static bool set_numeric_flag(char* name, char* value, FlagValueOrigin origin) { julong v; intx intx_v; bool is_neg = false; // Check the sign first since atomull() parses only unsigned values. if (*value == '-') { --- 639,649 ---- return true; } return false; } ! static bool set_numeric_flag(char* name, char* value, Flag::Flags origin) { julong v; intx intx_v; bool is_neg = false; // Check the sign first since atomull() parses only unsigned values. if (*value == '-') {
*** 672,689 **** return true; } return false; } ! static bool set_string_flag(char* name, const char* value, FlagValueOrigin origin) { if (!CommandLineFlags::ccstrAtPut(name, &value, origin)) return false; // Contract: CommandLineFlags always returns a pointer that needs freeing. FREE_C_HEAP_ARRAY(char, value, mtInternal); return true; } ! static bool append_to_string_flag(char* name, const char* new_value, FlagValueOrigin origin) { const char* old_value = ""; if (!CommandLineFlags::ccstrAt(name, &old_value)) return false; size_t old_len = old_value != NULL ? strlen(old_value) : 0; size_t new_len = strlen(new_value); const char* value; --- 672,689 ---- return true; } return false; } ! static bool set_string_flag(char* name, const char* value, Flag::Flags origin) { if (!CommandLineFlags::ccstrAtPut(name, &value, origin)) return false; // Contract: CommandLineFlags always returns a pointer that needs freeing. FREE_C_HEAP_ARRAY(char, value, mtInternal); return true; } ! static bool append_to_string_flag(char* name, const char* new_value, Flag::Flags origin) { const char* old_value = ""; if (!CommandLineFlags::ccstrAt(name, &old_value)) return false; size_t old_len = old_value != NULL ? strlen(old_value) : 0; size_t new_len = strlen(new_value); const char* value;
*** 707,717 **** FREE_C_HEAP_ARRAY(char, free_this_too, mtInternal); } return true; } ! bool Arguments::parse_argument(const char* arg, FlagValueOrigin origin) { // range of acceptable characters spelled out for portability reasons #define NAME_RANGE "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]" #define BUFLEN 255 char name[BUFLEN+1]; --- 707,717 ---- FREE_C_HEAP_ARRAY(char, free_this_too, mtInternal); } return true; } ! bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { // range of acceptable characters spelled out for portability reasons #define NAME_RANGE "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]" #define BUFLEN 255 char name[BUFLEN+1];
*** 848,858 **** st->print_cr(""); } } bool Arguments::process_argument(const char* arg, ! jboolean ignore_unrecognized, FlagValueOrigin origin) { JDK_Version since = JDK_Version(); if (parse_argument(arg, origin) || ignore_unrecognized) { return true; --- 848,858 ---- st->print_cr(""); } } bool Arguments::process_argument(const char* arg, ! jboolean ignore_unrecognized, Flag::Flags origin) { JDK_Version since = JDK_Version(); if (parse_argument(arg, origin) || ignore_unrecognized) { return true;
*** 902,912 **** Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true); if (fuzzy_matched != NULL) { jio_fprintf(defaultStream::error_stream(), "Did you mean '%s%s%s'?\n", (fuzzy_matched->is_bool()) ? "(+/-)" : "", ! fuzzy_matched->name, (fuzzy_matched->is_bool()) ? "" : "=<value>"); } } // allow for commandline "commenting out" options like -XX:#+Verbose --- 902,912 ---- Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true); if (fuzzy_matched != NULL) { jio_fprintf(defaultStream::error_stream(), "Did you mean '%s%s%s'?\n", (fuzzy_matched->is_bool()) ? "(+/-)" : "", ! fuzzy_matched->_name, (fuzzy_matched->is_bool()) ? "" : "=<value>"); } } // allow for commandline "commenting out" options like -XX:#+Verbose
*** 950,960 **** if (c == '\n' || (!in_quote && isspace(c))) { // token ends at newline, or at unquoted whitespace // this allows a way to include spaces in string-valued options token[pos] = '\0'; logOption(token); ! result &= process_argument(token, ignore_unrecognized, CONFIG_FILE); build_jvm_flags(token); pos = 0; in_white_space = true; in_quote = false; } else if (!in_quote && (c == '\'' || c == '"')) { --- 950,960 ---- if (c == '\n' || (!in_quote && isspace(c))) { // token ends at newline, or at unquoted whitespace // this allows a way to include spaces in string-valued options token[pos] = '\0'; logOption(token); ! result &= process_argument(token, ignore_unrecognized, Flag::CONFIG_FILE); build_jvm_flags(token); pos = 0; in_white_space = true; in_quote = false; } else if (!in_quote && (c == '\'' || c == '"')) {
*** 968,978 **** } c = getc(stream); } if (pos > 0) { token[pos] = '\0'; ! result &= process_argument(token, ignore_unrecognized, CONFIG_FILE); build_jvm_flags(token); } fclose(stream); return result; } --- 968,978 ---- } c = getc(stream); } if (pos > 0) { token[pos] = '\0'; ! result &= process_argument(token, ignore_unrecognized, Flag::CONFIG_FILE); build_jvm_flags(token); } fclose(stream); return result; }
*** 2432,2442 **** if (result != JNI_OK) { return result; } // Parse JavaVMInitArgs structure passed in ! result = parse_each_vm_init_arg(args, &scp, &scp_assembly_required, COMMAND_LINE); if (result != JNI_OK) { return result; } if (AggressiveOpts) { --- 2432,2442 ---- if (result != JNI_OK) { return result; } // Parse JavaVMInitArgs structure passed in ! result = parse_each_vm_init_arg(args, &scp, &scp_assembly_required, Flag::COMMAND_LINE); if (result != JNI_OK) { return result; } if (AggressiveOpts) {
*** 2519,2529 **** } jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, ! FlagValueOrigin origin) { // Remaining part of option string const char* tail; // iterate over arguments for (int index = 0; index < args->nOptions; index++) { --- 2519,2529 ---- } jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, ! Flag::Flags origin) { // Remaining part of option string const char* tail; // iterate over arguments for (int index = 0; index < args->nOptions; index++) {
*** 3342,3352 **** logOption(tail); } } } ! return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, ENVIRON_VAR)); } return JNI_OK; } void Arguments::set_shared_spaces_flags() { --- 3342,3352 ---- logOption(tail); } } } ! return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, Flag::ENVIRON_VAR)); } return JNI_OK; } void Arguments::set_shared_spaces_flags() {
src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File