src/hotspot/share/runtime/arguments.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
webrev Cdiff src/hotspot/share/runtime/arguments.cpp
src/hotspot/share/runtime/arguments.cpp
Print this page
*** 42,55 ****
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/arguments_ext.hpp"
! #include "runtime/commandLineFlagConstraintList.hpp"
! #include "runtime/commandLineFlagWriteableList.hpp"
! #include "runtime/commandLineFlagRangeList.hpp"
! #include "runtime/globals.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointMechanism.hpp"
--- 42,54 ----
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/arguments_ext.hpp"
! #include "runtime/jvmFlagConstraintList.hpp"
! #include "runtime/jvmFlagWriteableList.hpp"
! #include "runtime/jvmFlagRangeList.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointMechanism.hpp"
*** 737,757 ****
success = false;
}
// if flag has become obsolete it should not have a "globals" flag defined anymore.
if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
! if (Flag::find_flag(flag.name) != NULL) {
// Temporarily disable the warning: 8196739
// warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
}
}
}
if (!flag.expired_in.is_undefined()) {
// if flag has become expired it should not have a "globals" flag defined anymore.
if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
! if (Flag::find_flag(flag.name) != NULL) {
// Temporarily disable the warning: 8196739
// warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
}
}
}
--- 736,756 ----
success = false;
}
// if flag has become obsolete it should not have a "globals" flag defined anymore.
if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
! if (JVMFlag::find_flag(flag.name) != NULL) {
// Temporarily disable the warning: 8196739
// warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
}
}
}
if (!flag.expired_in.is_undefined()) {
// if flag has become expired it should not have a "globals" flag defined anymore.
if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
! if (JVMFlag::find_flag(flag.name) != NULL) {
// Temporarily disable the warning: 8196739
// warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
}
}
}
*** 831,868 ****
default:
ShouldNotReachHere();
}
}
! static bool set_bool_flag(const char* name, bool value, Flag::Flags origin) {
! if (CommandLineFlags::boolAtPut(name, &value, origin) == Flag::SUCCESS) {
return true;
} else {
return false;
}
}
! static bool set_fp_numeric_flag(const char* name, char* value, Flag::Flags origin) {
char* end;
errno = 0;
double v = strtod(value, &end);
if ((errno != 0) || (*end != 0)) {
return false;
}
! if (CommandLineFlags::doubleAtPut(name, &v, origin) == Flag::SUCCESS) {
return true;
}
return false;
}
! static bool set_numeric_flag(const char* name, char* value, Flag::Flags origin) {
julong v;
int int_v;
intx intx_v;
bool is_neg = false;
! Flag* result = Flag::find_flag(name, strlen(name));
if (result == NULL) {
return false;
}
--- 830,867 ----
default:
ShouldNotReachHere();
}
}
! static bool set_bool_flag(const char* name, bool value, JVMFlag::Flags origin) {
! if (JVMFlag::boolAtPut(name, &value, origin) == JVMFlag::SUCCESS) {
return true;
} else {
return false;
}
}
! static bool set_fp_numeric_flag(const char* name, char* value, JVMFlag::Flags origin) {
char* end;
errno = 0;
double v = strtod(value, &end);
if ((errno != 0) || (*end != 0)) {
return false;
}
! if (JVMFlag::doubleAtPut(name, &v, origin) == JVMFlag::SUCCESS) {
return true;
}
return false;
}
! static bool set_numeric_flag(const char* name, char* value, JVMFlag::Flags origin) {
julong v;
int int_v;
intx intx_v;
bool is_neg = false;
! JVMFlag* result = JVMFlag::find_flag(name, strlen(name));
if (result == NULL) {
return false;
}
*** 880,926 ****
if (result->is_int()) {
int_v = (int) v;
if (is_neg) {
int_v = -int_v;
}
! return CommandLineFlags::intAtPut(result, &int_v, origin) == Flag::SUCCESS;
} else if (result->is_uint()) {
uint uint_v = (uint) v;
! return CommandLineFlags::uintAtPut(result, &uint_v, origin) == Flag::SUCCESS;
} else if (result->is_intx()) {
intx_v = (intx) v;
if (is_neg) {
intx_v = -intx_v;
}
! return CommandLineFlags::intxAtPut(result, &intx_v, origin) == Flag::SUCCESS;
} else if (result->is_uintx()) {
uintx uintx_v = (uintx) v;
! return CommandLineFlags::uintxAtPut(result, &uintx_v, origin) == Flag::SUCCESS;
} else if (result->is_uint64_t()) {
uint64_t uint64_t_v = (uint64_t) v;
! return CommandLineFlags::uint64_tAtPut(result, &uint64_t_v, origin) == Flag::SUCCESS;
} else if (result->is_size_t()) {
size_t size_t_v = (size_t) v;
! return CommandLineFlags::size_tAtPut(result, &size_t_v, origin) == Flag::SUCCESS;
} else if (result->is_double()) {
double double_v = (double) v;
! return CommandLineFlags::doubleAtPut(result, &double_v, origin) == Flag::SUCCESS;
} else {
return false;
}
}
! static bool set_string_flag(const char* name, const char* value, Flag::Flags origin) {
! if (CommandLineFlags::ccstrAtPut(name, &value, origin) != Flag::SUCCESS) return false;
! // Contract: CommandLineFlags always returns a pointer that needs freeing.
FREE_C_HEAP_ARRAY(char, value);
return true;
}
! static bool append_to_string_flag(const char* name, const char* new_value, Flag::Flags origin) {
const char* old_value = "";
! if (CommandLineFlags::ccstrAt(name, &old_value) != Flag::SUCCESS) return false;
size_t old_len = old_value != NULL ? strlen(old_value) : 0;
size_t new_len = strlen(new_value);
const char* value;
char* free_this_too = NULL;
if (old_len == 0) {
--- 879,925 ----
if (result->is_int()) {
int_v = (int) v;
if (is_neg) {
int_v = -int_v;
}
! return JVMFlag::intAtPut(result, &int_v, origin) == JVMFlag::SUCCESS;
} else if (result->is_uint()) {
uint uint_v = (uint) v;
! return JVMFlag::uintAtPut(result, &uint_v, origin) == JVMFlag::SUCCESS;
} else if (result->is_intx()) {
intx_v = (intx) v;
if (is_neg) {
intx_v = -intx_v;
}
! return JVMFlag::intxAtPut(result, &intx_v, origin) == JVMFlag::SUCCESS;
} else if (result->is_uintx()) {
uintx uintx_v = (uintx) v;
! return JVMFlag::uintxAtPut(result, &uintx_v, origin) == JVMFlag::SUCCESS;
} else if (result->is_uint64_t()) {
uint64_t uint64_t_v = (uint64_t) v;
! return JVMFlag::uint64_tAtPut(result, &uint64_t_v, origin) == JVMFlag::SUCCESS;
} else if (result->is_size_t()) {
size_t size_t_v = (size_t) v;
! return JVMFlag::size_tAtPut(result, &size_t_v, origin) == JVMFlag::SUCCESS;
} else if (result->is_double()) {
double double_v = (double) v;
! return JVMFlag::doubleAtPut(result, &double_v, origin) == JVMFlag::SUCCESS;
} else {
return false;
}
}
! static bool set_string_flag(const char* name, const char* value, JVMFlag::Flags origin) {
! if (JVMFlag::ccstrAtPut(name, &value, origin) != JVMFlag::SUCCESS) return false;
! // Contract: JVMFlag always returns a pointer that needs freeing.
FREE_C_HEAP_ARRAY(char, value);
return true;
}
! static bool append_to_string_flag(const char* name, const char* new_value, JVMFlag::Flags origin) {
const char* old_value = "";
! if (JVMFlag::ccstrAt(name, &old_value) != JVMFlag::SUCCESS) return false;
size_t old_len = old_value != NULL ? strlen(old_value) : 0;
size_t new_len = strlen(new_value);
const char* value;
char* free_this_too = NULL;
if (old_len == 0) {
*** 933,947 ****
// each new setting adds another LINE to the switch:
jio_snprintf(buf, length, "%s\n%s", old_value, new_value);
value = buf;
free_this_too = buf;
}
! (void) CommandLineFlags::ccstrAtPut(name, &value, origin);
! // CommandLineFlags always returns a pointer that needs freeing.
FREE_C_HEAP_ARRAY(char, value);
if (free_this_too != NULL) {
! // CommandLineFlags made its own copy, so I must delete my own temp. buffer.
FREE_C_HEAP_ARRAY(char, free_this_too);
}
return true;
}
--- 932,946 ----
// each new setting adds another LINE to the switch:
jio_snprintf(buf, length, "%s\n%s", old_value, new_value);
value = buf;
free_this_too = buf;
}
! (void) JVMFlag::ccstrAtPut(name, &value, origin);
! // JVMFlag always returns a pointer that needs freeing.
FREE_C_HEAP_ARRAY(char, value);
if (free_this_too != NULL) {
! // JVMFlag made its own copy, so I must delete my own temp. buffer.
FREE_C_HEAP_ARRAY(char, free_this_too);
}
return true;
}
*** 1008,1018 ****
}
AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
return a;
}
! 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];
--- 1007,1017 ----
}
AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
return a;
}
! bool Arguments::parse_argument(const char* arg, JVMFlag::Flags origin) {
// range of acceptable characters spelled out for portability reasons
#define NAME_RANGE "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]"
#define BUFLEN 255
char name[BUFLEN+1];
*** 1046,1056 ****
}
char punct;
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "%c", name, &punct) == 2 && punct == '=') {
const char* value = strchr(arg, '=') + 1;
! Flag* flag;
// this scanf pattern matches both strings (handled here) and numbers (handled later))
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
if (alf.alias_name != NULL) {
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
--- 1045,1055 ----
}
char punct;
if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "%c", name, &punct) == 2 && punct == '=') {
const char* value = strchr(arg, '=') + 1;
! JVMFlag* flag;
// this scanf pattern matches both strings (handled here) and numbers (handled later))
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
if (alf.alias_name != NULL) {
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
*** 1058,1068 ****
}
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
if (real_name == NULL) {
return false;
}
! flag = Flag::find_flag(real_name);
if (flag != NULL && flag->is_ccstr()) {
if (flag->ccstr_accumulates()) {
return append_to_string_flag(real_name, value, origin);
} else {
if (value[0] == '\0') {
--- 1057,1067 ----
}
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
if (real_name == NULL) {
return false;
}
! flag = JVMFlag::find_flag(real_name);
if (flag != NULL && flag->is_ccstr()) {
if (flag->ccstr_accumulates()) {
return append_to_string_flag(real_name, value, origin);
} else {
if (value[0] == '\0') {
*** 1219,1229 ****
}
}
bool Arguments::process_argument(const char* arg,
jboolean ignore_unrecognized,
! Flag::Flags origin) {
JDK_Version since = JDK_Version();
if (parse_argument(arg, origin)) {
return true;
}
--- 1218,1228 ----
}
}
bool Arguments::process_argument(const char* arg,
jboolean ignore_unrecognized,
! JVMFlag::Flags origin) {
JDK_Version since = JDK_Version();
if (parse_argument(arg, origin)) {
return true;
}
*** 1264,1277 ****
#endif //PRODUCT
}
// For locked flags, report a custom error message if available.
// Otherwise, report the standard unrecognized VM option.
! Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true);
if (found_flag != NULL) {
char locked_message_buf[BUFLEN];
! Flag::MsgType msg_type = found_flag->get_locked_message(locked_message_buf, BUFLEN);
if (strlen(locked_message_buf) == 0) {
if (found_flag->is_bool() && !has_plus_minus) {
jio_fprintf(defaultStream::error_stream(),
"Missing +/- setting for VM option '%s'\n", argname);
} else if (!found_flag->is_bool() && has_plus_minus) {
--- 1263,1276 ----
#endif //PRODUCT
}
// For locked flags, report a custom error message if available.
// Otherwise, report the standard unrecognized VM option.
! JVMFlag* found_flag = JVMFlag::find_flag((const char*)argname, arg_len, true, true);
if (found_flag != NULL) {
char locked_message_buf[BUFLEN];
! JVMFlag::MsgType msg_type = found_flag->get_locked_message(locked_message_buf, BUFLEN);
if (strlen(locked_message_buf) == 0) {
if (found_flag->is_bool() && !has_plus_minus) {
jio_fprintf(defaultStream::error_stream(),
"Missing +/- setting for VM option '%s'\n", argname);
} else if (!found_flag->is_bool() && has_plus_minus) {
*** 1281,1292 ****
jio_fprintf(defaultStream::error_stream(),
"Improperly specified VM option '%s'\n", argname);
}
} else {
#ifdef PRODUCT
! bool mismatched = ((msg_type == Flag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD) ||
! (msg_type == Flag::DEVELOPER_FLAG_BUT_PRODUCT_BUILD));
if (ignore_unrecognized && mismatched) {
return true;
}
#endif
jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf);
--- 1280,1291 ----
jio_fprintf(defaultStream::error_stream(),
"Improperly specified VM option '%s'\n", argname);
}
} else {
#ifdef PRODUCT
! bool mismatched = ((msg_type == JVMFlag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD) ||
! (msg_type == JVMFlag::DEVELOPER_FLAG_BUT_PRODUCT_BUILD));
if (ignore_unrecognized && mismatched) {
return true;
}
#endif
jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf);
*** 1295,1305 ****
if (ignore_unrecognized) {
return true;
}
jio_fprintf(defaultStream::error_stream(),
"Unrecognized VM option '%s'\n", argname);
! 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'? ",
(fuzzy_matched->is_bool()) ? "(+/-)" : "",
fuzzy_matched->_name,
--- 1294,1304 ----
if (ignore_unrecognized) {
return true;
}
jio_fprintf(defaultStream::error_stream(),
"Unrecognized VM option '%s'\n", argname);
! JVMFlag* fuzzy_matched = JVMFlag::fuzzy_match((const char*)argname, arg_len, true);
if (fuzzy_matched != NULL) {
jio_fprintf(defaultStream::error_stream(),
"Did you mean '%s%s%s'? ",
(fuzzy_matched->is_bool()) ? "(+/-)" : "",
fuzzy_matched->_name,
*** 1348,1358 ****
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 == '"')) {
--- 1347,1357 ----
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, JVMFlag::CONFIG_FILE);
build_jvm_flags(token);
pos = 0;
in_white_space = true;
in_quote = false;
} else if (!in_quote && (c == '\'' || c == '"')) {
*** 1366,1376 ****
}
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;
}
--- 1365,1375 ----
}
c = getc(stream);
}
if (pos > 0) {
token[pos] = '\0';
! result &= process_argument(token, ignore_unrecognized, JVMFlag::CONFIG_FILE);
build_jvm_flags(token);
}
fclose(stream);
return result;
}
*** 1999,2047 ****
total_memory - (julong) 160 * M);
initHeapSize = limit_by_allocatable_memory(initHeapSize);
if (FLAG_IS_DEFAULT(MaxHeapSize)) {
! if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// Currently the minimum size and the initial heap sizes are the same.
set_min_heap_size(initHeapSize);
}
if (FLAG_IS_DEFAULT(NewSize)) {
// Make the young generation 3/8ths of the total heap.
if (FLAG_SET_CMDLINE(size_t, NewSize,
! ((julong) MaxHeapSize / (julong) 8) * (julong) 3) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != Flag::SUCCESS) {
return JNI_EINVAL;
}
}
#if !defined(_ALLBSD_SOURCE) && !defined(AIX) // UseLargePages is not yet supported on BSD and AIX.
FLAG_SET_DEFAULT(UseLargePages, true);
#endif
// Increase some data structure sizes for efficiency
! if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, TLABSize, 256 * K) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// See the OldPLABSize comment below, but replace 'after promotion'
// with 'after copying'. YoungPLABSize is the size of the survivor
// space per-gc-thread buffers. The default is 4kw.
! if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256 * K) != Flag::SUCCESS) { // Note: this is in words
return JNI_EINVAL;
}
// OldPLABSize is the size of the buffers in the old gen that
// UseParallelGC uses to promote live data that doesn't fit in the
--- 1998,2046 ----
total_memory - (julong) 160 * M);
initHeapSize = limit_by_allocatable_memory(initHeapSize);
if (FLAG_IS_DEFAULT(MaxHeapSize)) {
! if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// Currently the minimum size and the initial heap sizes are the same.
set_min_heap_size(initHeapSize);
}
if (FLAG_IS_DEFAULT(NewSize)) {
// Make the young generation 3/8ths of the total heap.
if (FLAG_SET_CMDLINE(size_t, NewSize,
! ((julong) MaxHeapSize / (julong) 8) * (julong) 3) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
}
#if !defined(_ALLBSD_SOURCE) && !defined(AIX) // UseLargePages is not yet supported on BSD and AIX.
FLAG_SET_DEFAULT(UseLargePages, true);
#endif
// Increase some data structure sizes for efficiency
! if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, TLABSize, 256 * K) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// See the OldPLABSize comment below, but replace 'after promotion'
// with 'after copying'. YoungPLABSize is the size of the survivor
// space per-gc-thread buffers. The default is 4kw.
! if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256 * K) != JVMFlag::SUCCESS) { // Note: this is in words
return JNI_EINVAL;
}
// OldPLABSize is the size of the buffers in the old gen that
// UseParallelGC uses to promote live data that doesn't fit in the
*** 2054,2086 ****
// is that a bigger PLAB results in retaining something like the
// original allocation order after promotion, which improves mutator
// locality. A minor effect may be that larger PLABs reduce the
// number of PLAB allocation events during gc. The value of 8kw
// was arrived at by experimenting with specjbb.
! if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8 * K) != Flag::SUCCESS) { // Note: this is in words
return JNI_EINVAL;
}
// Enable parallel GC and adaptive generation sizing
! if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// Encourage steady state memory management
! if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// This appears to improve mutator locality
! if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// Get around early Solaris scheduling bug
// (affinity vs other jobs on system)
// but disallow DR and offlining (5008695).
! if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
return JNI_OK;
}
--- 2053,2085 ----
// is that a bigger PLAB results in retaining something like the
// original allocation order after promotion, which improves mutator
// locality. A minor effect may be that larger PLABs reduce the
// number of PLAB allocation events during gc. The value of 8kw
// was arrived at by experimenting with specjbb.
! if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8 * K) != JVMFlag::SUCCESS) { // Note: this is in words
return JNI_EINVAL;
}
// Enable parallel GC and adaptive generation sizing
! if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// Encourage steady state memory management
! if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// This appears to improve mutator locality
! if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// Get around early Solaris scheduling bug
// (affinity vs other jobs on system)
// but disallow DR and offlining (5008695).
! if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
return JNI_OK;
}
*** 2452,2475 ****
// Setup flags for mixed which is the default
set_mode_flags(_mixed);
// Parse args structure generated from JAVA_TOOL_OPTIONS environment
// variable (if present).
! jint result = parse_each_vm_init_arg(java_tool_options_args, &patch_mod_javabase, Flag::ENVIRON_VAR);
if (result != JNI_OK) {
return result;
}
// Parse args structure generated from the command line flags.
! result = parse_each_vm_init_arg(cmd_line_args, &patch_mod_javabase, Flag::COMMAND_LINE);
if (result != JNI_OK) {
return result;
}
// Parse args structure generated from the _JAVA_OPTIONS environment
// variable (if present) (mimics classic VM)
! result = parse_each_vm_init_arg(java_options_args, &patch_mod_javabase, Flag::ENVIRON_VAR);
if (result != JNI_OK) {
return result;
}
// We need to ensure processor and memory resources have been properly
--- 2451,2474 ----
// Setup flags for mixed which is the default
set_mode_flags(_mixed);
// Parse args structure generated from JAVA_TOOL_OPTIONS environment
// variable (if present).
! jint result = parse_each_vm_init_arg(java_tool_options_args, &patch_mod_javabase, JVMFlag::ENVIRON_VAR);
if (result != JNI_OK) {
return result;
}
// Parse args structure generated from the command line flags.
! result = parse_each_vm_init_arg(cmd_line_args, &patch_mod_javabase, JVMFlag::COMMAND_LINE);
if (result != JNI_OK) {
return result;
}
// Parse args structure generated from the _JAVA_OPTIONS environment
// variable (if present) (mimics classic VM)
! result = parse_each_vm_init_arg(java_options_args, &patch_mod_javabase, JVMFlag::ENVIRON_VAR);
if (result != JNI_OK) {
return result;
}
// We need to ensure processor and memory resources have been properly
*** 2609,2619 ****
*out_ThreadStackSize = (intx)size_in_K;
return JNI_OK;
}
! jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_mod_javabase, Flag::Flags origin) {
// For match_option to return remaining or value part of option string
const char* tail;
// iterate over arguments
for (int index = 0; index < args->nOptions; index++) {
--- 2608,2618 ----
*out_ThreadStackSize = (intx)size_in_K;
return JNI_OK;
}
! jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_mod_javabase, JVMFlag::Flags origin) {
// For match_option to return remaining or value part of option string
const char* tail;
// iterate over arguments
for (int index = 0; index < args->nOptions; index++) {
*** 2642,2652 ****
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, load));
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, unload));
} else if (!strcmp(tail, ":gc")) {
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
} else if (!strcmp(tail, ":jni")) {
! if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
}
// -da / -ea / -disableassertions / -enableassertions
// These accept an optional class/package name separated by a colon, e.g.,
--- 2641,2651 ----
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, load));
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, unload));
} else if (!strcmp(tail, ":gc")) {
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
} else if (!strcmp(tail, ":jni")) {
! if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
}
// -da / -ea / -disableassertions / -enableassertions
// These accept an optional class/package name separated by a colon, e.g.,
*** 2776,2803 ****
}
}
#endif // !INCLUDE_JVMTI
// -Xnoclassgc
} else if (match_option(option, "-Xnoclassgc")) {
! if (FLAG_SET_CMDLINE(bool, ClassUnloading, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xconcgc
} else if (match_option(option, "-Xconcgc")) {
! if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
handle_extra_cms_flags("-Xconcgc uses UseConcMarkSweepGC");
// -Xnoconcgc
} else if (match_option(option, "-Xnoconcgc")) {
! if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
handle_extra_cms_flags("-Xnoconcgc uses UseConcMarkSweepGC");
// -Xbatch
} else if (match_option(option, "-Xbatch")) {
! if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xmn for compatibility with other JVM vendors
} else if (match_option(option, "-Xmn", &tail)) {
julong long_initial_young_size = 0;
--- 2775,2802 ----
}
}
#endif // !INCLUDE_JVMTI
// -Xnoclassgc
} else if (match_option(option, "-Xnoclassgc")) {
! if (FLAG_SET_CMDLINE(bool, ClassUnloading, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xconcgc
} else if (match_option(option, "-Xconcgc")) {
! if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
handle_extra_cms_flags("-Xconcgc uses UseConcMarkSweepGC");
// -Xnoconcgc
} else if (match_option(option, "-Xnoconcgc")) {
! if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
handle_extra_cms_flags("-Xnoconcgc uses UseConcMarkSweepGC");
// -Xbatch
} else if (match_option(option, "-Xbatch")) {
! if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xmn for compatibility with other JVM vendors
} else if (match_option(option, "-Xmn", &tail)) {
julong long_initial_young_size = 0;
*** 2806,2819 ****
jio_fprintf(defaultStream::error_stream(),
"Invalid initial young generation size: %s\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xms
} else if (match_option(option, "-Xms", &tail)) {
julong long_initial_heap_size = 0;
--- 2805,2818 ----
jio_fprintf(defaultStream::error_stream(),
"Invalid initial young generation size: %s\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xms
} else if (match_option(option, "-Xms", &tail)) {
julong long_initial_heap_size = 0;
*** 2826,2836 ****
return JNI_EINVAL;
}
set_min_heap_size((size_t)long_initial_heap_size);
// Currently the minimum size and the initial heap sizes are the same.
// Can be overridden with -XX:InitialHeapSize.
! if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xmx
} else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
julong long_max_heap_size = 0;
--- 2825,2835 ----
return JNI_EINVAL;
}
set_min_heap_size((size_t)long_initial_heap_size);
// Currently the minimum size and the initial heap sizes are the same.
// Can be overridden with -XX:InitialHeapSize.
! if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xmx
} else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
julong long_max_heap_size = 0;
*** 2839,2849 ****
jio_fprintf(defaultStream::error_stream(),
"Invalid maximum heap size: %s\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// Xmaxf
} else if (match_option(option, "-Xmaxf", &tail)) {
char* err;
--- 2838,2848 ----
jio_fprintf(defaultStream::error_stream(),
"Invalid maximum heap size: %s\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// Xmaxf
} else if (match_option(option, "-Xmaxf", &tail)) {
char* err;
*** 2852,2862 ****
jio_fprintf(defaultStream::error_stream(),
"Bad max heap free percentage size: %s\n",
option->optionString);
return JNI_EINVAL;
} else {
! if (FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf) != Flag::SUCCESS) {
return JNI_EINVAL;
}
}
// Xminf
} else if (match_option(option, "-Xminf", &tail)) {
--- 2851,2861 ----
jio_fprintf(defaultStream::error_stream(),
"Bad max heap free percentage size: %s\n",
option->optionString);
return JNI_EINVAL;
} else {
! if (FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
}
// Xminf
} else if (match_option(option, "-Xminf", &tail)) {
*** 2866,2887 ****
jio_fprintf(defaultStream::error_stream(),
"Bad min heap free percentage size: %s\n",
option->optionString);
return JNI_EINVAL;
} else {
! if (FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf) != Flag::SUCCESS) {
return JNI_EINVAL;
}
}
// -Xss
} else if (match_option(option, "-Xss", &tail)) {
intx value = 0;
jint err = parse_xss(option, tail, &value);
if (err != JNI_OK) {
return err;
}
! if (FLAG_SET_CMDLINE(intx, ThreadStackSize, value) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
julong long_ReservedCodeCacheSize = 0;
--- 2865,2886 ----
jio_fprintf(defaultStream::error_stream(),
"Bad min heap free percentage size: %s\n",
option->optionString);
return JNI_EINVAL;
} else {
! if (FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
}
// -Xss
} else if (match_option(option, "-Xss", &tail)) {
intx value = 0;
jint err = parse_xss(option, tail, &value);
if (err != JNI_OK) {
return err;
}
! if (FLAG_SET_CMDLINE(intx, ThreadStackSize, value) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
julong long_ReservedCodeCacheSize = 0;
*** 2890,2900 ****
if (errcode != arg_in_range) {
jio_fprintf(defaultStream::error_stream(),
"Invalid maximum code cache size: %s.\n", option->optionString);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -green
} else if (match_option(option, "-green")) {
jio_fprintf(defaultStream::error_stream(),
--- 2889,2899 ----
if (errcode != arg_in_range) {
jio_fprintf(defaultStream::error_stream(),
"Invalid maximum code cache size: %s.\n", option->optionString);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -green
} else if (match_option(option, "-green")) {
jio_fprintf(defaultStream::error_stream(),
*** 2904,2935 ****
} else if (match_option(option, "-native")) {
// HotSpot always uses native threads, ignore silently for compatibility
// -Xrs
} else if (match_option(option, "-Xrs")) {
// Classic/EVM option, new functionality
! if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xprof
} else if (match_option(option, "-Xprof")) {
char version[256];
// Obsolete in JDK 10
JDK_Version::jdk(10).to_string(version, sizeof(version));
warning("Ignoring option %s; support was removed in %s", option->optionString, version);
// -Xconcurrentio
} else if (match_option(option, "-Xconcurrentio")) {
! if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
SafepointSynchronize::set_defer_thr_suspend_loop_count();
! if (FLAG_SET_CMDLINE(bool, UseTLAB, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K) != Flag::SUCCESS) { // 20Kb per thread added to new generation
return JNI_EINVAL;
}
// -Xinternalversion
} else if (match_option(option, "-Xinternalversion")) {
--- 2903,2934 ----
} else if (match_option(option, "-native")) {
// HotSpot always uses native threads, ignore silently for compatibility
// -Xrs
} else if (match_option(option, "-Xrs")) {
// Classic/EVM option, new functionality
! if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xprof
} else if (match_option(option, "-Xprof")) {
char version[256];
// Obsolete in JDK 10
JDK_Version::jdk(10).to_string(version, sizeof(version));
warning("Ignoring option %s; support was removed in %s", option->optionString, version);
// -Xconcurrentio
} else if (match_option(option, "-Xconcurrentio")) {
! if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
SafepointSynchronize::set_defer_thr_suspend_loop_count();
! if (FLAG_SET_CMDLINE(bool, UseTLAB, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K) != JVMFlag::SUCCESS) { // 20Kb per thread added to new generation
return JNI_EINVAL;
}
// -Xinternalversion
} else if (match_option(option, "-Xinternalversion")) {
*** 2937,2947 ****
VM_Version::internal_vm_info_string());
vm_exit(0);
#ifndef PRODUCT
// -Xprintflags
} else if (match_option(option, "-Xprintflags")) {
! CommandLineFlags::printFlags(tty, false);
vm_exit(0);
#endif
// -D
} else if (match_option(option, "-D", &tail)) {
const char* value;
--- 2936,2946 ----
VM_Version::internal_vm_info_string());
vm_exit(0);
#ifndef PRODUCT
// -Xprintflags
} else if (match_option(option, "-Xprintflags")) {
! JVMFlag::printFlags(tty, false);
vm_exit(0);
#endif
// -D
} else if (match_option(option, "-D", &tail)) {
const char* value;
*** 2972,2982 ****
return JNI_ENOMEM;
}
// Out of the box management support
if (match_option(option, "-Dcom.sun.management", &tail)) {
#if INCLUDE_MANAGEMENT
! if (FLAG_SET_CMDLINE(bool, ManagementServer, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// management agent in module jdk.management.agent
if (!create_numbered_property("jdk.module.addmods", "jdk.management.agent", addmods_count++)) {
return JNI_ENOMEM;
--- 2971,2981 ----
return JNI_ENOMEM;
}
// Out of the box management support
if (match_option(option, "-Dcom.sun.management", &tail)) {
#if INCLUDE_MANAGEMENT
! if (FLAG_SET_CMDLINE(bool, ManagementServer, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// management agent in module jdk.management.agent
if (!create_numbered_property("jdk.module.addmods", "jdk.management.agent", addmods_count++)) {
return JNI_ENOMEM;
*** 2997,3055 ****
} else if (match_option(option, "-Xcomp")) {
// for testing the compiler; turn off all flags that inhibit compilation
set_mode_flags(_comp);
// -Xshare:dump
} else if (match_option(option, "-Xshare:dump")) {
! if (FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
set_mode_flags(_int); // Prevent compilation, which creates objects
// -Xshare:on
} else if (match_option(option, "-Xshare:on")) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xshare:auto
} else if (match_option(option, "-Xshare:auto")) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xshare:off
} else if (match_option(option, "-Xshare:off")) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// -Xverify
} else if (match_option(option, "-Xverify", &tail)) {
if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) {
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (strcmp(tail, ":remote") == 0) {
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (strcmp(tail, ":none") == 0) {
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
return JNI_EINVAL;
}
--- 2996,3054 ----
} else if (match_option(option, "-Xcomp")) {
// for testing the compiler; turn off all flags that inhibit compilation
set_mode_flags(_comp);
// -Xshare:dump
} else if (match_option(option, "-Xshare:dump")) {
! if (FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
set_mode_flags(_int); // Prevent compilation, which creates objects
// -Xshare:on
} else if (match_option(option, "-Xshare:on")) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xshare:auto
} else if (match_option(option, "-Xshare:auto")) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xshare:off
} else if (match_option(option, "-Xshare:off")) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xverify
} else if (match_option(option, "-Xverify", &tail)) {
if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) {
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (strcmp(tail, ":remote") == 0) {
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (strcmp(tail, ":none") == 0) {
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
return JNI_EINVAL;
}
*** 3104,3199 ****
} else if (match_option(option, "abort")) {
_abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
// Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
// and the last option wins.
} else if (match_option(option, "-XX:+NeverTenure")) {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+AlwaysTenure")) {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
uintx max_tenuring_thresh = 0;
if (!parse_uintx(tail, &max_tenuring_thresh, 0)) {
jio_fprintf(defaultStream::error_stream(),
"Improperly specified VM option \'MaxTenuringThreshold=%s\'\n", tail);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh) != Flag::SUCCESS) {
return JNI_EINVAL;
}
if (MaxTenuringThreshold == 0) {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
}
} else if (match_option(option, "-XX:+DisplayVMOutputToStderr")) {
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+DisplayVMOutputToStdout")) {
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
#if defined(DTRACE_ENABLED)
! if (FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
#else // defined(DTRACE_ENABLED)
jio_fprintf(defaultStream::error_stream(),
"ExtendedDTraceProbes flag is not applicable for this configuration\n");
return JNI_EINVAL;
#endif // defined(DTRACE_ENABLED)
#ifdef ASSERT
} else if (match_option(option, "-XX:+FullGCALot")) {
! if (FLAG_SET_CMDLINE(bool, FullGCALot, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
// disable scavenge before parallel mark-compact
! if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
return JNI_EINVAL;
}
#endif
#if !INCLUDE_MANAGEMENT
} else if (match_option(option, "-XX:+ManagementServer")) {
--- 3103,3198 ----
} else if (match_option(option, "abort")) {
_abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
// Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
// and the last option wins.
} else if (match_option(option, "-XX:+NeverTenure")) {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+AlwaysTenure")) {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
uintx max_tenuring_thresh = 0;
if (!parse_uintx(tail, &max_tenuring_thresh, 0)) {
jio_fprintf(defaultStream::error_stream(),
"Improperly specified VM option \'MaxTenuringThreshold=%s\'\n", tail);
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
if (MaxTenuringThreshold == 0) {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else {
! if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
}
} else if (match_option(option, "-XX:+DisplayVMOutputToStderr")) {
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+DisplayVMOutputToStdout")) {
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
#if defined(DTRACE_ENABLED)
! if (FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
#else // defined(DTRACE_ENABLED)
jio_fprintf(defaultStream::error_stream(),
"ExtendedDTraceProbes flag is not applicable for this configuration\n");
return JNI_EINVAL;
#endif // defined(DTRACE_ENABLED)
#ifdef ASSERT
} else if (match_option(option, "-XX:+FullGCALot")) {
! if (FLAG_SET_CMDLINE(bool, FullGCALot, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// disable scavenge before parallel mark-compact
! if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
#endif
#if !INCLUDE_MANAGEMENT
} else if (match_option(option, "-XX:+ManagementServer")) {
*** 3218,3231 ****
// PrintSharedArchiveAndExit will turn on
// -Xshare:on
// -Xlog:class+path=info
if (PrintSharedArchiveAndExit) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != Flag::SUCCESS) {
return JNI_EINVAL;
}
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
}
--- 3217,3230 ----
// PrintSharedArchiveAndExit will turn on
// -Xshare:on
// -Xlog:class+path=info
if (PrintSharedArchiveAndExit) {
! if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
! if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
}
*** 3940,3950 ****
if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions")) {
IgnoreUnrecognizedVMOptions = false;
continue;
}
if (match_option(option, "-XX:+PrintFlagsInitial")) {
! CommandLineFlags::printFlags(tty, false);
vm_exit(0);
}
if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
#if INCLUDE_NMT
// The launcher did not setup nmt environment variable properly.
--- 3939,3949 ----
if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions")) {
IgnoreUnrecognizedVMOptions = false;
continue;
}
if (match_option(option, "-XX:+PrintFlagsInitial")) {
! JVMFlag::printFlags(tty, false);
vm_exit(0);
}
if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
#if INCLUDE_NMT
// The launcher did not setup nmt environment variable properly.
*** 3969,3985 ****
#endif
}
#ifndef PRODUCT
if (match_option(option, "-XX:+PrintFlagsWithComments")) {
! CommandLineFlags::printFlags(tty, true);
vm_exit(0);
}
#endif
if (match_option(option, "-XX:+UseAppCDS")) {
! Flag* flag = Flag::find_flag("SharedArchiveFile", 17, true, true);
if (flag->is_diagnostic()) {
flag->clear_diagnostic();
}
continue;
}
--- 3968,3984 ----
#endif
}
#ifndef PRODUCT
if (match_option(option, "-XX:+PrintFlagsWithComments")) {
! JVMFlag::printFlags(tty, true);
vm_exit(0);
}
#endif
if (match_option(option, "-XX:+UseAppCDS")) {
! JVMFlag* flag = JVMFlag::find_flag("SharedArchiveFile", 17, true, true);
if (flag->is_diagnostic()) {
flag->clear_diagnostic();
}
continue;
}
*** 4031,4043 ****
jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent");
// Initialize ranges, constraints and writeables
! CommandLineFlagRangeList::init();
! CommandLineFlagConstraintList::init();
! CommandLineFlagWriteableList::init();
// If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
const char* hotspotrc = ".hotspotrc";
bool settings_file_specified = false;
bool needs_hotspotrc_warning = false;
--- 4030,4042 ----
jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent");
// Initialize ranges, constraints and writeables
! JVMFlagRangeList::init();
! JVMFlagConstraintList::init();
! JVMFlagWriteableList::init();
// If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
const char* hotspotrc = ".hotspotrc";
bool settings_file_specified = false;
bool needs_hotspotrc_warning = false;
*** 4334,4344 ****
}
}
#endif // PRODUCT
if (PrintCommandLineFlags) {
! CommandLineFlags::printSetFlags(tty);
}
// Apply CPU specific policy for the BiasedLocking
if (UseBiasedLocking) {
if (!VM_Version::use_biased_locking() &&
--- 4333,4343 ----
}
}
#endif // PRODUCT
if (PrintCommandLineFlags) {
! JVMFlag::printSetFlags(tty);
}
// Apply CPU specific policy for the BiasedLocking
if (UseBiasedLocking) {
if (!VM_Version::use_biased_locking() &&
src/hotspot/share/runtime/arguments.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File