61
62 #define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
63 #define DEFAULT_JAVA_LAUNCHER "generic"
64
65 char** Arguments::_jvm_flags_array = NULL;
66 int Arguments::_num_jvm_flags = 0;
67 char** Arguments::_jvm_args_array = NULL;
68 int Arguments::_num_jvm_args = 0;
69 char* Arguments::_java_command = NULL;
70 SystemProperty* Arguments::_system_properties = NULL;
71 const char* Arguments::_gc_log_filename = NULL;
72 bool Arguments::_has_profile = false;
73 bool Arguments::_has_alloc_profile = false;
74 uintx Arguments::_min_heap_size = 0;
75 Arguments::Mode Arguments::_mode = _mixed;
76 bool Arguments::_java_compiler = false;
77 bool Arguments::_xdebug_mode = false;
78 const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
79 const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
80 int Arguments::_sun_java_launcher_pid = -1;
81
82 // These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
83 bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
84 bool Arguments::_UseOnStackReplacement = UseOnStackReplacement;
85 bool Arguments::_BackgroundCompilation = BackgroundCompilation;
86 bool Arguments::_ClipInlining = ClipInlining;
87
88 char* Arguments::SharedArchivePath = NULL;
89
90 AgentLibraryList Arguments::_libraryList;
91 AgentLibraryList Arguments::_agentList;
92
93 abort_hook_t Arguments::_abort_hook = NULL;
94 exit_hook_t Arguments::_exit_hook = NULL;
95 vfprintf_hook_t Arguments::_vfprintf_hook = NULL;
96
97
98 SystemProperty *Arguments::_java_ext_dirs = NULL;
99 SystemProperty *Arguments::_java_endorsed_dirs = NULL;
100 SystemProperty *Arguments::_sun_boot_library_path = NULL;
1639 // if (FLAG_IS_DEFAULT(EliminateZeroing)) {
1640 // FLAG_SET_DEFAULT(EliminateZeroing, true);
1641 // }
1642 }
1643 }
1644
1645 //===========================================================================================================
1646 // Parsing of java.compiler property
1647
1648 void Arguments::process_java_compiler_argument(char* arg) {
1649 // For backwards compatibility, Djava.compiler=NONE or ""
1650 // causes us to switch to -Xint mode UNLESS -Xdebug
1651 // is also specified.
1652 if (strlen(arg) == 0 || strcasecmp(arg, "NONE") == 0) {
1653 set_java_compiler(true); // "-Djava.compiler[=...]" most recently seen.
1654 }
1655 }
1656
1657 void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
1658 _sun_java_launcher = strdup(launcher);
1659 }
1660
1661 bool Arguments::created_by_java_launcher() {
1662 assert(_sun_java_launcher != NULL, "property must have value");
1663 return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
1664 }
1665
1666 //===========================================================================================================
1667 // Parsing of main arguments
1668
1669 bool Arguments::verify_interval(uintx val, uintx min,
1670 uintx max, const char* name) {
1671 // Returns true iff value is in the inclusive interval [min..max]
1672 // false, otherwise.
1673 if (val >= min && val <= max) {
1674 return true;
1675 }
1676 jio_fprintf(defaultStream::error_stream(),
1677 "%s of " UINTX_FORMAT " is invalid; must be between " UINTX_FORMAT
1678 " and " UINTX_FORMAT "\n",
1679 name, val, min, max);
1680 return false;
1681 }
1682
1683 bool Arguments::verify_min_value(intx val, intx min, const char* name) {
|
61
62 #define DEFAULT_VENDOR_URL_BUG "http://java.sun.com/webapps/bugreport/crash.jsp"
63 #define DEFAULT_JAVA_LAUNCHER "generic"
64
65 char** Arguments::_jvm_flags_array = NULL;
66 int Arguments::_num_jvm_flags = 0;
67 char** Arguments::_jvm_args_array = NULL;
68 int Arguments::_num_jvm_args = 0;
69 char* Arguments::_java_command = NULL;
70 SystemProperty* Arguments::_system_properties = NULL;
71 const char* Arguments::_gc_log_filename = NULL;
72 bool Arguments::_has_profile = false;
73 bool Arguments::_has_alloc_profile = false;
74 uintx Arguments::_min_heap_size = 0;
75 Arguments::Mode Arguments::_mode = _mixed;
76 bool Arguments::_java_compiler = false;
77 bool Arguments::_xdebug_mode = false;
78 const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
79 const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
80 int Arguments::_sun_java_launcher_pid = -1;
81 bool Arguments::_created_by_gamma_launcher = false;
82
83 // These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
84 bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
85 bool Arguments::_UseOnStackReplacement = UseOnStackReplacement;
86 bool Arguments::_BackgroundCompilation = BackgroundCompilation;
87 bool Arguments::_ClipInlining = ClipInlining;
88
89 char* Arguments::SharedArchivePath = NULL;
90
91 AgentLibraryList Arguments::_libraryList;
92 AgentLibraryList Arguments::_agentList;
93
94 abort_hook_t Arguments::_abort_hook = NULL;
95 exit_hook_t Arguments::_exit_hook = NULL;
96 vfprintf_hook_t Arguments::_vfprintf_hook = NULL;
97
98
99 SystemProperty *Arguments::_java_ext_dirs = NULL;
100 SystemProperty *Arguments::_java_endorsed_dirs = NULL;
101 SystemProperty *Arguments::_sun_boot_library_path = NULL;
1640 // if (FLAG_IS_DEFAULT(EliminateZeroing)) {
1641 // FLAG_SET_DEFAULT(EliminateZeroing, true);
1642 // }
1643 }
1644 }
1645
1646 //===========================================================================================================
1647 // Parsing of java.compiler property
1648
1649 void Arguments::process_java_compiler_argument(char* arg) {
1650 // For backwards compatibility, Djava.compiler=NONE or ""
1651 // causes us to switch to -Xint mode UNLESS -Xdebug
1652 // is also specified.
1653 if (strlen(arg) == 0 || strcasecmp(arg, "NONE") == 0) {
1654 set_java_compiler(true); // "-Djava.compiler[=...]" most recently seen.
1655 }
1656 }
1657
1658 void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
1659 _sun_java_launcher = strdup(launcher);
1660 if (strcmp("gamma", _sun_java_launcher) == 0) {
1661 _created_by_gamma_launcher = true;
1662 FLAG_SET_DEFAULT(PauseAtExit, true);
1663 }
1664 }
1665
1666 bool Arguments::created_by_java_launcher() {
1667 assert(_sun_java_launcher != NULL, "property must have value");
1668 return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
1669 }
1670
1671 bool Arguments::created_by_gamma_launcher() {
1672 return _created_by_gamma_launcher;
1673 }
1674
1675 //===========================================================================================================
1676 // Parsing of main arguments
1677
1678 bool Arguments::verify_interval(uintx val, uintx min,
1679 uintx max, const char* name) {
1680 // Returns true iff value is in the inclusive interval [min..max]
1681 // false, otherwise.
1682 if (val >= min && val <= max) {
1683 return true;
1684 }
1685 jio_fprintf(defaultStream::error_stream(),
1686 "%s of " UINTX_FORMAT " is invalid; must be between " UINTX_FORMAT
1687 " and " UINTX_FORMAT "\n",
1688 name, val, min, max);
1689 return false;
1690 }
1691
1692 bool Arguments::verify_min_value(intx val, intx min, const char* name) {
|