8154239: -Xbootclasspath/a breaks exploded build

Correct exploded modules build system class path search for the boot loader

Reviewed-by: acorn, ccheung, hseigel, jiangli
This commit is contained in:
Lois Foltan 2016-07-26 10:29:27 -04:00
parent 2313844e20
commit 64f4953141
11 changed files with 338 additions and 312 deletions

View file

@ -85,7 +85,6 @@ 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;
int Arguments::_bootclassloader_append_index = -1;
// These parameters are reset in method parse_vm_init_args()
bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
@ -113,6 +112,7 @@ SystemProperty *Arguments::_jdk_boot_class_path_append = NULL;
GrowableArray<ModuleXPatchPath*> *Arguments::_xpatchprefix = NULL;
PathString *Arguments::_system_boot_class_path = NULL;
bool Arguments::_has_jimage = false;
char* Arguments::_ext_dirs = NULL;
@ -1305,6 +1305,11 @@ void Arguments::check_unsupported_dumping_properties() {
}
sp = sp->next();
}
// Check for an exploded module build in use with -Xshare:dump.
if (!has_jimage()) {
vm_exit_during_initialization("Dumping the shared archive is not supported with an exploded module build");
}
}
#endif
@ -2676,7 +2681,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* xpatch_
return JNI_EINVAL;
// -bootclasspath/a:
} else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
Arguments::set_bootclassloader_append_index((int)strlen(Arguments::get_sysclasspath())+1);
Arguments::append_sysclasspath(tail);
// -bootclasspath/p:
} else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
@ -3323,18 +3327,6 @@ void Arguments::add_xpatchprefix(const char* module_name, const char* path, bool
_xpatchprefix->push(new ModuleXPatchPath(module_name, path));
}
// Set property jdk.boot.class.path.append to the contents of the bootclasspath
// that follows either the jimage file or exploded module directories. The
// property will contain -Xbootclasspath/a and/or jvmti appended additions.
void Arguments::set_jdkbootclasspath_append() {
char *sysclasspath = get_sysclasspath();
assert(sysclasspath != NULL, "NULL sysclasspath");
int bcp_a_idx = bootclassloader_append_index();
if (bcp_a_idx != -1 && bcp_a_idx < (int)strlen(sysclasspath)) {
_jdk_boot_class_path_append->set_value(sysclasspath + bcp_a_idx);
}
}
// Remove all empty paths from the app classpath (if IgnoreEmptyClassPaths is enabled)
//
// This is necessary because some apps like to specify classpath like -cp foo.jar:${XYZ}:bar.jar
@ -3457,8 +3449,6 @@ jint Arguments::finalize_vm_init_args() {
return JNI_ERR;
}
Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1);
// This must be done after all arguments have been processed.
// java_compiler() true means set to "NONE" or empty.
if (java_compiler() && !xdebug_mode()) {