Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083428 | emb-9 | Jiangli Zhou | P4 | Resolved | Fixed | b38 |
The following loop in Arguments::parse() can be optimized with 'continue' at the end of each matching option:
for (index = 0; index < args->nOptions; index++) {
const JavaVMOption *option = args->options + index;
if (match_option(option, "-XX:Flags=", &tail)) {
flags_file = tail;
settings_file_specified = true;
}
if (match_option(option, "-XX:+PrintVMOptions", &tail)) {
PrintVMOptions = true;
}
if (match_option(option, "-XX:-PrintVMOptions", &tail)) {
PrintVMOptions = false;
}
if (match_option(option, "-XX:+IgnoreUnrecognizedVMOptions", &tail)) {
IgnoreUnrecognizedVMOptions = true;
}
if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) {
IgnoreUnrecognizedVMOptions = false;
}
if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
CommandLineFlags::printFlags(tty, false);
vm_exit(0);
}
#if INCLUDE_NMT
if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
// The launcher did not setup nmt environment variable properly.
if (!MemTracker::check_launcher_nmt_support(tail)) {
warning("Native Memory Tracking did not setup properly, using wrong launcher?");
}
// Verify if nmt option is valid.
if (MemTracker::verify_nmt_option()) {
// Late initialization, still in single-threaded mode.
if (MemTracker::tracking_level() >= NMT_summary) {
MemTracker::init();
}
} else {
vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
}
}
#endif
#ifndef PRODUCT
if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) {
CommandLineFlags::printFlags(tty, true);
vm_exit(0);
}
#endif
}
for (index = 0; index < args->nOptions; index++) {
const JavaVMOption *option = args->options + index;
if (match_option(option, "-XX:Flags=", &tail)) {
flags_file = tail;
settings_file_specified = true;
}
if (match_option(option, "-XX:+PrintVMOptions", &tail)) {
PrintVMOptions = true;
}
if (match_option(option, "-XX:-PrintVMOptions", &tail)) {
PrintVMOptions = false;
}
if (match_option(option, "-XX:+IgnoreUnrecognizedVMOptions", &tail)) {
IgnoreUnrecognizedVMOptions = true;
}
if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) {
IgnoreUnrecognizedVMOptions = false;
}
if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
CommandLineFlags::printFlags(tty, false);
vm_exit(0);
}
#if INCLUDE_NMT
if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
// The launcher did not setup nmt environment variable properly.
if (!MemTracker::check_launcher_nmt_support(tail)) {
warning("Native Memory Tracking did not setup properly, using wrong launcher?");
}
// Verify if nmt option is valid.
if (MemTracker::verify_nmt_option()) {
// Late initialization, still in single-threaded mode.
if (MemTracker::tracking_level() >= NMT_summary) {
MemTracker::init();
}
} else {
vm_exit_during_initialization("Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", NULL);
}
}
#endif
#ifndef PRODUCT
if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) {
CommandLineFlags::printFlags(tty, true);
vm_exit(0);
}
#endif
}
- backported by
-
JDK-8083428 The loop in Arguments::parse() can be enhanced
-
- Resolved
-