src/share/vm/runtime/arguments.hpp

Thu, 30 Sep 2010 12:05:08 -0400

author
zgu
date
Thu, 30 Sep 2010 12:05:08 -0400
changeset 2219
dfb38ea7da17
parent 2138
d5d065957597
child 2246
9de67bf4244d
permissions
-rw-r--r--

6988363: Rebrand vm vendor property settings (jdk7 only)
Summary: Vendor properties should be initialized after JDK version is determined.
Reviewed-by: kamg, ohair, dcubed, dholmes

duke@435 1 /*
iveresov@2138 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 // Arguments parses the command line and recognizes options
duke@435 26
duke@435 27 // Invocation API hook typedefs (these should really be defined in jni.hpp)
duke@435 28 extern "C" {
duke@435 29 typedef void (JNICALL *abort_hook_t)(void);
duke@435 30 typedef void (JNICALL *exit_hook_t)(jint code);
duke@435 31 typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args);
duke@435 32 }
duke@435 33
duke@435 34 // Forward declarations
duke@435 35
duke@435 36 class SysClassPath;
duke@435 37
duke@435 38 // Element describing System and User (-Dkey=value flags) defined property.
duke@435 39
duke@435 40 class SystemProperty: public CHeapObj {
duke@435 41 private:
duke@435 42 char* _key;
duke@435 43 char* _value;
duke@435 44 SystemProperty* _next;
duke@435 45 bool _writeable;
duke@435 46 bool writeable() { return _writeable; }
duke@435 47
duke@435 48 public:
duke@435 49 // Accessors
duke@435 50 const char* key() const { return _key; }
duke@435 51 char* value() const { return _value; }
duke@435 52 SystemProperty* next() const { return _next; }
duke@435 53 void set_next(SystemProperty* next) { _next = next; }
duke@435 54 bool set_value(char *value) {
duke@435 55 if (writeable()) {
duke@435 56 if (_value != NULL) {
duke@435 57 FreeHeap(_value);
duke@435 58 }
duke@435 59 _value = AllocateHeap(strlen(value)+1);
duke@435 60 if (_value != NULL) {
duke@435 61 strcpy(_value, value);
duke@435 62 }
duke@435 63 return true;
duke@435 64 }
duke@435 65 return false;
duke@435 66 }
duke@435 67
duke@435 68 void append_value(const char *value) {
duke@435 69 char *sp;
duke@435 70 size_t len = 0;
duke@435 71 if (value != NULL) {
duke@435 72 len = strlen(value);
duke@435 73 if (_value != NULL) {
duke@435 74 len += strlen(_value);
duke@435 75 }
duke@435 76 sp = AllocateHeap(len+2);
duke@435 77 if (sp != NULL) {
duke@435 78 if (_value != NULL) {
duke@435 79 strcpy(sp, _value);
duke@435 80 strcat(sp, os::path_separator());
duke@435 81 strcat(sp, value);
duke@435 82 FreeHeap(_value);
duke@435 83 } else {
duke@435 84 strcpy(sp, value);
duke@435 85 }
duke@435 86 _value = sp;
duke@435 87 }
duke@435 88 }
duke@435 89 }
duke@435 90
duke@435 91 // Constructor
duke@435 92 SystemProperty(const char* key, const char* value, bool writeable) {
duke@435 93 if (key == NULL) {
duke@435 94 _key = NULL;
duke@435 95 } else {
duke@435 96 _key = AllocateHeap(strlen(key)+1);
duke@435 97 strcpy(_key, key);
duke@435 98 }
duke@435 99 if (value == NULL) {
duke@435 100 _value = NULL;
duke@435 101 } else {
duke@435 102 _value = AllocateHeap(strlen(value)+1);
duke@435 103 strcpy(_value, value);
duke@435 104 }
duke@435 105 _next = NULL;
duke@435 106 _writeable = writeable;
duke@435 107 }
duke@435 108 };
duke@435 109
duke@435 110
duke@435 111 // For use by -agentlib, -agentpath and -Xrun
duke@435 112 class AgentLibrary : public CHeapObj {
duke@435 113 friend class AgentLibraryList;
duke@435 114 private:
duke@435 115 char* _name;
duke@435 116 char* _options;
duke@435 117 void* _os_lib;
duke@435 118 bool _is_absolute_path;
duke@435 119 AgentLibrary* _next;
duke@435 120
duke@435 121 public:
duke@435 122 // Accessors
duke@435 123 const char* name() const { return _name; }
duke@435 124 char* options() const { return _options; }
duke@435 125 bool is_absolute_path() const { return _is_absolute_path; }
duke@435 126 void* os_lib() const { return _os_lib; }
duke@435 127 void set_os_lib(void* os_lib) { _os_lib = os_lib; }
duke@435 128 AgentLibrary* next() const { return _next; }
duke@435 129
duke@435 130 // Constructor
duke@435 131 AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) {
duke@435 132 _name = AllocateHeap(strlen(name)+1);
duke@435 133 strcpy(_name, name);
duke@435 134 if (options == NULL) {
duke@435 135 _options = NULL;
duke@435 136 } else {
duke@435 137 _options = AllocateHeap(strlen(options)+1);
duke@435 138 strcpy(_options, options);
duke@435 139 }
duke@435 140 _is_absolute_path = is_absolute_path;
duke@435 141 _os_lib = os_lib;
duke@435 142 _next = NULL;
duke@435 143 }
duke@435 144 };
duke@435 145
duke@435 146 // maintain an order of entry list of AgentLibrary
duke@435 147 class AgentLibraryList VALUE_OBJ_CLASS_SPEC {
duke@435 148 private:
duke@435 149 AgentLibrary* _first;
duke@435 150 AgentLibrary* _last;
duke@435 151 public:
duke@435 152 bool is_empty() const { return _first == NULL; }
duke@435 153 AgentLibrary* first() const { return _first; }
duke@435 154
duke@435 155 // add to the end of the list
duke@435 156 void add(AgentLibrary* lib) {
duke@435 157 if (is_empty()) {
duke@435 158 _first = _last = lib;
duke@435 159 } else {
duke@435 160 _last->_next = lib;
duke@435 161 _last = lib;
duke@435 162 }
duke@435 163 lib->_next = NULL;
duke@435 164 }
duke@435 165
duke@435 166 // search for and remove a library known to be in the list
duke@435 167 void remove(AgentLibrary* lib) {
duke@435 168 AgentLibrary* curr;
duke@435 169 AgentLibrary* prev = NULL;
duke@435 170 for (curr = first(); curr != NULL; prev = curr, curr = curr->next()) {
duke@435 171 if (curr == lib) {
duke@435 172 break;
duke@435 173 }
duke@435 174 }
duke@435 175 assert(curr != NULL, "always should be found");
duke@435 176
duke@435 177 if (curr != NULL) {
duke@435 178 // it was found, by-pass this library
duke@435 179 if (prev == NULL) {
duke@435 180 _first = curr->_next;
duke@435 181 } else {
duke@435 182 prev->_next = curr->_next;
duke@435 183 }
duke@435 184 if (curr == _last) {
duke@435 185 _last = prev;
duke@435 186 }
duke@435 187 curr->_next = NULL;
duke@435 188 }
duke@435 189 }
duke@435 190
duke@435 191 AgentLibraryList() {
duke@435 192 _first = NULL;
duke@435 193 _last = NULL;
duke@435 194 }
duke@435 195 };
duke@435 196
duke@435 197
duke@435 198 class Arguments : AllStatic {
duke@435 199 friend class VMStructs;
duke@435 200 friend class JvmtiExport;
duke@435 201 public:
duke@435 202 // Operation modi
duke@435 203 enum Mode {
duke@435 204 _int, // corresponds to -Xint
duke@435 205 _mixed, // corresponds to -Xmixed
duke@435 206 _comp // corresponds to -Xcomp
duke@435 207 };
duke@435 208
duke@435 209 enum ArgsRange {
duke@435 210 arg_unreadable = -3,
duke@435 211 arg_too_small = -2,
duke@435 212 arg_too_big = -1,
duke@435 213 arg_in_range = 0
duke@435 214 };
duke@435 215
duke@435 216 private:
duke@435 217
duke@435 218 // an array containing all flags specified in the .hotspotrc file
duke@435 219 static char** _jvm_flags_array;
duke@435 220 static int _num_jvm_flags;
duke@435 221 // an array containing all jvm arguments specified in the command line
duke@435 222 static char** _jvm_args_array;
duke@435 223 static int _num_jvm_args;
duke@435 224 // string containing all java command (class/jarfile name and app args)
duke@435 225 static char* _java_command;
duke@435 226
duke@435 227 // Property list
duke@435 228 static SystemProperty* _system_properties;
duke@435 229
duke@435 230 // Quick accessor to System properties in the list:
duke@435 231 static SystemProperty *_java_ext_dirs;
duke@435 232 static SystemProperty *_java_endorsed_dirs;
duke@435 233 static SystemProperty *_sun_boot_library_path;
duke@435 234 static SystemProperty *_java_library_path;
duke@435 235 static SystemProperty *_java_home;
duke@435 236 static SystemProperty *_java_class_path;
duke@435 237 static SystemProperty *_sun_boot_class_path;
duke@435 238
duke@435 239 // Meta-index for knowing what packages are in the boot class path
duke@435 240 static char* _meta_index_path;
duke@435 241 static char* _meta_index_dir;
duke@435 242
duke@435 243 // java.vendor.url.bug, bug reporting URL for fatal errors.
duke@435 244 static const char* _java_vendor_url_bug;
duke@435 245
duke@435 246 // sun.java.launcher, private property to provide information about
duke@435 247 // java/gamma launcher
duke@435 248 static const char* _sun_java_launcher;
duke@435 249
duke@435 250 // sun.java.launcher.pid, private property
duke@435 251 static int _sun_java_launcher_pid;
duke@435 252
duke@435 253 // Option flags
duke@435 254 static bool _has_profile;
duke@435 255 static bool _has_alloc_profile;
duke@435 256 static const char* _gc_log_filename;
duke@435 257 static uintx _min_heap_size;
duke@435 258
duke@435 259 // -Xrun arguments
duke@435 260 static AgentLibraryList _libraryList;
duke@435 261 static void add_init_library(const char* name, char* options)
duke@435 262 { _libraryList.add(new AgentLibrary(name, options, false, NULL)); }
duke@435 263
duke@435 264 // -agentlib and -agentpath arguments
duke@435 265 static AgentLibraryList _agentList;
duke@435 266 static void add_init_agent(const char* name, char* options, bool absolute_path)
duke@435 267 { _agentList.add(new AgentLibrary(name, options, absolute_path, NULL)); }
duke@435 268
duke@435 269 // Late-binding agents not started via arguments
duke@435 270 static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib)
duke@435 271 { _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib)); }
duke@435 272
duke@435 273 // Operation modi
duke@435 274 static Mode _mode;
duke@435 275 static void set_mode_flags(Mode mode);
duke@435 276 static bool _java_compiler;
duke@435 277 static void set_java_compiler(bool arg) { _java_compiler = arg; }
duke@435 278 static bool java_compiler() { return _java_compiler; }
duke@435 279
duke@435 280 // -Xdebug flag
duke@435 281 static bool _xdebug_mode;
duke@435 282 static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; }
duke@435 283 static bool xdebug_mode() { return _xdebug_mode; }
duke@435 284
duke@435 285 // Used to save default settings
duke@435 286 static bool _AlwaysCompileLoopMethods;
duke@435 287 static bool _UseOnStackReplacement;
duke@435 288 static bool _BackgroundCompilation;
duke@435 289 static bool _ClipInlining;
duke@435 290 static bool _CIDynamicCompilePriority;
duke@435 291
iveresov@2138 292 // Tiered
iveresov@2138 293 static void set_tiered_flags();
duke@435 294 // CMS/ParNew garbage collectors
duke@435 295 static void set_parnew_gc_flags();
duke@435 296 static void set_cms_and_parnew_gc_flags();
ysr@777 297 // UseParallel[Old]GC
duke@435 298 static void set_parallel_gc_flags();
ysr@777 299 // Garbage-First (UseG1GC)
ysr@777 300 static void set_g1_gc_flags();
duke@435 301 // GC ergonomics
duke@435 302 static void set_ergonomics_flags();
phh@1499 303 // Setup heap size
phh@1499 304 static void set_heap_size();
duke@435 305 // Based on automatic selection criteria, should the
duke@435 306 // low pause collector be used.
duke@435 307 static bool should_auto_select_low_pause_collector();
duke@435 308
duke@435 309 // Bytecode rewriting
duke@435 310 static void set_bytecode_flags();
duke@435 311
duke@435 312 // Invocation API hooks
duke@435 313 static abort_hook_t _abort_hook;
duke@435 314 static exit_hook_t _exit_hook;
duke@435 315 static vfprintf_hook_t _vfprintf_hook;
duke@435 316
duke@435 317 // System properties
duke@435 318 static bool add_property(const char* prop);
duke@435 319
duke@435 320 // Aggressive optimization flags.
duke@435 321 static void set_aggressive_opts_flags();
duke@435 322
duke@435 323 // Argument parsing
duke@435 324 static void do_pd_flag_adjustments();
duke@435 325 static bool parse_argument(const char* arg, FlagValueOrigin origin);
duke@435 326 static bool process_argument(const char* arg, jboolean ignore_unrecognized, FlagValueOrigin origin);
duke@435 327 static void process_java_launcher_argument(const char*, void*);
duke@435 328 static void process_java_compiler_argument(char* arg);
duke@435 329 static jint parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p);
duke@435 330 static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
duke@435 331 static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
duke@435 332 static jint parse_vm_init_args(const JavaVMInitArgs* args);
duke@435 333 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, FlagValueOrigin origin);
duke@435 334 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required);
duke@435 335 static bool is_bad_option(const JavaVMOption* option, jboolean ignore,
duke@435 336 const char* option_type);
duke@435 337 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
duke@435 338 return is_bad_option(option, ignore, NULL);
duke@435 339 }
johnc@1679 340 static bool verify_interval(uintx val, uintx min,
johnc@1679 341 uintx max, const char* name);
ptisnovs@2099 342 static bool verify_min_value(intx val, intx min, const char* name);
duke@435 343 static bool verify_percentage(uintx value, const char* name);
duke@435 344 static void describe_range_error(ArgsRange errcode);
swamyv@924 345 static ArgsRange check_memory_size(julong size, julong min_size);
swamyv@924 346 static ArgsRange parse_memory_size(const char* s, julong* long_arg,
swamyv@924 347 julong min_size);
jmasa@1719 348 // Parse a string for a unsigned integer. Returns true if value
jmasa@1719 349 // is an unsigned integer greater than or equal to the minimum
jmasa@1719 350 // parameter passed and returns the value in uintx_arg. Returns
jmasa@1719 351 // false otherwise, with uintx_arg undefined.
jmasa@1719 352 static bool parse_uintx(const char* value, uintx* uintx_arg,
jmasa@1719 353 uintx min_size);
duke@435 354
duke@435 355 // methods to build strings from individual args
duke@435 356 static void build_jvm_args(const char* arg);
duke@435 357 static void build_jvm_flags(const char* arg);
duke@435 358 static void add_string(char*** bldarray, int* count, const char* arg);
duke@435 359 static const char* build_resource_string(char** args, int count);
duke@435 360
duke@435 361 static bool methodExists(
duke@435 362 char* className, char* methodName,
duke@435 363 int classesNum, char** classes, bool* allMethods,
duke@435 364 int methodsNum, char** methods, bool* allClasses
duke@435 365 );
duke@435 366
duke@435 367 static void parseOnlyLine(
duke@435 368 const char* line,
duke@435 369 short* classesNum, short* classesMax, char*** classes, bool** allMethods,
duke@435 370 short* methodsNum, short* methodsMax, char*** methods, bool** allClasses
duke@435 371 );
duke@435 372
kamg@677 373 // Returns true if the string s is in the list of flags that have recently
kamg@677 374 // been made obsolete. If we detect one of these flags on the command
kamg@677 375 // line, instead of failing we print a warning message and ignore the
kamg@677 376 // flag. This gives the user a release or so to stop using the flag.
kamg@677 377 static bool is_newly_obsolete(const char* s, JDK_Version* buffer);
duke@435 378
duke@435 379 static short CompileOnlyClassesNum;
duke@435 380 static short CompileOnlyClassesMax;
duke@435 381 static char** CompileOnlyClasses;
duke@435 382 static bool* CompileOnlyAllMethods;
duke@435 383
duke@435 384 static short CompileOnlyMethodsNum;
duke@435 385 static short CompileOnlyMethodsMax;
duke@435 386 static char** CompileOnlyMethods;
duke@435 387 static bool* CompileOnlyAllClasses;
duke@435 388
duke@435 389 static short InterpretOnlyClassesNum;
duke@435 390 static short InterpretOnlyClassesMax;
duke@435 391 static char** InterpretOnlyClasses;
duke@435 392 static bool* InterpretOnlyAllMethods;
duke@435 393
duke@435 394 static bool CheckCompileOnly;
duke@435 395
duke@435 396 static char* SharedArchivePath;
duke@435 397
duke@435 398 public:
duke@435 399 // Parses the arguments
duke@435 400 static jint parse(const JavaVMInitArgs* args);
jmasa@445 401 // Check for consistency in the selection of the garbage collector.
jmasa@445 402 static bool check_gc_consistency();
duke@435 403 // Check consistecy or otherwise of VM argument settings
duke@435 404 static bool check_vm_args_consistency();
ptisnovs@2099 405 // Check stack pages settings
ptisnovs@2099 406 static bool check_stack_pages();
duke@435 407 // Used by os_solaris
duke@435 408 static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized);
duke@435 409
duke@435 410 // return a char* array containing all options
duke@435 411 static char** jvm_flags_array() { return _jvm_flags_array; }
duke@435 412 static char** jvm_args_array() { return _jvm_args_array; }
duke@435 413 static int num_jvm_flags() { return _num_jvm_flags; }
duke@435 414 static int num_jvm_args() { return _num_jvm_args; }
duke@435 415 // return the arguments passed to the Java application
duke@435 416 static const char* java_command() { return _java_command; }
duke@435 417
duke@435 418 // print jvm_flags, jvm_args and java_command
duke@435 419 static void print_on(outputStream* st);
duke@435 420
duke@435 421 // convenient methods to obtain / print jvm_flags and jvm_args
duke@435 422 static const char* jvm_flags() { return build_resource_string(_jvm_flags_array, _num_jvm_flags); }
duke@435 423 static const char* jvm_args() { return build_resource_string(_jvm_args_array, _num_jvm_args); }
duke@435 424 static void print_jvm_flags_on(outputStream* st);
duke@435 425 static void print_jvm_args_on(outputStream* st);
duke@435 426
duke@435 427 // -Dkey=value flags
duke@435 428 static SystemProperty* system_properties() { return _system_properties; }
duke@435 429 static const char* get_property(const char* key);
duke@435 430
duke@435 431 // -Djava.vendor.url.bug
duke@435 432 static const char* java_vendor_url_bug() { return _java_vendor_url_bug; }
duke@435 433
duke@435 434 // -Dsun.java.launcher
duke@435 435 static const char* sun_java_launcher() { return _sun_java_launcher; }
duke@435 436 // Was VM created by a Java launcher?
duke@435 437 static bool created_by_java_launcher();
duke@435 438 // -Dsun.java.launcher.pid
duke@435 439 static int sun_java_launcher_pid() { return _sun_java_launcher_pid; }
duke@435 440
duke@435 441 // -Xloggc:<file>, if not specified will be NULL
duke@435 442 static const char* gc_log_filename() { return _gc_log_filename; }
duke@435 443
duke@435 444 // -Xprof/-Xaprof
duke@435 445 static bool has_profile() { return _has_profile; }
duke@435 446 static bool has_alloc_profile() { return _has_alloc_profile; }
duke@435 447
phh@1499 448 // -Xms, -Xmx
duke@435 449 static uintx min_heap_size() { return _min_heap_size; }
duke@435 450 static void set_min_heap_size(uintx v) { _min_heap_size = v; }
duke@435 451
duke@435 452 // -Xrun
duke@435 453 static AgentLibrary* libraries() { return _libraryList.first(); }
duke@435 454 static bool init_libraries_at_startup() { return !_libraryList.is_empty(); }
duke@435 455 static void convert_library_to_agent(AgentLibrary* lib)
duke@435 456 { _libraryList.remove(lib);
duke@435 457 _agentList.add(lib); }
duke@435 458
duke@435 459 // -agentlib -agentpath
duke@435 460 static AgentLibrary* agents() { return _agentList.first(); }
duke@435 461 static bool init_agents_at_startup() { return !_agentList.is_empty(); }
duke@435 462
duke@435 463 // abort, exit, vfprintf hooks
duke@435 464 static abort_hook_t abort_hook() { return _abort_hook; }
duke@435 465 static exit_hook_t exit_hook() { return _exit_hook; }
duke@435 466 static vfprintf_hook_t vfprintf_hook() { return _vfprintf_hook; }
duke@435 467
duke@435 468 static bool GetCheckCompileOnly () { return CheckCompileOnly; }
duke@435 469
duke@435 470 static const char* GetSharedArchivePath() { return SharedArchivePath; }
duke@435 471
duke@435 472 static bool CompileMethod(char* className, char* methodName) {
duke@435 473 return
duke@435 474 methodExists(
duke@435 475 className, methodName,
duke@435 476 CompileOnlyClassesNum, CompileOnlyClasses, CompileOnlyAllMethods,
duke@435 477 CompileOnlyMethodsNum, CompileOnlyMethods, CompileOnlyAllClasses
duke@435 478 );
duke@435 479 }
duke@435 480
duke@435 481 // Java launcher properties
duke@435 482 static void process_sun_java_launcher_properties(JavaVMInitArgs* args);
duke@435 483
duke@435 484 // System properties
duke@435 485 static void init_system_properties();
duke@435 486
zgu@2219 487 // Update/Initialize System properties after JDK version number is known
zgu@2219 488 static void init_version_specific_system_properties();
zgu@2219 489
phh@1126 490 // Property List manipulation
duke@435 491 static void PropertyList_add(SystemProperty** plist, SystemProperty *element);
duke@435 492 static void PropertyList_add(SystemProperty** plist, const char* k, char* v);
phh@1126 493 static void PropertyList_unique_add(SystemProperty** plist, const char* k, char* v) {
phh@1126 494 PropertyList_unique_add(plist, k, v, false);
phh@1126 495 }
phh@1126 496 static void PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append);
duke@435 497 static const char* PropertyList_get_value(SystemProperty* plist, const char* key);
duke@435 498 static int PropertyList_count(SystemProperty* pl);
duke@435 499 static const char* PropertyList_get_key_at(SystemProperty* pl,int index);
duke@435 500 static char* PropertyList_get_value_at(SystemProperty* pl,int index);
duke@435 501
duke@435 502 // Miscellaneous System property value getter and setters.
duke@435 503 static void set_dll_dir(char *value) { _sun_boot_library_path->set_value(value); }
duke@435 504 static void set_java_home(char *value) { _java_home->set_value(value); }
duke@435 505 static void set_library_path(char *value) { _java_library_path->set_value(value); }
duke@435 506 static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); }
duke@435 507 static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); }
duke@435 508 static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); }
duke@435 509 static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); }
duke@435 510 static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) {
duke@435 511 _meta_index_path = meta_index_path;
duke@435 512 _meta_index_dir = meta_index_dir;
duke@435 513 }
duke@435 514
duke@435 515 static char *get_java_home() { return _java_home->value(); }
duke@435 516 static char *get_dll_dir() { return _sun_boot_library_path->value(); }
duke@435 517 static char *get_endorsed_dir() { return _java_endorsed_dirs->value(); }
duke@435 518 static char *get_sysclasspath() { return _sun_boot_class_path->value(); }
duke@435 519 static char* get_meta_index_path() { return _meta_index_path; }
duke@435 520 static char* get_meta_index_dir() { return _meta_index_dir; }
duke@435 521
duke@435 522 // Operation modi
duke@435 523 static Mode mode() { return _mode; }
duke@435 524
duke@435 525 // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid.
duke@435 526 static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen);
duke@435 527
duke@435 528 #ifdef KERNEL
duke@435 529 // For java kernel vm, return property string for kernel properties.
duke@435 530 static char *get_kernel_properties();
duke@435 531 #endif // KERNEL
duke@435 532 };

mercurial