hotspot/src/share/vm/runtime/arguments.cpp
changeset 46522 86b13b03a053
parent 46458 3c12af929e7d
child 46560 388aa8d67c80
equal deleted inserted replaced
46521:17e8acfe1db8 46522:86b13b03a053
   414 };
   414 };
   415 
   415 
   416 // NOTE: A compatibility request will be necessary for each alias to be removed.
   416 // NOTE: A compatibility request will be necessary for each alias to be removed.
   417 static AliasedLoggingFlag const aliased_logging_flags[] = {
   417 static AliasedLoggingFlag const aliased_logging_flags[] = {
   418   { "PrintCompressedOopsMode",   LogLevel::Info,  true,  LOG_TAGS(gc, heap, coops) },
   418   { "PrintCompressedOopsMode",   LogLevel::Info,  true,  LOG_TAGS(gc, heap, coops) },
       
   419   { "PrintSharedSpaces",         LogLevel::Info,  true,  LOG_TAGS(cds) },
   419   { "TraceBiasedLocking",        LogLevel::Info,  true,  LOG_TAGS(biasedlocking) },
   420   { "TraceBiasedLocking",        LogLevel::Info,  true,  LOG_TAGS(biasedlocking) },
   420   { "TraceClassLoading",         LogLevel::Info,  true,  LOG_TAGS(class, load) },
   421   { "TraceClassLoading",         LogLevel::Info,  true,  LOG_TAGS(class, load) },
   421   { "TraceClassLoadingPreorder", LogLevel::Debug, true,  LOG_TAGS(class, preorder) },
   422   { "TraceClassLoadingPreorder", LogLevel::Debug, true,  LOG_TAGS(class, preorder) },
   422   { "TraceClassPaths",           LogLevel::Info,  true,  LOG_TAGS(class, path) },
   423   { "TraceClassPaths",           LogLevel::Info,  true,  LOG_TAGS(class, path) },
   423   { "TraceClassResolution",      LogLevel::Debug, true,  LOG_TAGS(class, resolve) },
   424   { "TraceClassResolution",      LogLevel::Debug, true,  LOG_TAGS(class, resolve) },
  1296                                         "--patch-module" // ignored at dump time
  1297                                         "--patch-module" // ignored at dump time
  1297                                       };
  1298                                       };
  1298   assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
  1299   assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
  1299   // If a vm option is found in the unsupported_options array with index less than the info_idx,
  1300   // If a vm option is found in the unsupported_options array with index less than the info_idx,
  1300   // vm will exit with an error message. Otherwise, it will print an informational message if
  1301   // vm will exit with an error message. Otherwise, it will print an informational message if
  1301   // PrintSharedSpaces is enabled.
  1302   // -Xlog:cds is enabled.
  1302   uint info_idx = 1;
  1303   uint info_idx = 1;
  1303   SystemProperty* sp = system_properties();
  1304   SystemProperty* sp = system_properties();
  1304   while (sp != NULL) {
  1305   while (sp != NULL) {
  1305     for (uint i = 0; i < ARRAY_SIZE(unsupported_properties); i++) {
  1306     for (uint i = 0; i < ARRAY_SIZE(unsupported_properties); i++) {
  1306       if (strcmp(sp->key(), unsupported_properties[i]) == 0) {
  1307       if (strcmp(sp->key(), unsupported_properties[i]) == 0) {
  1307         if (i < info_idx) {
  1308         if (i < info_idx) {
  1308           vm_exit_during_initialization(
  1309           vm_exit_during_initialization(
  1309             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);
  1310             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);
  1310         } else {
  1311         } else {
  1311           if (PrintSharedSpaces) {
  1312           log_info(cds)("Info: the %s option is ignored when dumping the shared archive",
  1312             tty->print_cr(
  1313                         unsupported_options[i]);
  1313               "Info: the %s option is ignored when dumping the shared archive", unsupported_options[i]);
       
  1314           }
       
  1315         }
  1314         }
  1316       }
  1315       }
  1317     }
  1316     }
  1318     sp = sp->next();
  1317     sp = sp->next();
  1319   }
  1318   }
  4400   if (DumpSharedSpaces || RequireSharedSpaces) {
  4399   if (DumpSharedSpaces || RequireSharedSpaces) {
  4401     jio_fprintf(defaultStream::error_stream(),
  4400     jio_fprintf(defaultStream::error_stream(),
  4402       "Shared spaces are not supported in this VM\n");
  4401       "Shared spaces are not supported in this VM\n");
  4403     return JNI_ERR;
  4402     return JNI_ERR;
  4404   }
  4403   }
  4405   if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) {
  4404   if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) ||
       
  4405       log_is_enabled(Info, cds)) {
  4406     warning("Shared spaces are not supported in this VM");
  4406     warning("Shared spaces are not supported in this VM");
  4407     FLAG_SET_DEFAULT(UseSharedSpaces, false);
  4407     FLAG_SET_DEFAULT(UseSharedSpaces, false);
  4408     FLAG_SET_DEFAULT(PrintSharedSpaces, false);
  4408     LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(cds));
  4409   }
  4409   }
  4410   no_shared_spaces("CDS Disabled");
  4410   no_shared_spaces("CDS Disabled");
  4411 #endif // INCLUDE_CDS
  4411 #endif // INCLUDE_CDS
  4412 
  4412 
  4413   return JNI_OK;
  4413   return JNI_OK;