--- a/src/hotspot/share/runtime/arguments.cpp Thu Oct 17 20:27:44 2019 +0100
+++ b/src/hotspot/share/runtime/arguments.cpp Thu Oct 17 20:53:35 2019 +0100
@@ -82,7 +82,6 @@
bool Arguments::_xdebug_mode = false;
const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
-int Arguments::_sun_java_launcher_pid = -1;
bool Arguments::_sun_java_launcher_is_altjvm = false;
// These parameters are reset in method parse_vm_init_args()
@@ -361,8 +360,7 @@
// Process java launcher properties.
void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
- // See if sun.java.launcher, sun.java.launcher.is_altjvm or
- // sun.java.launcher.pid is defined.
+ // See if sun.java.launcher or sun.java.launcher.is_altjvm is defined.
// Must do this before setting up other system properties,
// as some of them may depend on launcher type.
for (int index = 0; index < args->nOptions; index++) {
@@ -379,10 +377,6 @@
}
continue;
}
- if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) {
- _sun_java_launcher_pid = atoi(tail);
- continue;
- }
}
}
@@ -532,11 +526,14 @@
{ "MinRAMFraction", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
{ "InitialRAMFraction", JDK_Version::jdk(10), JDK_Version::undefined(), JDK_Version::undefined() },
{ "UseMembar", JDK_Version::jdk(10), JDK_Version::jdk(12), JDK_Version::undefined() },
- { "CompilationPolicyChoice", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::undefined() },
- { "FailOverToOldVerifier", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::undefined() },
{ "AllowJNIEnvProxy", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::jdk(15) },
{ "ThreadLocalHandshakes", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::jdk(15) },
{ "AllowRedefinitionToAddDeleteMethods", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "FlightRecorder", JDK_Version::jdk(13), JDK_Version::undefined(), JDK_Version::undefined() },
+ { "FieldsAllocationStyle", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
+ { "CompactFields", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
+ { "MonitorBound", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
+ { "G1RSetScanBlockSize", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) },
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
{ "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() },
@@ -550,18 +547,10 @@
{ "SharedReadOnlySize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
{ "SharedMiscDataSize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
{ "SharedMiscCodeSize", JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
- { "ProfilerPrintByteCodeStatistics", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfilerRecordPC", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfileVM", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfileIntervals", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfileIntervalsTicks", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfilerCheckIntervals", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfilerNumberOfInterpretedMethods", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfilerNumberOfCompiledMethods", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfilerNumberOfStubMethods", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "ProfilerNumberOfRuntimeStubNodes", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "UseImplicitStableValues", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
- { "NeedsDeoptSuspend", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
+ { "CompilationPolicyChoice", JDK_Version::jdk(13), JDK_Version::jdk(14), JDK_Version::jdk(15) },
+ { "FailOverToOldVerifier", JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(15) },
+ { "BindGCTaskThreadsToCPUs", JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(16) },
+ { "UseGCTaskAffinity", JDK_Version::undefined(), JDK_Version::jdk(14), JDK_Version::jdk(16) },
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
// These entries will generate build errors. Their purpose is to test the macros.
@@ -604,6 +593,7 @@
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepoint, cleanup) },
{ "TraceJVMTIObjectTagging", LogLevel::Debug, true, LOG_TAGS(jvmti, objecttagging) },
{ "TraceRedefineClasses", LogLevel::Info, false, LOG_TAGS(redefine, class) },
+ { "TraceNMethodInstalls", LogLevel::Info, true, LOG_TAGS(nmethod, install) },
{ NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG) }
};
@@ -634,14 +624,7 @@
}
}
-extern bool lookup_special_flag_ext(const char *flag_name, SpecialFlag& flag);
-
static bool lookup_special_flag(const char *flag_name, SpecialFlag& flag) {
- // Allow extensions to have priority
- if (lookup_special_flag_ext(flag_name, flag)) {
- return true;
- }
-
for (size_t i = 0; special_jvm_flags[i].name != NULL; i++) {
if ((strcmp(special_jvm_flags[i].name, flag_name) == 0)) {
flag = special_jvm_flags[i];
@@ -756,7 +739,7 @@
// 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) {
+ if (JVMFlag::find_declared_flag(flag.name) != NULL) {
// Temporarily disable the warning: 8196739
// warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
}
@@ -766,7 +749,7 @@
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) {
+ if (JVMFlag::find_declared_flag(flag.name) != NULL) {
// Temporarily disable the warning: 8196739
// warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
}
@@ -850,15 +833,15 @@
}
}
-static bool set_bool_flag(const char* name, bool value, JVMFlag::Flags origin) {
- if (JVMFlag::boolAtPut(name, &value, origin) == JVMFlag::SUCCESS) {
+static bool set_bool_flag(JVMFlag* flag, bool value, JVMFlag::Flags origin) {
+ if (JVMFlag::boolAtPut(flag, &value, origin) == JVMFlag::SUCCESS) {
return true;
} else {
return false;
}
}
-static bool set_fp_numeric_flag(const char* name, char* value, JVMFlag::Flags origin) {
+static bool set_fp_numeric_flag(JVMFlag* flag, char* value, JVMFlag::Flags origin) {
char* end;
errno = 0;
double v = strtod(value, &end);
@@ -866,26 +849,25 @@
return false;
}
- if (JVMFlag::doubleAtPut(name, &v, origin) == JVMFlag::SUCCESS) {
+ if (JVMFlag::doubleAtPut(flag, &v, origin) == JVMFlag::SUCCESS) {
return true;
}
return false;
}
-static bool set_numeric_flag(const char* name, char* value, JVMFlag::Flags origin) {
+static bool set_numeric_flag(JVMFlag* flag, 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) {
+
+ if (flag == NULL) {
return false;
}
// Check the sign first since atojulong() parses only unsigned values.
if (*value == '-') {
- if (!result->is_intx() && !result->is_int()) {
+ if (!flag->is_intx() && !flag->is_int()) {
return false;
}
value++;
@@ -894,48 +876,48 @@
if (!Arguments::atojulong(value, &v)) {
return false;
}
- if (result->is_int()) {
+ if (flag->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()) {
+ return JVMFlag::intAtPut(flag, &int_v, origin) == JVMFlag::SUCCESS;
+ } else if (flag->is_uint()) {
uint uint_v = (uint) v;
- return JVMFlag::uintAtPut(result, &uint_v, origin) == JVMFlag::SUCCESS;
- } else if (result->is_intx()) {
+ return JVMFlag::uintAtPut(flag, &uint_v, origin) == JVMFlag::SUCCESS;
+ } else if (flag->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()) {
+ return JVMFlag::intxAtPut(flag, &intx_v, origin) == JVMFlag::SUCCESS;
+ } else if (flag->is_uintx()) {
uintx uintx_v = (uintx) v;
- return JVMFlag::uintxAtPut(result, &uintx_v, origin) == JVMFlag::SUCCESS;
- } else if (result->is_uint64_t()) {
+ return JVMFlag::uintxAtPut(flag, &uintx_v, origin) == JVMFlag::SUCCESS;
+ } else if (flag->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()) {
+ return JVMFlag::uint64_tAtPut(flag, &uint64_t_v, origin) == JVMFlag::SUCCESS;
+ } else if (flag->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()) {
+ return JVMFlag::size_tAtPut(flag, &size_t_v, origin) == JVMFlag::SUCCESS;
+ } else if (flag->is_double()) {
double double_v = (double) v;
- return JVMFlag::doubleAtPut(result, &double_v, origin) == JVMFlag::SUCCESS;
+ return JVMFlag::doubleAtPut(flag, &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;
+static bool set_string_flag(JVMFlag* flag, const char* value, JVMFlag::Flags origin) {
+ if (JVMFlag::ccstrAtPut(flag, &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) {
+static bool append_to_string_flag(JVMFlag* flag, const char* new_value, JVMFlag::Flags origin) {
const char* old_value = "";
- if (JVMFlag::ccstrAt(name, &old_value) != JVMFlag::SUCCESS) return false;
+ if (JVMFlag::ccstrAt(flag, &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;
@@ -952,13 +934,11 @@
value = buf;
free_this_too = buf;
}
- (void) JVMFlag::ccstrAtPut(name, &value, origin);
+ (void) JVMFlag::ccstrAtPut(flag, &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);
- }
+ // JVMFlag made its own copy, so I must delete my own temp. buffer.
+ FREE_C_HEAP_ARRAY(char, free_this_too);
return true;
}
@@ -1047,7 +1027,8 @@
if (real_name == NULL) {
return false;
}
- return set_bool_flag(real_name, false, origin);
+ JVMFlag* flag = JVMFlag::find_flag(real_name);
+ return set_bool_flag(flag, false, origin);
}
if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
@@ -1059,13 +1040,13 @@
if (real_name == NULL) {
return false;
}
- return set_bool_flag(real_name, true, origin);
+ JVMFlag* flag = JVMFlag::find_flag(real_name);
+ return set_bool_flag(flag, true, origin);
}
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);
@@ -1077,15 +1058,15 @@
if (real_name == NULL) {
return false;
}
- flag = JVMFlag::find_flag(real_name);
+ JVMFlag* 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);
+ return append_to_string_flag(flag, value, origin);
} else {
if (value[0] == '\0') {
value = NULL;
}
- return set_string_flag(real_name, value, origin);
+ return set_string_flag(flag, value, origin);
}
} else {
warn_if_deprecated = false; // if arg is deprecated, we've already done warning...
@@ -1102,7 +1083,8 @@
if (real_name == NULL) {
return false;
}
- return set_string_flag(real_name, value, origin);
+ JVMFlag* flag = JVMFlag::find_flag(real_name);
+ return set_string_flag(flag, value, origin);
}
#define SIGNED_FP_NUMBER_RANGE "[-0123456789.eE+]"
@@ -1117,7 +1099,8 @@
if (real_name == NULL) {
return false;
}
- return set_fp_numeric_flag(real_name, value, origin);
+ JVMFlag* flag = JVMFlag::find_flag(real_name);
+ return set_fp_numeric_flag(flag, value, origin);
}
}
@@ -1127,7 +1110,8 @@
if (real_name == NULL) {
return false;
}
- return set_numeric_flag(real_name, value, origin);
+ JVMFlag* flag = JVMFlag::find_flag(real_name);
+ return set_numeric_flag(flag, value, origin);
}
return false;
@@ -1283,7 +1267,7 @@
// 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);
+ const JVMFlag* found_flag = JVMFlag::find_declared_flag((const char*)argname, arg_len);
if (found_flag != NULL) {
char locked_message_buf[BUFLEN];
JVMFlag::MsgType msg_type = found_flag->get_locked_message(locked_message_buf, BUFLEN);
@@ -1422,10 +1406,9 @@
if (strcmp(key, "java.compiler") == 0) {
process_java_compiler_argument(value);
// Record value in Arguments, but let it get passed to Java.
- } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0 ||
- strcmp(key, "sun.java.launcher.pid") == 0) {
- // sun.java.launcher.is_altjvm and sun.java.launcher.pid property are
- // private and are processed in process_sun_java_launcher_properties();
+ } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0) {
+ // sun.java.launcher.is_altjvm property is
+ // private and is processed in process_sun_java_launcher_properties();
// the sun.java.launcher property is passed on to the java application
} else if (strcmp(key, "sun.boot.library.path") == 0) {
// append is true, writable is true, internal is false
@@ -1471,7 +1454,7 @@
"--patch-module"
};
void Arguments::check_unsupported_dumping_properties() {
- assert(DumpSharedSpaces || DynamicDumpSharedSpaces,
+ assert(is_dumping_archive(),
"this function is only used with CDS dump time");
assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
// If a vm option is found in the unsupported_options array, vm will exit with an error message.
@@ -1628,8 +1611,8 @@
#ifdef _LP64
// MaxHeapSize is not set up properly at this point, but
// the only value that can override MaxHeapSize if we are
- // to use UseCompressedOops is InitialHeapSize.
- size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize);
+ // to use UseCompressedOops are InitialHeapSize and MinHeapSize.
+ size_t max_heap_size = MAX3(MaxHeapSize, InitialHeapSize, MinHeapSize);
if (max_heap_size <= max_heap_for_compressed_oops()) {
#if !defined(COMPILER1) || defined(TIERED)
@@ -1722,9 +1705,33 @@
static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
void Arguments::set_heap_size() {
- julong phys_mem =
- FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
- : (julong)MaxRAM;
+ julong phys_mem;
+
+ // If the user specified one of these options, they
+ // want specific memory sizing so do not limit memory
+ // based on compressed oops addressability.
+ // Also, memory limits will be calculated based on
+ // available os physical memory, not our MaxRAM limit,
+ // unless MaxRAM is also specified.
+ bool override_coop_limit = (!FLAG_IS_DEFAULT(MaxRAMPercentage) ||
+ !FLAG_IS_DEFAULT(MaxRAMFraction) ||
+ !FLAG_IS_DEFAULT(MinRAMPercentage) ||
+ !FLAG_IS_DEFAULT(MinRAMFraction) ||
+ !FLAG_IS_DEFAULT(InitialRAMPercentage) ||
+ !FLAG_IS_DEFAULT(InitialRAMFraction) ||
+ !FLAG_IS_DEFAULT(MaxRAM));
+ if (override_coop_limit) {
+ if (FLAG_IS_DEFAULT(MaxRAM)) {
+ phys_mem = os::physical_memory();
+ FLAG_SET_ERGO(MaxRAM, (uint64_t)phys_mem);
+ } else {
+ phys_mem = (julong)MaxRAM;
+ }
+ } else {
+ phys_mem = FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
+ : (julong)MaxRAM;
+ }
+
// Convert deprecated flags
if (FLAG_IS_DEFAULT(MaxRAMPercentage) &&
@@ -1758,6 +1765,8 @@
// Limit the heap size to ErgoHeapSizeLimit
reasonable_max = MIN2(reasonable_max, (julong)ErgoHeapSizeLimit);
}
+
+#ifdef _LP64
if (UseCompressedOops) {
// Limit the heap size to the maximum possible when using compressed oops
julong max_coop_heap = (julong)max_heap_for_compressed_oops();
@@ -1780,8 +1789,26 @@
// but it should be not less than default MaxHeapSize.
max_coop_heap -= HeapBaseMinAddress;
}
- reasonable_max = MIN2(reasonable_max, max_coop_heap);
+
+ // If user specified flags prioritizing os physical
+ // memory limits, then disable compressed oops if
+ // limits exceed max_coop_heap and UseCompressedOops
+ // was not specified.
+ if (reasonable_max > max_coop_heap) {
+ if (FLAG_IS_ERGO(UseCompressedOops) && override_coop_limit) {
+ log_info(cds)("UseCompressedOops and UseCompressedClassPointers have been disabled due to"
+ " max heap " SIZE_FORMAT " > compressed oop heap " SIZE_FORMAT ". "
+ "Please check the setting of MaxRAMPercentage %5.2f."
+ ,(size_t)reasonable_max, (size_t)max_coop_heap, MaxRAMPercentage);
+ FLAG_SET_ERGO(UseCompressedOops, false);
+ FLAG_SET_ERGO(UseCompressedClassPointers, false);
+ } else {
+ reasonable_max = MIN2(reasonable_max, max_coop_heap);
+ }
+ }
}
+#endif // _LP64
+
reasonable_max = limit_by_allocatable_memory(reasonable_max);
if (!FLAG_IS_DEFAULT(InitialHeapSize)) {
@@ -1790,6 +1817,8 @@
// after call to limit_by_allocatable_memory because that
// method might reduce the allocation size.
reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize);
+ } else if (!FLAG_IS_DEFAULT(MinHeapSize)) {
+ reasonable_max = MAX2(reasonable_max, (julong)MinHeapSize);
}
log_trace(gc, heap)(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max);
@@ -1813,13 +1842,13 @@
reasonable_initial = limit_by_allocatable_memory(reasonable_initial);
- log_trace(gc, heap)(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial);
FLAG_SET_ERGO(InitialHeapSize, (size_t)reasonable_initial);
+ log_trace(gc, heap)(" Initial heap size " SIZE_FORMAT, InitialHeapSize);
}
- // If the minimum heap size has not been set (via -Xms),
+ // If the minimum heap size has not been set (via -Xms or -XX:MinHeapSize),
// synchronize with InitialHeapSize to avoid errors with the default value.
if (MinHeapSize == 0) {
- MinHeapSize = MIN2((size_t)reasonable_minimum, InitialHeapSize);
+ FLAG_SET_ERGO(MinHeapSize, MIN2((size_t)reasonable_minimum, InitialHeapSize));
log_trace(gc, heap)(" Minimum heap size " SIZE_FORMAT, MinHeapSize);
}
}
@@ -1861,8 +1890,9 @@
if (FLAG_SET_CMDLINE(InitialHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
- // Currently the minimum size and the initial heap sizes are the same.
- MinHeapSize = initHeapSize;
+ if (FLAG_SET_CMDLINE(MinHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
+ return JNI_EINVAL;
+ }
}
if (FLAG_IS_DEFAULT(NewSize)) {
// Make the young generation 3/8ths of the total heap.
@@ -1929,13 +1959,6 @@
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(BindGCTaskThreadsToCPUs, true) != JVMFlag::SUCCESS) {
- return JNI_EINVAL;
- }
-
return JNI_OK;
}
@@ -2553,19 +2576,19 @@
}
// -Xms
} else if (match_option(option, "-Xms", &tail)) {
- julong long_initial_heap_size = 0;
+ julong size = 0;
// an initial heap size of 0 means automatically determine
- ArgsRange errcode = parse_memory_size(tail, &long_initial_heap_size, 0);
+ ArgsRange errcode = parse_memory_size(tail, &size, 0);
if (errcode != arg_in_range) {
jio_fprintf(defaultStream::error_stream(),
"Invalid initial heap size: %s\n", option->optionString);
describe_range_error(errcode);
return JNI_EINVAL;
}
- MinHeapSize = (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(InitialHeapSize, (size_t)long_initial_heap_size) != JVMFlag::SUCCESS) {
+ if (FLAG_SET_CMDLINE(MinHeapSize, (size_t)size) != JVMFlag::SUCCESS) {
+ return JNI_EINVAL;
+ }
+ if (FLAG_SET_CMDLINE(InitialHeapSize, (size_t)size) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
// -Xmx
@@ -2833,7 +2856,7 @@
if (FLAG_SET_CMDLINE(AlwaysTenure, false) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
- if (FLAG_SET_CMDLINE(MaxTenuringThreshold, markOopDesc::max_age + 1) != JVMFlag::SUCCESS) {
+ if (FLAG_SET_CMDLINE(MaxTenuringThreshold, markWord::max_age + 1) != JVMFlag::SUCCESS) {
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+AlwaysTenure")) {
@@ -3420,14 +3443,6 @@
void Arguments::set_shared_spaces_flags() {
if (DumpSharedSpaces) {
- if (FailOverToOldVerifier) {
- // Don't fall back to the old verifier on verification failure. If a
- // class fails verification with the split verifier, it might fail the
- // CDS runtime verifier constraint check. In that case, we don't want
- // to share the class. We only archive classes that pass the split verifier.
- FLAG_SET_DEFAULT(FailOverToOldVerifier, false);
- }
-
if (RequireSharedSpaces) {
warning("Cannot dump shared archive while using shared archive");
}
@@ -3458,10 +3473,8 @@
size_t file_sep_len = strlen(os::file_separator());
const size_t len = jvm_path_len + file_sep_len + 20;
default_archive_path = NEW_C_HEAP_ARRAY(char, len, mtArguments);
- if (default_archive_path != NULL) {
- jio_snprintf(default_archive_path, len, "%s%sclasses.jsa",
- jvm_path, os::file_separator());
- }
+ jio_snprintf(default_archive_path, len, "%s%sclasses.jsa",
+ jvm_path, os::file_separator());
return default_archive_path;
}
@@ -3524,20 +3537,20 @@
SharedArchivePath = get_default_shared_archive_path();
} else {
int archives = num_archives(SharedArchiveFile);
- if (DynamicDumpSharedSpaces || DumpSharedSpaces) {
+ if (is_dumping_archive()) {
if (archives > 1) {
vm_exit_during_initialization(
"Cannot have more than 1 archive file specified in -XX:SharedArchiveFile during CDS dumping");
}
if (DynamicDumpSharedSpaces) {
- if (FileMapInfo::same_files(SharedArchiveFile, ArchiveClassesAtExit)) {
+ if (os::same_files(SharedArchiveFile, ArchiveClassesAtExit)) {
vm_exit_during_initialization(
"Cannot have the same archive file specified for -XX:SharedArchiveFile and -XX:ArchiveClassesAtExit",
SharedArchiveFile);
}
}
}
- if (!DynamicDumpSharedSpaces && !DumpSharedSpaces){
+ if (!is_dumping_archive()){
if (archives > 2) {
vm_exit_during_initialization(
"Cannot have more than 2 archive files specified in the -XX:SharedArchiveFile option");