src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File tiered-path Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page




  85 
  86 AgentLibraryList Arguments::_libraryList;
  87 AgentLibraryList Arguments::_agentList;
  88 
  89 abort_hook_t     Arguments::_abort_hook         = NULL;
  90 exit_hook_t      Arguments::_exit_hook          = NULL;
  91 vfprintf_hook_t  Arguments::_vfprintf_hook      = NULL;
  92 
  93 
  94 SystemProperty *Arguments::_java_ext_dirs = NULL;
  95 SystemProperty *Arguments::_java_endorsed_dirs = NULL;
  96 SystemProperty *Arguments::_sun_boot_library_path = NULL;
  97 SystemProperty *Arguments::_java_library_path = NULL;
  98 SystemProperty *Arguments::_java_home = NULL;
  99 SystemProperty *Arguments::_java_class_path = NULL;
 100 SystemProperty *Arguments::_sun_boot_class_path = NULL;
 101 
 102 char* Arguments::_meta_index_path = NULL;
 103 char* Arguments::_meta_index_dir = NULL;
 104 
 105 static bool force_client_mode = false;
 106 
 107 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
 108 
 109 static bool match_option(const JavaVMOption *option, const char* name,
 110                          const char** tail) {
 111   int len = (int)strlen(name);
 112   if (strncmp(option->optionString, name, len) == 0) {
 113     *tail = option->optionString + len;
 114     return true;
 115   } else {
 116     return false;
 117   }
 118 }
 119 
 120 static void logOption(const char* opt) {
 121   if (PrintVMOptions) {
 122     jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt);
 123   }
 124 }
 125 
 126 // Process java launcher properties.


