73 void append_value(const char *value);
74
75 PathString(const char* value);
76 ~PathString();
77
78 // for JVM_ReadSystemPropertiesInfo
79 static int value_offset_in_bytes() { return (int)offset_of(PathString, _value); }
80 };
81
82 // ModulePatchPath records the module/path pair as specified to --patch-module.
83 class ModulePatchPath : public CHeapObj<mtInternal> {
84 private:
85 char* _module_name;
86 PathString* _path;
87 public:
88 ModulePatchPath(const char* module_name, const char* path);
89 ~ModulePatchPath();
90
91 inline const char* module_name() const { return _module_name; }
92 inline char* path_string() const { return _path->value(); }
93 };
94
95 // Element describing System and User (-Dkey=value flags) defined property.
96 //
97 // An internal SystemProperty is one that has been removed in
98 // jdk.internal.VM.saveAndRemoveProperties, like jdk.boot.class.path.append.
99 //
100 class SystemProperty : public PathString {
101 private:
102 char* _key;
103 SystemProperty* _next;
104 bool _internal;
105 bool _writeable;
106
107 public:
108 // Accessors
109 char* value() const { return PathString::value(); }
110 const char* key() const { return _key; }
111 bool internal() const { return _internal; }
112 SystemProperty* next() const { return _next; }
460 static void PropertyList_add(SystemProperty** plist, const char* k, const char* v, bool writeable, bool internal);
461
462 static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v,
463 PropertyAppendable append, PropertyWriteable writeable,
464 PropertyInternal internal);
465 static const char* PropertyList_get_value(SystemProperty* plist, const char* key);
466 static const char* PropertyList_get_readable_value(SystemProperty* plist, const char* key);
467 static int PropertyList_count(SystemProperty* pl);
468 static int PropertyList_readable_count(SystemProperty* pl);
469
470 static bool is_internal_module_property(const char* option);
471 static bool is_incompatible_cds_internal_module_property(const char* property);
472
473 // Miscellaneous System property value getter and setters.
474 static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); }
475 static void set_java_home(const char *value) { _java_home->set_value(value); }
476 static void set_library_path(const char *value) { _java_library_path->set_value(value); }
477 static void set_ext_dirs(char *value);
478
479 // Set up the underlying pieces of the boot class path
480 static void add_patch_mod_prefix(const char *module_name, const char *path);
481 static void set_boot_class_path(const char *value, bool has_jimage) {
482 // During start up, set by os::set_boot_path()
483 assert(get_boot_class_path() == nullptr, "Boot class path previously set");
484 _boot_class_path->set_value(value);
485 _has_jimage = has_jimage;
486 }
487 static void append_sysclasspath(const char *value) {
488 _boot_class_path->append_value(value);
489 _jdk_boot_class_path_append->append_value(value);
490 }
491
492 static GrowableArray<ModulePatchPath*>* get_patch_mod_prefix() { return _patch_mod_prefix; }
493 static char* get_boot_class_path() { return _boot_class_path->value(); }
494 static bool has_jimage() { return _has_jimage; }
495
496 static char* get_java_home() { return _java_home->value(); }
497 static char* get_dll_dir() { return _sun_boot_library_path->value(); }
498 static char* get_appclasspath() { return _java_class_path->value(); }
499 static void fix_appclasspath();
500
501 // Operation modi
502 static Mode mode() { return _mode; }
503 static void set_mode_flags(Mode mode);
504 static bool is_interpreter_only() { return mode() == _int; }
505 static bool is_compiler_only() { return mode() == _comp; }
506
507
508 // preview features
509 static void set_enable_preview() { _enable_preview = true; }
510 static bool enable_preview() { return _enable_preview; }
511
512 // jdwp
513 static bool has_jdwp_agent() { return _has_jdwp_agent; }
514
515 // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid.
516 static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen);
517
518 static bool atojulong(const char *s, julong* result);
519
520 static bool has_jfr_option() NOT_JFR_RETURN_(false);
521
522 DEBUG_ONLY(static bool verify_special_jvm_flags(bool check_globals);)
523 };
524
525 // Disable options not supported in this release, with a warning if they
526 // were explicitly requested on the command-line
527 #define UNSUPPORTED_OPTION(opt) \
528 do { \
529 if (opt) { \
530 if (FLAG_IS_CMDLINE(opt)) { \
|
73 void append_value(const char *value);
74
75 PathString(const char* value);
76 ~PathString();
77
78 // for JVM_ReadSystemPropertiesInfo
79 static int value_offset_in_bytes() { return (int)offset_of(PathString, _value); }
80 };
81
82 // ModulePatchPath records the module/path pair as specified to --patch-module.
83 class ModulePatchPath : public CHeapObj<mtInternal> {
84 private:
85 char* _module_name;
86 PathString* _path;
87 public:
88 ModulePatchPath(const char* module_name, const char* path);
89 ~ModulePatchPath();
90
91 inline const char* module_name() const { return _module_name; }
92 inline char* path_string() const { return _path->value(); }
93 inline void append_path(const char* path) { _path->append_value(path); }
94 };
95
96 // Element describing System and User (-Dkey=value flags) defined property.
97 //
98 // An internal SystemProperty is one that has been removed in
99 // jdk.internal.VM.saveAndRemoveProperties, like jdk.boot.class.path.append.
100 //
101 class SystemProperty : public PathString {
102 private:
103 char* _key;
104 SystemProperty* _next;
105 bool _internal;
106 bool _writeable;
107
108 public:
109 // Accessors
110 char* value() const { return PathString::value(); }
111 const char* key() const { return _key; }
112 bool internal() const { return _internal; }
113 SystemProperty* next() const { return _next; }
461 static void PropertyList_add(SystemProperty** plist, const char* k, const char* v, bool writeable, bool internal);
462
463 static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v,
464 PropertyAppendable append, PropertyWriteable writeable,
465 PropertyInternal internal);
466 static const char* PropertyList_get_value(SystemProperty* plist, const char* key);
467 static const char* PropertyList_get_readable_value(SystemProperty* plist, const char* key);
468 static int PropertyList_count(SystemProperty* pl);
469 static int PropertyList_readable_count(SystemProperty* pl);
470
471 static bool is_internal_module_property(const char* option);
472 static bool is_incompatible_cds_internal_module_property(const char* property);
473
474 // Miscellaneous System property value getter and setters.
475 static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); }
476 static void set_java_home(const char *value) { _java_home->set_value(value); }
477 static void set_library_path(const char *value) { _java_library_path->set_value(value); }
478 static void set_ext_dirs(char *value);
479
480 // Set up the underlying pieces of the boot class path
481 static void add_patch_mod_prefix(const char *module_name, const char *path, bool allow_append, bool allow_cds);
482 static int finalize_patch_module();
483
484 static void set_boot_class_path(const char *value, bool has_jimage) {
485 // During start up, set by os::set_boot_path()
486 assert(get_boot_class_path() == nullptr, "Boot class path previously set");
487 _boot_class_path->set_value(value);
488 _has_jimage = has_jimage;
489 }
490 static void append_sysclasspath(const char *value) {
491 _boot_class_path->append_value(value);
492 _jdk_boot_class_path_append->append_value(value);
493 }
494
495 static GrowableArray<ModulePatchPath*>* get_patch_mod_prefix() { return _patch_mod_prefix; }
496 static char* get_boot_class_path() { return _boot_class_path->value(); }
497 static bool has_jimage() { return _has_jimage; }
498
499 static char* get_java_home() { return _java_home->value(); }
500 static char* get_dll_dir() { return _sun_boot_library_path->value(); }
501 static char* get_appclasspath() { return _java_class_path->value(); }
502 static void fix_appclasspath();
503
504 // Operation modi
505 static Mode mode() { return _mode; }
506 static void set_mode_flags(Mode mode);
507 static bool is_interpreter_only() { return mode() == _int; }
508 static bool is_compiler_only() { return mode() == _comp; }
509
510
511 // preview features
512 static void set_enable_preview() { _enable_preview = true; }
513 static bool enable_preview() { return _enable_preview; }
514 static bool is_valhalla_enabled() {
515 // Valhalla is a feature opted-in by --enable-preview
516 return enable_preview();
517 }
518
519 // jdwp
520 static bool has_jdwp_agent() { return _has_jdwp_agent; }
521
522 // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid.
523 static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen);
524
525 static bool atojulong(const char *s, julong* result);
526
527 static bool has_jfr_option() NOT_JFR_RETURN_(false);
528
529 DEBUG_ONLY(static bool verify_special_jvm_flags(bool check_globals);)
530 };
531
532 // Disable options not supported in this release, with a warning if they
533 // were explicitly requested on the command-line
534 #define UNSUPPORTED_OPTION(opt) \
535 do { \
536 if (opt) { \
537 if (FLAG_IS_CMDLINE(opt)) { \
|