Mercurial > hg > truffle
diff src/os/windows/vm/os_windows.cpp @ 14317:b59507f713e0
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
Summary: 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
author | rdurbin |
---|---|
date | Thu, 30 Jan 2014 14:12:22 -0800 |
parents | 5944dba4badc |
children | 6c9332549827 |
line wrap: on
line diff
--- a/src/os/windows/vm/os_windows.cpp Thu Jan 30 09:41:45 2014 +0100 +++ b/src/os/windows/vm/os_windows.cpp Thu Jan 30 14:12:22 2014 -0800 @@ -1810,32 +1810,30 @@ } buf[0] = '\0'; - if (Arguments::created_by_gamma_launcher()) { - // Support for the gamma launcher. Check for an - // JAVA_HOME environment variable - // and fix up the path so it looks like - // libjvm.so is installed there (append a fake suffix - // hotspot/libjvm.so). - char* java_home_var = ::getenv("JAVA_HOME"); - if (java_home_var != NULL && java_home_var[0] != 0) { - - strncpy(buf, java_home_var, buflen); - - // determine if this is a legacy image or modules image - // modules image doesn't have "jre" subdirectory - size_t len = strlen(buf); - char* jrebin_p = buf + len; - jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\"); - if (0 != _access(buf, 0)) { - jio_snprintf(jrebin_p, buflen-len, "\\bin\\"); - } - len = strlen(buf); - jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); - } - } - - if(buf[0] == '\0') { - GetModuleFileName(vm_lib_handle, buf, buflen); + if (Arguments::sun_java_launcher_is_altjvm()) { + // Support for the java launcher's '-XXaltjvm=<path>' option. Check + // for a JAVA_HOME environment variable and fix up the path so it + // looks like jvm.dll is installed there (append a fake suffix + // hotspot/jvm.dll). + char* java_home_var = ::getenv("JAVA_HOME"); + if (java_home_var != NULL && java_home_var[0] != 0) { + strncpy(buf, java_home_var, buflen); + + // determine if this is a legacy image or modules image + // modules image doesn't have "jre" subdirectory + size_t len = strlen(buf); + char* jrebin_p = buf + len; + jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\"); + if (0 != _access(buf, 0)) { + jio_snprintf(jrebin_p, buflen-len, "\\bin\\"); + } + len = strlen(buf); + jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); + } + } + + if (buf[0] == '\0') { + GetModuleFileName(vm_lib_handle, buf, buflen); } strcpy(saved_jvm_path, buf); }