349 // Set up runtime image flags
350 static void set_runtime_image_flags();
351 // Based on automatic selection criteria, should the
352 // low pause collector be used.
353 static bool should_auto_select_low_pause_collector();
354
355 // Bytecode rewriting
356 static void set_bytecode_flags();
357
358 // Invocation API hooks
359 static abort_hook_t _abort_hook;
360 static exit_hook_t _exit_hook;
361 static vfprintf_hook_t _vfprintf_hook;
362
363 // System properties
364 static bool add_property(const char* prop);
365
366 // Aggressive optimization flags.
367 static void set_aggressive_opts_flags();
368
369 // Argument parsing
370 static void do_pd_flag_adjustments();
371 static bool parse_argument(const char* arg, Flag::Flags origin);
372 static bool process_argument(const char* arg, jboolean ignore_unrecognized, Flag::Flags origin);
373 static void process_java_launcher_argument(const char*, void*);
374 static void process_java_compiler_argument(char* arg);
375 static jint parse_options_environment_variable(const char* name, ScopedVMInitArgs* vm_args);
376 static jint parse_java_tool_options_environment_variable(ScopedVMInitArgs* vm_args);
377 static jint parse_java_options_environment_variable(ScopedVMInitArgs* vm_args);
378 static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args,
379 const JavaVMInitArgs *java_options_args,
380 const JavaVMInitArgs *cmd_line_args);
381 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin);
382 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required);
383 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type);
384
385 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
386 return is_bad_option(option, ignore, NULL);
387 }
388
398 uintx min_size);
399
400 // methods to build strings from individual args
401 static void build_jvm_args(const char* arg);
402 static void build_jvm_flags(const char* arg);
403 static void add_string(char*** bldarray, int* count, const char* arg);
404 static const char* build_resource_string(char** args, int count);
405
406 static bool methodExists(
407 char* className, char* methodName,
408 int classesNum, char** classes, bool* allMethods,
409 int methodsNum, char** methods, bool* allClasses
410 );
411
412 static void parseOnlyLine(
413 const char* line,
414 short* classesNum, short* classesMax, char*** classes, bool** allMethods,
415 short* methodsNum, short* methodsMax, char*** methods, bool** allClasses
416 );
417
418 // Returns true if the string s is in the list of flags that have recently
419 // been made obsolete. If we detect one of these flags on the command
420 // line, instead of failing we print a warning message and ignore the
421 // flag. This gives the user a release or so to stop using the flag.
422 static bool is_newly_obsolete(const char* s, JDK_Version* buffer);
423
424 static short CompileOnlyClassesNum;
425 static short CompileOnlyClassesMax;
426 static char** CompileOnlyClasses;
427 static bool* CompileOnlyAllMethods;
428
429 static short CompileOnlyMethodsNum;
430 static short CompileOnlyMethodsMax;
431 static char** CompileOnlyMethods;
432 static bool* CompileOnlyAllClasses;
433
434 static short InterpretOnlyClassesNum;
435 static short InterpretOnlyClassesMax;
436 static char** InterpretOnlyClasses;
437 static bool* InterpretOnlyAllMethods;
438
439 static bool CheckCompileOnly;
440
441 static char* SharedArchivePath;
442
449 }
450 // Returns freq_log scaled with CompileThresholdScaling
451 static intx scaled_freq_log(intx freq_log, double scale);
452 static intx scaled_freq_log(intx freq_log) {
453 return scaled_freq_log(freq_log, CompileThresholdScaling);
454 }
455
456 // Parses the arguments, first phase
457 static jint parse(const JavaVMInitArgs* args);
458 // Apply ergonomics
459 static jint apply_ergo();
460 // Adjusts the arguments after the OS have adjusted the arguments
461 static jint adjust_after_os();
462
463 static void set_gc_specific_flags();
464 static inline bool gc_selected(); // whether a gc has been selected
465 static void select_gc_ergonomically();
466
467 // Check for consistency in the selection of the garbage collector.
468 static bool check_gc_consistency(); // Check user-selected gc
469 static void check_deprecated_gc_flags();
470 // Check consistency or otherwise of VM argument settings
471 static bool check_vm_args_consistency();
472 // Used by os_solaris
473 static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized);
474
475 static size_t conservative_max_heap_alignment() { return _conservative_max_heap_alignment; }
476 // Return the maximum size a heap with compressed oops can take
477 static size_t max_heap_for_compressed_oops();
478
479 // return a char* array containing all options
480 static char** jvm_flags_array() { return _jvm_flags_array; }
481 static char** jvm_args_array() { return _jvm_args_array; }
482 static int num_jvm_flags() { return _num_jvm_flags; }
483 static int num_jvm_args() { return _num_jvm_args; }
484 // return the arguments passed to the Java application
485 static const char* java_command() { return _java_command; }
486
487 // print jvm_flags, jvm_args and java_command
488 static void print_on(outputStream* st);
489 static void print_summary_on(outputStream* st);
|
349 // Set up runtime image flags
350 static void set_runtime_image_flags();
351 // Based on automatic selection criteria, should the
352 // low pause collector be used.
353 static bool should_auto_select_low_pause_collector();
354
355 // Bytecode rewriting
356 static void set_bytecode_flags();
357
358 // Invocation API hooks
359 static abort_hook_t _abort_hook;
360 static exit_hook_t _exit_hook;
361 static vfprintf_hook_t _vfprintf_hook;
362
363 // System properties
364 static bool add_property(const char* prop);
365
366 // Aggressive optimization flags.
367 static void set_aggressive_opts_flags();
368
369 static jint set_aggressive_heap_flags();
370
371 // Argument parsing
372 static void do_pd_flag_adjustments();
373 static bool parse_argument(const char* arg, Flag::Flags origin);
374 static bool process_argument(const char* arg, jboolean ignore_unrecognized, Flag::Flags origin);
375 static void process_java_launcher_argument(const char*, void*);
376 static void process_java_compiler_argument(char* arg);
377 static jint parse_options_environment_variable(const char* name, ScopedVMInitArgs* vm_args);
378 static jint parse_java_tool_options_environment_variable(ScopedVMInitArgs* vm_args);
379 static jint parse_java_options_environment_variable(ScopedVMInitArgs* vm_args);
380 static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args,
381 const JavaVMInitArgs *java_options_args,
382 const JavaVMInitArgs *cmd_line_args);
383 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin);
384 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required);
385 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type);
386
387 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
388 return is_bad_option(option, ignore, NULL);
389 }
390
400 uintx min_size);
401
402 // methods to build strings from individual args
403 static void build_jvm_args(const char* arg);
404 static void build_jvm_flags(const char* arg);
405 static void add_string(char*** bldarray, int* count, const char* arg);
406 static const char* build_resource_string(char** args, int count);
407
408 static bool methodExists(
409 char* className, char* methodName,
410 int classesNum, char** classes, bool* allMethods,
411 int methodsNum, char** methods, bool* allClasses
412 );
413
414 static void parseOnlyLine(
415 const char* line,
416 short* classesNum, short* classesMax, char*** classes, bool** allMethods,
417 short* methodsNum, short* methodsMax, char*** methods, bool** allClasses
418 );
419
420 // Returns true if the flag is obsolete and fits into the range specified
421 // for being ignored. In the case the 'version' buffer is filled in with
422 // the version number when the flag became obsolete.
423 static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
424
425 // Returns 1 if the flag is deprecated and jdk version is in the range specified.
426 // In this case the 'version' buffer is filled in with the version number when
427 // the flag became deprecated.
428 // Returns -1 if the flag is deprecated and has expired (should be ignored).
429 // Returns 0 if the flag is not deprecated.
430 static int is_deprecated_flag(const char* flag_name, JDK_Version* version);
431
432 // Return the real name for the flag passed on the command line (either an alias name or "flag_name").
433 static const char* real_flag_name(const char *flag_name);
434
435 // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
436 // Return NULL if the arg has expired.
437 static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
438
439 static short CompileOnlyClassesNum;
440 static short CompileOnlyClassesMax;
441 static char** CompileOnlyClasses;
442 static bool* CompileOnlyAllMethods;
443
444 static short CompileOnlyMethodsNum;
445 static short CompileOnlyMethodsMax;
446 static char** CompileOnlyMethods;
447 static bool* CompileOnlyAllClasses;
448
449 static short InterpretOnlyClassesNum;
450 static short InterpretOnlyClassesMax;
451 static char** InterpretOnlyClasses;
452 static bool* InterpretOnlyAllMethods;
453
454 static bool CheckCompileOnly;
455
456 static char* SharedArchivePath;
457
464 }
465 // Returns freq_log scaled with CompileThresholdScaling
466 static intx scaled_freq_log(intx freq_log, double scale);
467 static intx scaled_freq_log(intx freq_log) {
468 return scaled_freq_log(freq_log, CompileThresholdScaling);
469 }
470
471 // Parses the arguments, first phase
472 static jint parse(const JavaVMInitArgs* args);
473 // Apply ergonomics
474 static jint apply_ergo();
475 // Adjusts the arguments after the OS have adjusted the arguments
476 static jint adjust_after_os();
477
478 static void set_gc_specific_flags();
479 static inline bool gc_selected(); // whether a gc has been selected
480 static void select_gc_ergonomically();
481
482 // Check for consistency in the selection of the garbage collector.
483 static bool check_gc_consistency(); // Check user-selected gc
484 // Check consistency or otherwise of VM argument settings
485 static bool check_vm_args_consistency();
486 // Used by os_solaris
487 static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized);
488
489 static size_t conservative_max_heap_alignment() { return _conservative_max_heap_alignment; }
490 // Return the maximum size a heap with compressed oops can take
491 static size_t max_heap_for_compressed_oops();
492
493 // return a char* array containing all options
494 static char** jvm_flags_array() { return _jvm_flags_array; }
495 static char** jvm_args_array() { return _jvm_args_array; }
496 static int num_jvm_flags() { return _num_jvm_flags; }
497 static int num_jvm_args() { return _num_jvm_args; }
498 // return the arguments passed to the Java application
499 static const char* java_command() { return _java_command; }
500
501 // print jvm_flags, jvm_args and java_command
502 static void print_on(outputStream* st);
503 static void print_summary_on(outputStream* st);
|