< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page

        

@@ -414,10 +414,11 @@
 };
 
 // NOTE: A compatibility request will be necessary for each alias to be removed.
 static AliasedLoggingFlag const aliased_logging_flags[] = {
   { "PrintCompressedOopsMode",   LogLevel::Info,  true,  LOG_TAGS(gc, heap, coops) },
+  { "PrintSharedSpaces",         LogLevel::Info,  true,  LOG_TAGS(cds) },
   { "TraceBiasedLocking",        LogLevel::Info,  true,  LOG_TAGS(biasedlocking) },
   { "TraceClassLoading",         LogLevel::Info,  true,  LOG_TAGS(class, load) },
   { "TraceClassLoadingPreorder", LogLevel::Debug, true,  LOG_TAGS(class, preorder) },
   { "TraceClassPaths",           LogLevel::Info,  true,  LOG_TAGS(class, path) },
   { "TraceClassResolution",      LogLevel::Debug, true,  LOG_TAGS(class, resolve) },

@@ -1296,24 +1297,22 @@
                                         "--patch-module" // ignored at dump time
                                       };
   assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
   // If a vm option is found in the unsupported_options array with index less than the info_idx,
   // vm will exit with an error message. Otherwise, it will print an informational message if
-  // PrintSharedSpaces is enabled.
+  // -Xlog:cds is enabled.
   uint info_idx = 1;
   SystemProperty* sp = system_properties();
   while (sp != NULL) {
     for (uint i = 0; i < ARRAY_SIZE(unsupported_properties); i++) {
       if (strcmp(sp->key(), unsupported_properties[i]) == 0) {
         if (i < info_idx) {
           vm_exit_during_initialization(
             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);
         } else {
-          if (PrintSharedSpaces) {
-            tty->print_cr(
-              "Info: the %s option is ignored when dumping the shared archive", unsupported_options[i]);
-          }
+          log_info(cds)("Info: the %s option is ignored when dumping the shared archive",
+                        unsupported_options[i]);
         }
       }
     }
     sp = sp->next();
   }

@@ -4400,14 +4399,15 @@
   if (DumpSharedSpaces || RequireSharedSpaces) {
     jio_fprintf(defaultStream::error_stream(),
       "Shared spaces are not supported in this VM\n");
     return JNI_ERR;
   }
-  if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) {
+  if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) ||
+      log_is_enabled(Info, cds)) {
     warning("Shared spaces are not supported in this VM");
     FLAG_SET_DEFAULT(UseSharedSpaces, false);
-    FLAG_SET_DEFAULT(PrintSharedSpaces, false);
+    LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(cds));
   }
   no_shared_spaces("CDS Disabled");
 #endif // INCLUDE_CDS
 
   return JNI_OK;
< prev index next >