< prev index next >

src/share/vm/runtime/arguments.hpp

Print this page
rev 11608 : Harold's patch v1
rev 11609 : imported patch bug_8136930.hs2.patch

@@ -41,11 +41,11 @@
   typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args)  ATTRIBUTE_PRINTF(2, 0);
 }
 
 // PathString is used as:
 //  - the underlying value for a SystemProperty
-//  - the path portion of an -Xpatch module/path pair
+//  - the path portion of an --patch-module module/path pair
 //  - the string that represents the system boot class path, Arguments::_system_boot_class_path.
 class PathString : public CHeapObj<mtArguments> {
  protected:
   char* _value;
  public:

@@ -105,25 +105,25 @@
       _value = NULL;
     }
   }
 };
 
-// ModuleXPatchPath records the module/path pair as specified to -Xpatch.
-class ModuleXPatchPath : public CHeapObj<mtInternal> {
+// ModulePatchPath records the module/path pair as specified to --patch-module.
+class ModulePatchPath : public CHeapObj<mtInternal> {
 private:
   char* _module_name;
   PathString* _path;
 public:
-  ModuleXPatchPath(const char* module_name, const char* path) {
+  ModulePatchPath(const char* module_name, const char* path) {
     assert(module_name != NULL && path != NULL, "Invalid module name or path value");
     size_t len = strlen(module_name) + 1;
     _module_name = AllocateHeap(len, mtInternal);
     strncpy(_module_name, module_name, len); // copy the trailing null
     _path =  new PathString(path);
   }
 
-  ~ModuleXPatchPath() {
+  ~ModulePatchPath() {
     if (_module_name != NULL) {
       FreeHeap(_module_name);
       _module_name = NULL;
     }
     if (_path != NULL) {

@@ -156,10 +156,14 @@
   const char* key() const             { return _key; }
   bool internal() const               { return _internal; }
   SystemProperty* next() const        { return _next; }
   void set_next(SystemProperty* next) { _next = next; }
 
+  bool is_readable() const {
+    return !_internal || strcmp(_key, "jdk.boot.class.path.append") == 0;
+  }
+
   // A system property should only have its value set
   // via an external interface if it is a writeable property.
   // The internal, non-writeable property jdk.boot.class.path.append
   // is the only exception to this rule.  It can be set externally
   // via -Xbootclasspath/a or JVMTI OnLoad phase call to AddToBootstrapClassLoaderSearch.

@@ -323,10 +327,25 @@
     arg_too_small  = -2,
     arg_too_big    = -1,
     arg_in_range   = 0
   };
 
+  enum PropertyAppendable {
+    AppendProperty,
+    AddProperty
+  };
+
+  enum PropertyWriteable {
+    WriteableProperty,
+    UnwriteableProperty
+  };
+
+  enum PropertyInternal {
+    InternalProperty,
+    ExternalProperty
+  };
+
  private:
 
   // a pointer to the flags file name if it is specified
   static char*  _jvm_flags_file;
   // an array containing all flags specified in the .hotspotrc file

@@ -346,22 +365,22 @@
   static SystemProperty *_java_library_path;
   static SystemProperty *_java_home;
   static SystemProperty *_java_class_path;
   static SystemProperty *_jdk_boot_class_path_append;
 
-  // -Xpatch:module=<file>(<pathsep><file>)*
+  // --patch-module=module=<file>(<pathsep><file>)*
   // Each element contains the associated module name, path
-  // string pair as specified to -Xpatch.
-  static GrowableArray<ModuleXPatchPath*>* _xpatchprefix;
+  // string pair as specified to --patch-module.
+  static GrowableArray<ModulePatchPath*>* _patch_mod_prefix;
 
   // The constructed value of the system class path after
   // argument processing and JVMTI OnLoad additions via
   // calls to AddToBootstrapClassLoaderSearch.  This is the
   // final form before ClassLoader::setup_bootstrap_search().
-  // Note: since -Xpatch is a module name/path pair, the system
-  // boot class path string no longer contains the "prefix" to
-  // the boot class path base piece as it did when
+  // Note: since --patch-module is a module name/path pair, the
+  // system boot class path string no longer contains the "prefix"
+  // to the boot class path base piece as it did when
   // -Xbootclasspath/p was supported.
   static PathString *_system_boot_class_path;
 
   // temporary: to emit warning if the default ext dirs are not empty.
   // remove this variable when the warning is no longer needed.

@@ -462,11 +481,17 @@
   static abort_hook_t     _abort_hook;
   static exit_hook_t      _exit_hook;
   static vfprintf_hook_t  _vfprintf_hook;
 
   // System properties
-  static bool add_property(const char* prop);
+  static bool add_property(const char* prop, PropertyWriteable writeable=WriteableProperty,
+                           PropertyInternal internal=ExternalProperty);
+
+  static bool create_property(const char* prop_name, const char* prop_value, PropertyInternal internal);
+  static bool create_numbered_property(const char* prop_base_name, const char* prop_value, unsigned int count);
+
+  static int process_patch_mod_option(const char* patch_mod_tail, bool* patch_mod_javabase);
 
   // Miscellaneous system property setter
   static bool append_to_addmods_property(const char* module_name);
 
   // Aggressive optimization flags.

@@ -500,11 +525,11 @@
   static bool handle_deprecated_print_gc_flags();
 
   static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args,
                                  const JavaVMInitArgs *java_options_args,
                                  const JavaVMInitArgs *cmd_line_args);
-  static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* xpatch_javabase, Flag::Flags origin);
+  static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_mod_javabase, Flag::Flags origin);
   static jint finalize_vm_init_args();
   static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type);
 
   static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
     return is_bad_option(option, ignore, NULL);

@@ -719,39 +744,43 @@
   static void init_version_specific_system_properties();
 
   // Property List manipulation
   static void PropertyList_add(SystemProperty *element);
   static void PropertyList_add(SystemProperty** plist, SystemProperty *element);
-  static void PropertyList_add(SystemProperty** plist, const char* k, const char* v);
-  static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v) {
-    PropertyList_unique_add(plist, k, v, false);
-  }
-  static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v, jboolean append);
+  static void PropertyList_add(SystemProperty** plist, const char* k, const char* v, bool writeable, bool internal);
+
+  static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v,
+                                      PropertyAppendable append, PropertyWriteable writeable,
+                                      PropertyInternal internal);
   static const char* PropertyList_get_value(SystemProperty* plist, const char* key);