1328   if (UseAutoGCSelectPolicy &&
1329       !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1330       (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1331     if (PrintGCDetails) {
1332       // Cannot use gclog_or_tty yet.
1333       tty->print_cr("Automatic selection of the low pause collector"
1334        " based on pause goal of %d (ms)", MaxGCPauseMillis);
1335     }
1336     return true;
1337   }
1338   return false;
1339 }
1340 
1341 void Arguments::set_ergonomics_flags() {
1342   // Parallel GC is not compatible with sharing. If one specifies
1343   // that they want sharing explicitly, do not set ergonomics flags.
1344   if (DumpSharedSpaces || RequireSharedSpaces) {
1345     return;
1346   }
1347 
1348   if (os::is_server_class_machine() && !force_client_mode ) {
1349     // If no other collector is requested explicitly,
1350     // let the VM select the collector based on
1351     // machine class and automatic selection policy.
1352     if (!UseSerialGC &&
1353         !UseConcMarkSweepGC &&
1354         !UseG1GC &&
1355         !UseParNewGC &&
1356         !DumpSharedSpaces &&
1357         FLAG_IS_DEFAULT(UseParallelGC)) {
1358       if (should_auto_select_low_pause_collector()) {
1359         FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
1360       } else {
1361         FLAG_SET_ERGO(bool, UseParallelGC, true);
1362       }
1363       no_shared_spaces();
1364     }
1365   }
1366 
1367 #ifndef ZERO
1368 #ifdef _LP64


2923 // Disable options not supported in this release, with a warning if they
2924 // were explicitly requested on the command-line
2925 #define UNSUPPORTED_OPTION(opt, description)                    \
2926 do {                                                            \
2927   if (opt) {                                                    \
2928     if (FLAG_IS_CMDLINE(opt)) {                                 \
2929       warning(description " is disabled in this release.");     \
2930     }                                                           \
2931     FLAG_SET_DEFAULT(opt, false);                               \
2932   }                                                             \
2933 } while(0)
2934 
2935 // Parse entry point called from JNI_CreateJavaVM
2936 
2937 jint Arguments::parse(const JavaVMInitArgs* args) {
2938 
2939   // Sharing support
2940   // Construct the path to the archive
2941   char jvm_path[JVM_MAXPATHLEN];
2942   os::jvm_path(jvm_path, sizeof(jvm_path));
2943 #ifdef TIERED
2944   if (strstr(jvm_path, "client") != NULL) {
2945     force_client_mode = true;
2946   }
2947 #endif // TIERED
2948   char *end = strrchr(jvm_path, *os::file_separator());
2949   if (end != NULL) *end = '\0';
2950   char *shared_archive_path = NEW_C_HEAP_ARRAY(char, strlen(jvm_path) +
2951                                         strlen(os::file_separator()) + 20);
2952   if (shared_archive_path == NULL) return JNI_ENOMEM;
2953   strcpy(shared_archive_path, jvm_path);
2954   strcat(shared_archive_path, os::file_separator());
2955   strcat(shared_archive_path, "classes");
2956   DEBUG_ONLY(strcat(shared_archive_path, "_g");)
2957   strcat(shared_archive_path, ".jsa");
2958   SharedArchivePath = shared_archive_path;
2959 
2960   // Remaining part of option string
2961   const char* tail;
2962 
2963   // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
2964   bool settings_file_specified = false;
2965   const char* flags_file;
2966   int index;
2967   for (index = 0; index < args->nOptions; index++) {




  85 
  86 AgentLibraryList Arguments::_libraryList;
  87 AgentLibraryList Arguments::_agentList;
  88 
  89 abort_hook_t     Arguments::_abort_hook         = NULL;
  90 exit_hook_t      Arguments::_exit_hook          = NULL;
  91 vfprintf_hook_t  Arguments::_vfprintf_hook      = NULL;
  92 
  93 
  94 SystemProperty *Arguments::_java_ext_dirs = NULL;
  95 SystemProperty *Arguments::_java_endorsed_dirs = NULL;
  96 SystemProperty *Arguments::_sun_boot_library_path = NULL;
  97 SystemProperty *Arguments::_java_library_path = NULL;
  98 SystemProperty *Arguments::_java_home = NULL;
  99 SystemProperty *Arguments::_java_class_path = NULL;
 100 SystemProperty *Arguments::_sun_boot_class_path = NULL;
 101 
 102 char* Arguments::_meta_index_path = NULL;
 103 char* Arguments::_meta_index_dir = NULL;
 104 


 105 // Check if head of 'option' matches 'name', and sets 'tail' remaining part of option string
 106 
 107 static bool match_option(const JavaVMOption *option, const char* name,
 108                          const char** tail) {
 109   int len = (int)strlen(name);
 110   if (strncmp(option->optionString, name, len) == 0) {
 111     *tail = option->optionString + len;
 112     return true;
 113   } else {
 114     return false;
 115   }
 116 }
 117 
 118 static void logOption(const char* opt) {
 119   if (PrintVMOptions) {
 120     jio_fprintf(defaultStream::output_stream(), "VM option '%s'\n", opt);
 121   }
 122 }
 123 
 124 // Process java launcher properties.


1326   if (UseAutoGCSelectPolicy &&
1327       !FLAG_IS_DEFAULT(MaxGCPauseMillis) &&
1328       (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) {
1329     if (PrintGCDetails) {
1330       // Cannot use gclog_or_tty yet.
1331       tty->print_cr("Automatic selection of the low pause collector"
1332        " based on pause goal of %d (ms)", MaxGCPauseMillis);
1333     }
1334     return true;
1335   }
1336   return false;
1337 }
1338 
1339 void Arguments::set_ergonomics_flags() {
1340   // Parallel GC is not compatible with sharing. If one specifies
1341   // that they want sharing explicitly, do not set ergonomics flags.
1342   if (DumpSharedSpaces || RequireSharedSpaces) {
1343     return;
1344   }
1345 
1346   if (os::is_server_class_machine()) {
1347     // If no other collector is requested explicitly,
1348     // let the VM select the collector based on
1349     // machine class and automatic selection policy.
1350     if (!UseSerialGC &&
1351         !UseConcMarkSweepGC &&
1352         !UseG1GC &&
1353         !UseParNewGC &&
1354         !DumpSharedSpaces &&
1355         FLAG_IS_DEFAULT(UseParallelGC)) {
1356       if (should_auto_select_low_pause_collector()) {
1357         FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
1358       } else {
1359         FLAG_SET_ERGO(bool, UseParallelGC, true);
1360       }
1361       no_shared_spaces();
1362     }
1363   }
1364 
1365 #ifndef ZERO
1366 #ifdef _LP64


2921 // Disable options not supported in this release, with a warning if they
2922 // were explicitly requested on the command-line
2923 #define UNSUPPORTED_OPTION(opt, description)                    \
2924 do {                                                            \
2925   if (opt) {                                                    \
2926     if (FLAG_IS_CMDLINE(opt)) {                                 \
2927       warning(description " is disabled in this release.");     \
2928     }                                                           \
2929     FLAG_SET_DEFAULT(opt, false);                               \
2930   }                                                             \
2931 } while(0)
2932 
2933 // Parse entry point called from JNI_CreateJavaVM
2934 
2935 jint Arguments::parse(const JavaVMInitArgs* args) {
2936 
2937   // Sharing support
2938   // Construct the path to the archive
2939   char jvm_path[JVM_MAXPATHLEN];
2940   os::jvm_path(jvm_path, sizeof(jvm_path));





2941   char *end = strrchr(jvm_path, *os::file_separator());
2942   if (end != NULL) *end = '\0';
2943   char *shared_archive_path = NEW_C_HEAP_ARRAY(char, strlen(jvm_path) +
2944                                         strlen(os::file_separator()) + 20);
2945   if (shared_archive_path == NULL) return JNI_ENOMEM;
2946   strcpy(shared_archive_path, jvm_path);
2947   strcat(shared_archive_path, os::file_separator());
2948   strcat(shared_archive_path, "classes");
2949   DEBUG_ONLY(strcat(shared_archive_path, "_g");)
2950   strcat(shared_archive_path, ".jsa");
2951   SharedArchivePath = shared_archive_path;
2952 
2953   // Remaining part of option string
2954   const char* tail;
2955 
2956   // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
2957   bool settings_file_specified = false;
2958   const char* flags_file;
2959   int index;
2960   for (index = 0; index < args->nOptions; index++) {


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File