8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher

Decoupled the '-XXaltjvm=<path>' option from the gamma launcher.  Clearing the way for removing the remaining cruft associated with the previously removed gamma launcher.

Reviewed-by: dcubed, dholmes
This commit is contained in:
Ron Durbin 2014-01-30 14:12:22 -08:00
parent 455663f56e
commit 97d55c801e
9 changed files with 105 additions and 77 deletions

View file

@ -101,7 +101,7 @@ 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::_created_by_gamma_launcher = false;
bool Arguments::_sun_java_launcher_is_altjvm = false;
// These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
@ -151,7 +151,8 @@ static void logOption(const char* opt) {
// Process java launcher properties.
void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
// See if sun.java.launcher or sun.java.launcher.pid is defined.
// See if sun.java.launcher, sun.java.launcher.is_altjvm or
// sun.java.launcher.pid 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++) {
@ -162,6 +163,12 @@ void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) {
process_java_launcher_argument(tail, option->extraInfo);
continue;
}
if (match_option(option, "-Dsun.java.launcher.is_altjvm=", &tail)) {
if (strcmp(tail, "true") == 0) {
_sun_java_launcher_is_altjvm = true;
}
continue;
}
if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) {
_sun_java_launcher_pid = atoi(tail);
continue;
@ -1013,9 +1020,10 @@ bool Arguments::add_property(const char* prop) {
_java_command = value;
// Record value in Arguments, but let it get passed to Java.
} else if (strcmp(key, "sun.java.launcher.pid") == 0) {
// launcher.pid property is private and is processed
// in process_sun_java_launcher_properties();
} 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();
// the sun.java.launcher property is passed on to the java application
FreeHeap(key);
if (eq != NULL) {
@ -1800,9 +1808,6 @@ void Arguments::process_java_compiler_argument(char* arg) {
void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
_sun_java_launcher = strdup(launcher);
if (strcmp("gamma", _sun_java_launcher) == 0) {
_created_by_gamma_launcher = true;
}
}
bool Arguments::created_by_java_launcher() {
@ -1810,8 +1815,8 @@ bool Arguments::created_by_java_launcher() {
return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
}
bool Arguments::created_by_gamma_launcher() {
return _created_by_gamma_launcher;
bool Arguments::sun_java_launcher_is_altjvm() {
return _sun_java_launcher_is_altjvm;
}
//===========================================================================================================
@ -3765,16 +3770,6 @@ jint Arguments::apply_ergo() {
}
}
// set PauseAtExit if the gamma launcher was used and a debugger is attached
// but only if not already set on the commandline
if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) {
bool set = false;
CommandLineFlags::wasSetOnCmdline("PauseAtExit", &set);
if (!set) {
FLAG_SET_DEFAULT(PauseAtExit, true);
}
}
return JNI_OK;
}