+  static const char* PropertyList_get_readable_value(SystemProperty* plist, const char* key);
   static int  PropertyList_count(SystemProperty* pl);
+  static int  PropertyList_readable_count(SystemProperty* pl);
   static const char* PropertyList_get_key_at(SystemProperty* pl,int index);
   static char* PropertyList_get_value_at(SystemProperty* pl,int index);
 
+  static bool is_internal_module_property(const char* option);
+
   // Miscellaneous System property value getter and setters.
   static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); }
   static void set_java_home(const char *value) { _java_home->set_value(value); }
   static void set_library_path(const char *value) { _java_library_path->set_value(value); }
   static void set_ext_dirs(char *value)     { _ext_dirs = os::strdup_check_oom(value); }
 
   // Set up the underlying pieces of the system boot class path
-  static void add_xpatchprefix(const char *module_name, const char *path, bool* xpatch_javabase);
+  static void add_patch_mod_prefix(const char *module_name, const char *path, bool* patch_mod_javabase);
   static void set_sysclasspath(const char *value) {
     _system_boot_class_path->set_value(value);
     set_jdkbootclasspath_append();
   }
   static void append_sysclasspath(const char *value) {
     _system_boot_class_path->append_value(value);
     set_jdkbootclasspath_append();
   }
   static void set_jdkbootclasspath_append();
 
-  static GrowableArray<ModuleXPatchPath*>* get_xpatchprefix() { return _xpatchprefix; }
+  static GrowableArray<ModulePatchPath*>* get_patch_mod_prefix() { return _patch_mod_prefix; }
   static char* get_sysclasspath() { return _system_boot_class_path->value(); }
   static char* get_jdk_boot_class_path_append() { return _jdk_boot_class_path_append->value(); }
 
   static char* get_java_home()    { return _java_home->value(); }
   static char* get_dll_dir()      { return _sun_boot_library_path->value(); }
< prev index next >