< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




3183       // note this flag has been used, then ignore
3184       set_xdebug_mode(true);
3185     // -Xnoagent
3186     } else if (match_option(option, "-Xnoagent")) {
3187       // For compatibility with classic. HotSpot refuses to load the old style agent.dll.
3188     } else if (match_option(option, "-Xloggc:", &tail)) {
3189       // Redirect GC output to the file. -Xloggc:<filename>
3190       // ostream_init_log(), when called will use this filename
3191       // to initialize a fileStream.
3192       _gc_log_filename = os::strdup_check_oom(tail);
3193      if (!is_filename_valid(_gc_log_filename)) {
3194        jio_fprintf(defaultStream::output_stream(),
3195                   "Invalid file name for use with -Xloggc: Filename can only contain the "
3196                   "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n"
3197                   "Note %%p or %%t can only be used once\n", _gc_log_filename);
3198         return JNI_EINVAL;
3199       }
3200       if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) {
3201         return JNI_EINVAL;
3202       }
3203       if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) {
3204         return JNI_EINVAL;
3205       }
3206     } else if (match_option(option, "-Xlog", &tail)) {
3207       bool ret = false;
3208       if (strcmp(tail, ":help") == 0) {
3209         LogConfiguration::print_command_line_help(defaultStream::output_stream());
3210         vm_exit(0);
3211       } else if (strcmp(tail, ":disable") == 0) {
3212         LogConfiguration::disable_logging();
3213         ret = true;
3214       } else if (*tail == '\0') {
3215         ret = LogConfiguration::parse_command_line_arguments();
3216         assert(ret, "-Xlog without arguments should never fail to parse");
3217       } else if (*tail == ':') {
3218         ret = LogConfiguration::parse_command_line_arguments(tail + 1);
3219       }
3220       if (ret == false) {
3221         jio_fprintf(defaultStream::error_stream(),
3222                     "Invalid -Xlog option '-Xlog%s'\n",
3223                     tail);
3224         return JNI_EINVAL;
3225       }


4226 
4227 #ifndef PRODUCT
4228   if (TraceBytecodesAt != 0) {
4229     TraceBytecodes = true;
4230   }
4231   if (CountCompiledCalls) {
4232     if (UseCounterDecay) {
4233       warning("UseCounterDecay disabled because CountCalls is set");
4234       UseCounterDecay = false;
4235     }
4236   }
4237 #endif // PRODUCT
4238 
4239   if (ScavengeRootsInCode == 0) {
4240     if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
4241       warning("Forcing ScavengeRootsInCode non-zero");
4242     }
4243     ScavengeRootsInCode = 1;
4244   }
4245 




4246   if (PrintGCDetails) {
4247     // Turn on -verbose:gc options as well
4248     PrintGC = true;
4249   }
4250 
4251   // Set object alignment values.
4252   set_object_alignment();
4253 
4254 #if !INCLUDE_ALL_GCS
4255   force_serial_gc();
4256 #endif // INCLUDE_ALL_GCS
4257 #if !INCLUDE_CDS
4258   if (DumpSharedSpaces || RequireSharedSpaces) {
4259     jio_fprintf(defaultStream::error_stream(),
4260       "Shared spaces are not supported in this VM\n");
4261     return JNI_ERR;
4262   }
4263   if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) {
4264     warning("Shared spaces are not supported in this VM");
4265     FLAG_SET_DEFAULT(UseSharedSpaces, false);
4266     FLAG_SET_DEFAULT(PrintSharedSpaces, false);
4267   }
4268   no_shared_spaces("CDS Disabled");




3183       // note this flag has been used, then ignore
3184       set_xdebug_mode(true);
3185     // -Xnoagent
3186     } else if (match_option(option, "-Xnoagent")) {
3187       // For compatibility with classic. HotSpot refuses to load the old style agent.dll.
3188     } else if (match_option(option, "-Xloggc:", &tail)) {
3189       // Redirect GC output to the file. -Xloggc:<filename>
3190       // ostream_init_log(), when called will use this filename
3191       // to initialize a fileStream.
3192       _gc_log_filename = os::strdup_check_oom(tail);
3193      if (!is_filename_valid(_gc_log_filename)) {
3194        jio_fprintf(defaultStream::output_stream(),
3195                   "Invalid file name for use with -Xloggc: Filename can only contain the "
3196                   "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n"
3197                   "Note %%p or %%t can only be used once\n", _gc_log_filename);
3198         return JNI_EINVAL;
3199       }
3200       if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) {
3201         return JNI_EINVAL;
3202       }



3203     } else if (match_option(option, "-Xlog", &tail)) {
3204       bool ret = false;
3205       if (strcmp(tail, ":help") == 0) {
3206         LogConfiguration::print_command_line_help(defaultStream::output_stream());
3207         vm_exit(0);
3208       } else if (strcmp(tail, ":disable") == 0) {
3209         LogConfiguration::disable_logging();
3210         ret = true;
3211       } else if (*tail == '\0') {
3212         ret = LogConfiguration::parse_command_line_arguments();
3213         assert(ret, "-Xlog without arguments should never fail to parse");
3214       } else if (*tail == ':') {
3215         ret = LogConfiguration::parse_command_line_arguments(tail + 1);
3216       }
3217       if (ret == false) {
3218         jio_fprintf(defaultStream::error_stream(),
3219                     "Invalid -Xlog option '-Xlog%s'\n",
3220                     tail);
3221         return JNI_EINVAL;
3222       }


4223 
4224 #ifndef PRODUCT
4225   if (TraceBytecodesAt != 0) {
4226     TraceBytecodes = true;
4227   }
4228   if (CountCompiledCalls) {
4229     if (UseCounterDecay) {
4230       warning("UseCounterDecay disabled because CountCalls is set");
4231       UseCounterDecay = false;
4232     }
4233   }
4234 #endif // PRODUCT
4235 
4236   if (ScavengeRootsInCode == 0) {
4237     if (!FLAG_IS_DEFAULT(ScavengeRootsInCode)) {
4238       warning("Forcing ScavengeRootsInCode non-zero");
4239     }
4240     ScavengeRootsInCode = 1;
4241   }
4242 
4243   if (PrintGC) {
4244     warning("-XX:+PrintGC not supported in this build. Will turn it off.");
4245     PrintGC = false;
4246   }
4247   if (PrintGCDetails) {
4248     warning("-XX:+PrintGCDetails not supported in this build. Will turn it off.");
4249     PrintGCDetails = false;
4250   }
4251 
4252   // Set object alignment values.
4253   set_object_alignment();
4254 
4255 #if !INCLUDE_ALL_GCS
4256   force_serial_gc();
4257 #endif // INCLUDE_ALL_GCS
4258 #if !INCLUDE_CDS
4259   if (DumpSharedSpaces || RequireSharedSpaces) {
4260     jio_fprintf(defaultStream::error_stream(),
4261       "Shared spaces are not supported in this VM\n");
4262     return JNI_ERR;
4263   }
4264   if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) {
4265     warning("Shared spaces are not supported in this VM");
4266     FLAG_SET_DEFAULT(UseSharedSpaces, false);
4267     FLAG_SET_DEFAULT(PrintSharedSpaces, false);
4268   }
4269   no_shared_spaces("CDS Disabled");


< prev index next >