430 _name, _name);
431 return Flag::DIAGNOSTIC_FLAG_BUT_LOCKED;
432 }
433 if (is_experimental() && !is_unlocked()) {
434 jio_snprintf(buf, buflen,
435 "Error: VM option '%s' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.\n"
436 "Error: The unlock option must precede '%s'.\n",
437 _name, _name);
438 return Flag::EXPERIMENTAL_FLAG_BUT_LOCKED;
439 }
440 if (is_develop() && is_product_build()) {
441 jio_snprintf(buf, buflen, "Error: VM option '%s' is develop and is available only in debug version of VM.\n",
442 _name);
443 return Flag::DEVELOPER_FLAG_BUT_PRODUCT_BUILD;
444 }
445 if (is_notproduct() && is_product_build()) {
446 jio_snprintf(buf, buflen, "Error: VM option '%s' is notproduct and is available only in debug version of VM.\n",
447 _name);
448 return Flag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD;
449 }
450 get_locked_message_ext(buf, buflen);
451 return Flag::NONE;
452 }
453
454 bool Flag::is_writeable() const {
455 return is_manageable() || (is_product() && is_read_write()) || is_writeable_ext();
456 }
457
458 // All flags except "manageable" are assumed to be internal flags.
459 // Long term, we need to define a mechanism to specify which flags
460 // are external/stable and change this function accordingly.
461 bool Flag::is_external() const {
462 return is_manageable() || is_external_ext();
463 }
464
465 void Flag::print_on(outputStream* st, bool withComments, bool printRanges) {
466 // Don't print notproduct and develop flags in a product build.
467 if (is_constant_in_binary()) {
468 return;
469 }
470
471 if (!printRanges) {
|
430 _name, _name);
431 return Flag::DIAGNOSTIC_FLAG_BUT_LOCKED;
432 }
433 if (is_experimental() && !is_unlocked()) {
434 jio_snprintf(buf, buflen,
435 "Error: VM option '%s' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.\n"
436 "Error: The unlock option must precede '%s'.\n",
437 _name, _name);
438 return Flag::EXPERIMENTAL_FLAG_BUT_LOCKED;
439 }
440 if (is_develop() && is_product_build()) {
441 jio_snprintf(buf, buflen, "Error: VM option '%s' is develop and is available only in debug version of VM.\n",
442 _name);
443 return Flag::DEVELOPER_FLAG_BUT_PRODUCT_BUILD;
444 }
445 if (is_notproduct() && is_product_build()) {
446 jio_snprintf(buf, buflen, "Error: VM option '%s' is notproduct and is available only in debug version of VM.\n",
447 _name);
448 return Flag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD;
449 }
450 return get_locked_message_ext(buf, buflen);
451 }
452
453 bool Flag::is_writeable() const {
454 return is_manageable() || (is_product() && is_read_write()) || is_writeable_ext();
455 }
456
457 // All flags except "manageable" are assumed to be internal flags.
458 // Long term, we need to define a mechanism to specify which flags
459 // are external/stable and change this function accordingly.
460 bool Flag::is_external() const {
461 return is_manageable() || is_external_ext();
462 }
463
464 void Flag::print_on(outputStream* st, bool withComments, bool printRanges) {
465 // Don't print notproduct and develop flags in a product build.
466 if (is_constant_in_binary()) {
467 return;
468 }
469
470 if (!printRanges) {
|