hotspot/src/share/vm/runtime/arguments.cpp
changeset 47103 a993ec29ec75
parent 46815 58689a7ca4e0
child 47104 6bdc0c9c44af
equal deleted inserted replaced
47098:e704f55561c3 47103:a993ec29ec75
  1289   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
  1289   assert(DumpSharedSpaces, "this function is only used with -Xshare:dump");
  1290   const char* unsupported_properties[] = { "jdk.module.main",
  1290   const char* unsupported_properties[] = { "jdk.module.main",
  1291                                            "jdk.module.limitmods",
  1291                                            "jdk.module.limitmods",
  1292                                            "jdk.module.path",
  1292                                            "jdk.module.path",
  1293                                            "jdk.module.upgrade.path",
  1293                                            "jdk.module.upgrade.path",
  1294                                            "jdk.module.addmods.0",
       
  1295                                            "jdk.module.patch.0" };
  1294                                            "jdk.module.patch.0" };
  1296   const char* unsupported_options[] = { "-m", // cannot use at dump time
  1295   const char* unsupported_options[] = { "-m", // cannot use at dump time
  1297                                         "--limit-modules", // ignored at dump time
  1296                                         "--limit-modules", // ignored at dump time
  1298                                         "--module-path", // ignored at dump time
  1297                                         "--module-path", // ignored at dump time
  1299                                         "--upgrade-module-path", // ignored at dump time
  1298                                         "--upgrade-module-path", // ignored at dump time
  1300                                         "--add-modules", // ignored at dump time
       
  1301                                         "--patch-module" // ignored at dump time
  1299                                         "--patch-module" // ignored at dump time
  1302                                       };
  1300                                       };
  1303   assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
  1301   assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
  1304   // If a vm option is found in the unsupported_options array with index less than the info_idx,
  1302   // If a vm option is found in the unsupported_options array with index less than the info_idx,
  1305   // vm will exit with an error message. Otherwise, it will print an informational message if
  1303   // vm will exit with an error message. Otherwise, it will print an informational message if
  2665   if (result != JNI_OK) {
  2663   if (result != JNI_OK) {
  2666     return result;
  2664     return result;
  2667   }
  2665   }
  2668 
  2666 
  2669   // Do final processing now that all arguments have been parsed
  2667   // Do final processing now that all arguments have been parsed
  2670   result = finalize_vm_init_args();
  2668   result = finalize_vm_init_args(patch_mod_javabase);
  2671   if (result != JNI_OK) {
  2669   if (result != JNI_OK) {
  2672     return result;
  2670     return result;
  2673   }
  2671   }
  2674 
       
  2675 #if INCLUDE_CDS
       
  2676   if (UseSharedSpaces && patch_mod_javabase) {
       
  2677     no_shared_spaces("CDS is disabled when " JAVA_BASE_NAME " module is patched.");
       
  2678   }
       
  2679 #endif
       
  2680 
  2672 
  2681   return JNI_OK;
  2673   return JNI_OK;
  2682 }
  2674 }
  2683 
  2675 
  2684 // Checks if name in command-line argument -agent{lib,path}:name[=options]
  2676 // Checks if name in command-line argument -agent{lib,path}:name[=options]
  3600     }
  3592     }
  3601   }
  3593   }
  3602   return nonEmptyDirs;
  3594   return nonEmptyDirs;
  3603 }
  3595 }
  3604 
  3596 
  3605 jint Arguments::finalize_vm_init_args() {
  3597 jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) {
  3606   // check if the default lib/endorsed directory exists; if so, error
  3598   // check if the default lib/endorsed directory exists; if so, error
  3607   char path[JVM_MAXPATHLEN];
  3599   char path[JVM_MAXPATHLEN];
  3608   const char* fileSep = os::file_separator();
  3600   const char* fileSep = os::file_separator();
  3609   jio_snprintf(path, JVM_MAXPATHLEN, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
  3601   jio_snprintf(path, JVM_MAXPATHLEN, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
  3610 
  3602 
  3721   if (UseJVMCICompiler) {
  3713   if (UseJVMCICompiler) {
  3722     Compilation_mode = CompMode_server;
  3714     Compilation_mode = CompMode_server;
  3723   }
  3715   }
  3724 #endif
  3716 #endif
  3725 
  3717 
       
  3718 #if INCLUDE_CDS
       
  3719   if (DumpSharedSpaces) {
       
  3720     // Disable biased locking now as it interferes with the clean up of
       
  3721     // the archived Klasses and Java string objects (at dump time only).
       
  3722     UseBiasedLocking = false;
       
  3723   }
       
  3724   if (UseSharedSpaces && patch_mod_javabase) {
       
  3725     no_shared_spaces("CDS is disabled when " JAVA_BASE_NAME " module is patched.");
       
  3726   }
       
  3727 #endif
       
  3728 
  3726   return JNI_OK;
  3729   return JNI_OK;
  3727 }
  3730 }
  3728 
  3731 
  3729 // Helper class for controlling the lifetime of JavaVMInitArgs
  3732 // Helper class for controlling the lifetime of JavaVMInitArgs
  3730 // objects.  The contents of the JavaVMInitArgs are guaranteed to be
  3733 // objects.  The contents of the JavaVMInitArgs are guaranteed to be