src/hotspot/share/runtime/arguments.cpp
changeset 49857 31e07291ae29
parent 49853 08829995db7c
child 49860 ca5216a2a2cc
equal deleted inserted replaced
49856:5f63af8f9d7f 49857:31e07291ae29
    40 #include "memory/universe.hpp"
    40 #include "memory/universe.hpp"
    41 #include "oops/oop.inline.hpp"
    41 #include "oops/oop.inline.hpp"
    42 #include "prims/jvmtiExport.hpp"
    42 #include "prims/jvmtiExport.hpp"
    43 #include "runtime/arguments.hpp"
    43 #include "runtime/arguments.hpp"
    44 #include "runtime/arguments_ext.hpp"
    44 #include "runtime/arguments_ext.hpp"
    45 #include "runtime/commandLineFlagConstraintList.hpp"
    45 #include "runtime/flags/jvmFlag.hpp"
    46 #include "runtime/commandLineFlagWriteableList.hpp"
    46 #include "runtime/flags/jvmFlagConstraintList.hpp"
    47 #include "runtime/commandLineFlagRangeList.hpp"
    47 #include "runtime/flags/jvmFlagWriteableList.hpp"
    48 #include "runtime/globals.hpp"
    48 #include "runtime/flags/jvmFlagRangeList.hpp"
    49 #include "runtime/globals_extension.hpp"
    49 #include "runtime/globals_extension.hpp"
    50 #include "runtime/java.hpp"
    50 #include "runtime/java.hpp"
    51 #include "runtime/os.inline.hpp"
    51 #include "runtime/os.inline.hpp"
    52 #include "runtime/safepoint.hpp"
    52 #include "runtime/safepoint.hpp"
    53 #include "runtime/safepointMechanism.hpp"
    53 #include "runtime/safepointMechanism.hpp"
   737         success = false;
   737         success = false;
   738       }
   738       }
   739 
   739 
   740       // if flag has become obsolete it should not have a "globals" flag defined anymore.
   740       // if flag has become obsolete it should not have a "globals" flag defined anymore.
   741       if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
   741       if (!version_less_than(JDK_Version::current(), flag.obsolete_in)) {
   742         if (Flag::find_flag(flag.name) != NULL) {
   742         if (JVMFlag::find_flag(flag.name) != NULL) {
   743           // Temporarily disable the warning: 8196739
   743           // Temporarily disable the warning: 8196739
   744           // warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
   744           // warning("Global variable for obsolete special flag entry \"%s\" should be removed", flag.name);
   745         }
   745         }
   746       }
   746       }
   747     }
   747     }
   748 
   748 
   749     if (!flag.expired_in.is_undefined()) {
   749     if (!flag.expired_in.is_undefined()) {
   750       // if flag has become expired it should not have a "globals" flag defined anymore.
   750       // if flag has become expired it should not have a "globals" flag defined anymore.
   751       if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
   751       if (!version_less_than(JDK_Version::current(), flag.expired_in)) {
   752         if (Flag::find_flag(flag.name) != NULL) {
   752         if (JVMFlag::find_flag(flag.name) != NULL) {
   753           // Temporarily disable the warning: 8196739
   753           // Temporarily disable the warning: 8196739
   754           // warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
   754           // warning("Global variable for expired flag entry \"%s\" should be removed", flag.name);
   755         }
   755         }
   756       }
   756       }
   757     }
   757     }
   831   default:
   831   default:
   832     ShouldNotReachHere();
   832     ShouldNotReachHere();
   833   }
   833   }
   834 }
   834 }
   835 
   835 
   836 static bool set_bool_flag(const char* name, bool value, Flag::Flags origin) {
   836 static bool set_bool_flag(const char* name, bool value, JVMFlag::Flags origin) {
   837   if (CommandLineFlags::boolAtPut(name, &value, origin) == Flag::SUCCESS) {
   837   if (JVMFlag::boolAtPut(name, &value, origin) == JVMFlag::SUCCESS) {
   838     return true;
   838     return true;
   839   } else {
   839   } else {
   840     return false;
   840     return false;
   841   }
   841   }
   842 }
   842 }
   843 
   843 
   844 static bool set_fp_numeric_flag(const char* name, char* value, Flag::Flags origin) {
   844 static bool set_fp_numeric_flag(const char* name, char* value, JVMFlag::Flags origin) {
   845   char* end;
   845   char* end;
   846   errno = 0;
   846   errno = 0;
   847   double v = strtod(value, &end);
   847   double v = strtod(value, &end);
   848   if ((errno != 0) || (*end != 0)) {
   848   if ((errno != 0) || (*end != 0)) {
   849     return false;
   849     return false;
   850   }
   850   }
   851 
   851 
   852   if (CommandLineFlags::doubleAtPut(name, &v, origin) == Flag::SUCCESS) {
   852   if (JVMFlag::doubleAtPut(name, &v, origin) == JVMFlag::SUCCESS) {
   853     return true;
   853     return true;
   854   }
   854   }
   855   return false;
   855   return false;
   856 }
   856 }
   857 
   857 
   858 static bool set_numeric_flag(const char* name, char* value, Flag::Flags origin) {
   858 static bool set_numeric_flag(const char* name, char* value, JVMFlag::Flags origin) {
   859   julong v;
   859   julong v;
   860   int int_v;
   860   int int_v;
   861   intx intx_v;
   861   intx intx_v;
   862   bool is_neg = false;
   862   bool is_neg = false;
   863   Flag* result = Flag::find_flag(name, strlen(name));
   863   JVMFlag* result = JVMFlag::find_flag(name, strlen(name));
   864 
   864 
   865   if (result == NULL) {
   865   if (result == NULL) {
   866     return false;
   866     return false;
   867   }
   867   }
   868 
   868 
   880   if (result->is_int()) {
   880   if (result->is_int()) {
   881     int_v = (int) v;
   881     int_v = (int) v;
   882     if (is_neg) {
   882     if (is_neg) {
   883       int_v = -int_v;
   883       int_v = -int_v;
   884     }
   884     }
   885     return CommandLineFlags::intAtPut(result, &int_v, origin) == Flag::SUCCESS;
   885     return JVMFlag::intAtPut(result, &int_v, origin) == JVMFlag::SUCCESS;
   886   } else if (result->is_uint()) {
   886   } else if (result->is_uint()) {
   887     uint uint_v = (uint) v;
   887     uint uint_v = (uint) v;
   888     return CommandLineFlags::uintAtPut(result, &uint_v, origin) == Flag::SUCCESS;
   888     return JVMFlag::uintAtPut(result, &uint_v, origin) == JVMFlag::SUCCESS;
   889   } else if (result->is_intx()) {
   889   } else if (result->is_intx()) {
   890     intx_v = (intx) v;
   890     intx_v = (intx) v;
   891     if (is_neg) {
   891     if (is_neg) {
   892       intx_v = -intx_v;
   892       intx_v = -intx_v;
   893     }
   893     }
   894     return CommandLineFlags::intxAtPut(result, &intx_v, origin) == Flag::SUCCESS;
   894     return JVMFlag::intxAtPut(result, &intx_v, origin) == JVMFlag::SUCCESS;
   895   } else if (result->is_uintx()) {
   895   } else if (result->is_uintx()) {
   896     uintx uintx_v = (uintx) v;
   896     uintx uintx_v = (uintx) v;
   897     return CommandLineFlags::uintxAtPut(result, &uintx_v, origin) == Flag::SUCCESS;
   897     return JVMFlag::uintxAtPut(result, &uintx_v, origin) == JVMFlag::SUCCESS;
   898   } else if (result->is_uint64_t()) {
   898   } else if (result->is_uint64_t()) {
   899     uint64_t uint64_t_v = (uint64_t) v;
   899     uint64_t uint64_t_v = (uint64_t) v;
   900     return CommandLineFlags::uint64_tAtPut(result, &uint64_t_v, origin) == Flag::SUCCESS;
   900     return JVMFlag::uint64_tAtPut(result, &uint64_t_v, origin) == JVMFlag::SUCCESS;
   901   } else if (result->is_size_t()) {
   901   } else if (result->is_size_t()) {
   902     size_t size_t_v = (size_t) v;
   902     size_t size_t_v = (size_t) v;
   903     return CommandLineFlags::size_tAtPut(result, &size_t_v, origin) == Flag::SUCCESS;
   903     return JVMFlag::size_tAtPut(result, &size_t_v, origin) == JVMFlag::SUCCESS;
   904   } else if (result->is_double()) {
   904   } else if (result->is_double()) {
   905     double double_v = (double) v;
   905     double double_v = (double) v;
   906     return CommandLineFlags::doubleAtPut(result, &double_v, origin) == Flag::SUCCESS;
   906     return JVMFlag::doubleAtPut(result, &double_v, origin) == JVMFlag::SUCCESS;
   907   } else {
   907   } else {
   908     return false;
   908     return false;
   909   }
   909   }
   910 }
   910 }
   911 
   911 
   912 static bool set_string_flag(const char* name, const char* value, Flag::Flags origin) {
   912 static bool set_string_flag(const char* name, const char* value, JVMFlag::Flags origin) {
   913   if (CommandLineFlags::ccstrAtPut(name, &value, origin) != Flag::SUCCESS) return false;
   913   if (JVMFlag::ccstrAtPut(name, &value, origin) != JVMFlag::SUCCESS) return false;
   914   // Contract:  CommandLineFlags always returns a pointer that needs freeing.
   914   // Contract:  JVMFlag always returns a pointer that needs freeing.
   915   FREE_C_HEAP_ARRAY(char, value);
   915   FREE_C_HEAP_ARRAY(char, value);
   916   return true;
   916   return true;
   917 }
   917 }
   918 
   918 
   919 static bool append_to_string_flag(const char* name, const char* new_value, Flag::Flags origin) {
   919 static bool append_to_string_flag(const char* name, const char* new_value, JVMFlag::Flags origin) {
   920   const char* old_value = "";
   920   const char* old_value = "";
   921   if (CommandLineFlags::ccstrAt(name, &old_value) != Flag::SUCCESS) return false;
   921   if (JVMFlag::ccstrAt(name, &old_value) != JVMFlag::SUCCESS) return false;
   922   size_t old_len = old_value != NULL ? strlen(old_value) : 0;
   922   size_t old_len = old_value != NULL ? strlen(old_value) : 0;
   923   size_t new_len = strlen(new_value);
   923   size_t new_len = strlen(new_value);
   924   const char* value;
   924   const char* value;
   925   char* free_this_too = NULL;
   925   char* free_this_too = NULL;
   926   if (old_len == 0) {
   926   if (old_len == 0) {
   933     // each new setting adds another LINE to the switch:
   933     // each new setting adds another LINE to the switch:
   934     jio_snprintf(buf, length, "%s\n%s", old_value, new_value);
   934     jio_snprintf(buf, length, "%s\n%s", old_value, new_value);
   935     value = buf;
   935     value = buf;
   936     free_this_too = buf;
   936     free_this_too = buf;
   937   }
   937   }
   938   (void) CommandLineFlags::ccstrAtPut(name, &value, origin);
   938   (void) JVMFlag::ccstrAtPut(name, &value, origin);
   939   // CommandLineFlags always returns a pointer that needs freeing.
   939   // JVMFlag always returns a pointer that needs freeing.
   940   FREE_C_HEAP_ARRAY(char, value);
   940   FREE_C_HEAP_ARRAY(char, value);
   941   if (free_this_too != NULL) {
   941   if (free_this_too != NULL) {
   942     // CommandLineFlags made its own copy, so I must delete my own temp. buffer.
   942     // JVMFlag made its own copy, so I must delete my own temp. buffer.
   943     FREE_C_HEAP_ARRAY(char, free_this_too);
   943     FREE_C_HEAP_ARRAY(char, free_this_too);
   944   }
   944   }
   945   return true;
   945   return true;
   946 }
   946 }
   947 
   947 
  1008   }
  1008   }
  1009   AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
  1009   AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
  1010   return a;
  1010   return a;
  1011 }
  1011 }
  1012 
  1012 
  1013 bool Arguments::parse_argument(const char* arg, Flag::Flags origin) {
  1013 bool Arguments::parse_argument(const char* arg, JVMFlag::Flags origin) {
  1014 
  1014 
  1015   // range of acceptable characters spelled out for portability reasons
  1015   // range of acceptable characters spelled out for portability reasons
  1016 #define NAME_RANGE  "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]"
  1016 #define NAME_RANGE  "[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]"
  1017 #define BUFLEN 255
  1017 #define BUFLEN 255
  1018   char name[BUFLEN+1];
  1018   char name[BUFLEN+1];
  1046   }
  1046   }
  1047 
  1047 
  1048   char punct;
  1048   char punct;
  1049   if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "%c", name, &punct) == 2 && punct == '=') {
  1049   if (sscanf(arg, "%" XSTR(BUFLEN) NAME_RANGE "%c", name, &punct) == 2 && punct == '=') {
  1050     const char* value = strchr(arg, '=') + 1;
  1050     const char* value = strchr(arg, '=') + 1;
  1051     Flag* flag;
  1051     JVMFlag* flag;
  1052 
  1052 
  1053     // this scanf pattern matches both strings (handled here) and numbers (handled later))
  1053     // this scanf pattern matches both strings (handled here) and numbers (handled later))
  1054     AliasedLoggingFlag alf = catch_logging_aliases(name, true);
  1054     AliasedLoggingFlag alf = catch_logging_aliases(name, true);
  1055     if (alf.alias_name != NULL) {
  1055     if (alf.alias_name != NULL) {
  1056       LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
  1056       LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
  1058     }
  1058     }
  1059     real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
  1059     real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
  1060     if (real_name == NULL) {
  1060     if (real_name == NULL) {
  1061       return false;
  1061       return false;
  1062     }
  1062     }
  1063     flag = Flag::find_flag(real_name);
  1063     flag = JVMFlag::find_flag(real_name);
  1064     if (flag != NULL && flag->is_ccstr()) {
  1064     if (flag != NULL && flag->is_ccstr()) {
  1065       if (flag->ccstr_accumulates()) {
  1065       if (flag->ccstr_accumulates()) {
  1066         return append_to_string_flag(real_name, value, origin);
  1066         return append_to_string_flag(real_name, value, origin);
  1067       } else {
  1067       } else {
  1068         if (value[0] == '\0') {
  1068         if (value[0] == '\0') {
  1219   }
  1219   }
  1220 }
  1220 }
  1221 
  1221 
  1222 bool Arguments::process_argument(const char* arg,
  1222 bool Arguments::process_argument(const char* arg,
  1223                                  jboolean ignore_unrecognized,
  1223                                  jboolean ignore_unrecognized,
  1224                                  Flag::Flags origin) {
  1224                                  JVMFlag::Flags origin) {
  1225   JDK_Version since = JDK_Version();
  1225   JDK_Version since = JDK_Version();
  1226 
  1226 
  1227   if (parse_argument(arg, origin)) {
  1227   if (parse_argument(arg, origin)) {
  1228     return true;
  1228     return true;
  1229   }
  1229   }
  1264 #endif //PRODUCT
  1264 #endif //PRODUCT
  1265   }
  1265   }
  1266 
  1266 
  1267   // For locked flags, report a custom error message if available.
  1267   // For locked flags, report a custom error message if available.
  1268   // Otherwise, report the standard unrecognized VM option.
  1268   // Otherwise, report the standard unrecognized VM option.
  1269   Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true, true);
  1269   JVMFlag* found_flag = JVMFlag::find_flag((const char*)argname, arg_len, true, true);
  1270   if (found_flag != NULL) {
  1270   if (found_flag != NULL) {
  1271     char locked_message_buf[BUFLEN];
  1271     char locked_message_buf[BUFLEN];
  1272     Flag::MsgType msg_type = found_flag->get_locked_message(locked_message_buf, BUFLEN);
  1272     JVMFlag::MsgType msg_type = found_flag->get_locked_message(locked_message_buf, BUFLEN);
  1273     if (strlen(locked_message_buf) == 0) {
  1273     if (strlen(locked_message_buf) == 0) {
  1274       if (found_flag->is_bool() && !has_plus_minus) {
  1274       if (found_flag->is_bool() && !has_plus_minus) {
  1275         jio_fprintf(defaultStream::error_stream(),
  1275         jio_fprintf(defaultStream::error_stream(),
  1276           "Missing +/- setting for VM option '%s'\n", argname);
  1276           "Missing +/- setting for VM option '%s'\n", argname);
  1277       } else if (!found_flag->is_bool() && has_plus_minus) {
  1277       } else if (!found_flag->is_bool() && has_plus_minus) {
  1281         jio_fprintf(defaultStream::error_stream(),
  1281         jio_fprintf(defaultStream::error_stream(),
  1282           "Improperly specified VM option '%s'\n", argname);
  1282           "Improperly specified VM option '%s'\n", argname);
  1283       }
  1283       }
  1284     } else {
  1284     } else {
  1285 #ifdef PRODUCT
  1285 #ifdef PRODUCT
  1286       bool mismatched = ((msg_type == Flag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD) ||
  1286       bool mismatched = ((msg_type == JVMFlag::NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD) ||
  1287                          (msg_type == Flag::DEVELOPER_FLAG_BUT_PRODUCT_BUILD));
  1287                          (msg_type == JVMFlag::DEVELOPER_FLAG_BUT_PRODUCT_BUILD));
  1288       if (ignore_unrecognized && mismatched) {
  1288       if (ignore_unrecognized && mismatched) {
  1289         return true;
  1289         return true;
  1290       }
  1290       }
  1291 #endif
  1291 #endif
  1292       jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf);
  1292       jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf);
  1295     if (ignore_unrecognized) {
  1295     if (ignore_unrecognized) {
  1296       return true;
  1296       return true;
  1297     }
  1297     }
  1298     jio_fprintf(defaultStream::error_stream(),
  1298     jio_fprintf(defaultStream::error_stream(),
  1299                 "Unrecognized VM option '%s'\n", argname);
  1299                 "Unrecognized VM option '%s'\n", argname);
  1300     Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true);
  1300     JVMFlag* fuzzy_matched = JVMFlag::fuzzy_match((const char*)argname, arg_len, true);
  1301     if (fuzzy_matched != NULL) {
  1301     if (fuzzy_matched != NULL) {
  1302       jio_fprintf(defaultStream::error_stream(),
  1302       jio_fprintf(defaultStream::error_stream(),
  1303                   "Did you mean '%s%s%s'? ",
  1303                   "Did you mean '%s%s%s'? ",
  1304                   (fuzzy_matched->is_bool()) ? "(+/-)" : "",
  1304                   (fuzzy_matched->is_bool()) ? "(+/-)" : "",
  1305                   fuzzy_matched->_name,
  1305                   fuzzy_matched->_name,
  1348       if (c == '\n' || (!in_quote && isspace(c))) {
  1348       if (c == '\n' || (!in_quote && isspace(c))) {
  1349         // token ends at newline, or at unquoted whitespace
  1349         // token ends at newline, or at unquoted whitespace
  1350         // this allows a way to include spaces in string-valued options
  1350         // this allows a way to include spaces in string-valued options
  1351         token[pos] = '\0';
  1351         token[pos] = '\0';
  1352         logOption(token);
  1352         logOption(token);
  1353         result &= process_argument(token, ignore_unrecognized, Flag::CONFIG_FILE);
  1353         result &= process_argument(token, ignore_unrecognized, JVMFlag::CONFIG_FILE);
  1354         build_jvm_flags(token);
  1354         build_jvm_flags(token);
  1355         pos = 0;
  1355         pos = 0;
  1356         in_white_space = true;
  1356         in_white_space = true;
  1357         in_quote = false;
  1357         in_quote = false;
  1358       } else if (!in_quote && (c == '\'' || c == '"')) {
  1358       } else if (!in_quote && (c == '\'' || c == '"')) {
  1366     }
  1366     }
  1367     c = getc(stream);
  1367     c = getc(stream);
  1368   }
  1368   }
  1369   if (pos > 0) {
  1369   if (pos > 0) {
  1370     token[pos] = '\0';
  1370     token[pos] = '\0';
  1371     result &= process_argument(token, ignore_unrecognized, Flag::CONFIG_FILE);
  1371     result &= process_argument(token, ignore_unrecognized, JVMFlag::CONFIG_FILE);
  1372     build_jvm_flags(token);
  1372     build_jvm_flags(token);
  1373   }
  1373   }
  1374   fclose(stream);
  1374   fclose(stream);
  1375   return result;
  1375   return result;
  1376 }
  1376 }
  1989           total_memory - (julong) 160 * M);
  1989           total_memory - (julong) 160 * M);
  1990 
  1990 
  1991   initHeapSize = limit_by_allocatable_memory(initHeapSize);
  1991   initHeapSize = limit_by_allocatable_memory(initHeapSize);
  1992 
  1992 
  1993   if (FLAG_IS_DEFAULT(MaxHeapSize)) {
  1993   if (FLAG_IS_DEFAULT(MaxHeapSize)) {
  1994     if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != Flag::SUCCESS) {
  1994     if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
  1995       return JNI_EINVAL;
  1995       return JNI_EINVAL;
  1996     }
  1996     }
  1997     if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != Flag::SUCCESS) {
  1997     if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, initHeapSize) != JVMFlag::SUCCESS) {
  1998       return JNI_EINVAL;
  1998       return JNI_EINVAL;
  1999     }
  1999     }
  2000     // Currently the minimum size and the initial heap sizes are the same.
  2000     // Currently the minimum size and the initial heap sizes are the same.
  2001     set_min_heap_size(initHeapSize);
  2001     set_min_heap_size(initHeapSize);
  2002   }
  2002   }
  2003   if (FLAG_IS_DEFAULT(NewSize)) {
  2003   if (FLAG_IS_DEFAULT(NewSize)) {
  2004     // Make the young generation 3/8ths of the total heap.
  2004     // Make the young generation 3/8ths of the total heap.
  2005     if (FLAG_SET_CMDLINE(size_t, NewSize,
  2005     if (FLAG_SET_CMDLINE(size_t, NewSize,
  2006             ((julong) MaxHeapSize / (julong) 8) * (julong) 3) != Flag::SUCCESS) {
  2006             ((julong) MaxHeapSize / (julong) 8) * (julong) 3) != JVMFlag::SUCCESS) {
  2007       return JNI_EINVAL;
  2007       return JNI_EINVAL;
  2008     }
  2008     }
  2009     if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != Flag::SUCCESS) {
  2009     if (FLAG_SET_CMDLINE(size_t, MaxNewSize, NewSize) != JVMFlag::SUCCESS) {
  2010       return JNI_EINVAL;
  2010       return JNI_EINVAL;
  2011     }
  2011     }
  2012   }
  2012   }
  2013 
  2013 
  2014 #if !defined(_ALLBSD_SOURCE) && !defined(AIX)  // UseLargePages is not yet supported on BSD and AIX.
  2014 #if !defined(_ALLBSD_SOURCE) && !defined(AIX)  // UseLargePages is not yet supported on BSD and AIX.
  2015   FLAG_SET_DEFAULT(UseLargePages, true);
  2015   FLAG_SET_DEFAULT(UseLargePages, true);
  2016 #endif
  2016 #endif
  2017 
  2017 
  2018   // Increase some data structure sizes for efficiency
  2018   // Increase some data structure sizes for efficiency
  2019   if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != Flag::SUCCESS) {
  2019   if (FLAG_SET_CMDLINE(size_t, BaseFootPrintEstimate, MaxHeapSize) != JVMFlag::SUCCESS) {
  2020     return JNI_EINVAL;
  2020     return JNI_EINVAL;
  2021   }
  2021   }
  2022   if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != Flag::SUCCESS) {
  2022   if (FLAG_SET_CMDLINE(bool, ResizeTLAB, false) != JVMFlag::SUCCESS) {
  2023     return JNI_EINVAL;
  2023     return JNI_EINVAL;
  2024   }
  2024   }
  2025   if (FLAG_SET_CMDLINE(size_t, TLABSize, 256 * K) != Flag::SUCCESS) {
  2025   if (FLAG_SET_CMDLINE(size_t, TLABSize, 256 * K) != JVMFlag::SUCCESS) {
  2026     return JNI_EINVAL;
  2026     return JNI_EINVAL;
  2027   }
  2027   }
  2028 
  2028 
  2029   // See the OldPLABSize comment below, but replace 'after promotion'
  2029   // See the OldPLABSize comment below, but replace 'after promotion'
  2030   // with 'after copying'.  YoungPLABSize is the size of the survivor
  2030   // with 'after copying'.  YoungPLABSize is the size of the survivor
  2031   // space per-gc-thread buffers.  The default is 4kw.
  2031   // space per-gc-thread buffers.  The default is 4kw.
  2032   if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256 * K) != Flag::SUCCESS) { // Note: this is in words
  2032   if (FLAG_SET_CMDLINE(size_t, YoungPLABSize, 256 * K) != JVMFlag::SUCCESS) { // Note: this is in words
  2033     return JNI_EINVAL;
  2033     return JNI_EINVAL;
  2034   }
  2034   }
  2035 
  2035 
  2036   // OldPLABSize is the size of the buffers in the old gen that
  2036   // OldPLABSize is the size of the buffers in the old gen that
  2037   // UseParallelGC uses to promote live data that doesn't fit in the
  2037   // UseParallelGC uses to promote live data that doesn't fit in the
  2044   // is that a bigger PLAB results in retaining something like the
  2044   // is that a bigger PLAB results in retaining something like the
  2045   // original allocation order after promotion, which improves mutator
  2045   // original allocation order after promotion, which improves mutator
  2046   // locality.  A minor effect may be that larger PLABs reduce the
  2046   // locality.  A minor effect may be that larger PLABs reduce the
  2047   // number of PLAB allocation events during gc.  The value of 8kw
  2047   // number of PLAB allocation events during gc.  The value of 8kw
  2048   // was arrived at by experimenting with specjbb.
  2048   // was arrived at by experimenting with specjbb.
  2049   if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8 * K) != Flag::SUCCESS) { // Note: this is in words
  2049   if (FLAG_SET_CMDLINE(size_t, OldPLABSize, 8 * K) != JVMFlag::SUCCESS) { // Note: this is in words
  2050     return JNI_EINVAL;
  2050     return JNI_EINVAL;
  2051   }
  2051   }
  2052 
  2052 
  2053   // Enable parallel GC and adaptive generation sizing
  2053   // Enable parallel GC and adaptive generation sizing
  2054   if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) {
  2054   if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != JVMFlag::SUCCESS) {
  2055     return JNI_EINVAL;
  2055     return JNI_EINVAL;
  2056   }
  2056   }
  2057 
  2057 
  2058   // Encourage steady state memory management
  2058   // Encourage steady state memory management
  2059   if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) {
  2059   if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != JVMFlag::SUCCESS) {
  2060     return JNI_EINVAL;
  2060     return JNI_EINVAL;
  2061   }
  2061   }
  2062 
  2062 
  2063   // This appears to improve mutator locality
  2063   // This appears to improve mutator locality
  2064   if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
  2064   if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != JVMFlag::SUCCESS) {
  2065     return JNI_EINVAL;
  2065     return JNI_EINVAL;
  2066   }
  2066   }
  2067 
  2067 
  2068   // Get around early Solaris scheduling bug
  2068   // Get around early Solaris scheduling bug
  2069   // (affinity vs other jobs on system)
  2069   // (affinity vs other jobs on system)
  2070   // but disallow DR and offlining (5008695).
  2070   // but disallow DR and offlining (5008695).
  2071   if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != Flag::SUCCESS) {
  2071   if (FLAG_SET_CMDLINE(bool, BindGCTaskThreadsToCPUs, true) != JVMFlag::SUCCESS) {
  2072     return JNI_EINVAL;
  2072     return JNI_EINVAL;
  2073   }
  2073   }
  2074 
  2074 
  2075   return JNI_OK;
  2075   return JNI_OK;
  2076 }
  2076 }
  2407   // Setup flags for mixed which is the default
  2407   // Setup flags for mixed which is the default
  2408   set_mode_flags(_mixed);
  2408   set_mode_flags(_mixed);
  2409 
  2409 
  2410   // Parse args structure generated from JAVA_TOOL_OPTIONS environment
  2410   // Parse args structure generated from JAVA_TOOL_OPTIONS environment
  2411   // variable (if present).
  2411   // variable (if present).
  2412   jint result = parse_each_vm_init_arg(java_tool_options_args, &patch_mod_javabase, Flag::ENVIRON_VAR);
  2412   jint result = parse_each_vm_init_arg(java_tool_options_args, &patch_mod_javabase, JVMFlag::ENVIRON_VAR);
  2413   if (result != JNI_OK) {
  2413   if (result != JNI_OK) {
  2414     return result;
  2414     return result;
  2415   }
  2415   }
  2416 
  2416 
  2417   // Parse args structure generated from the command line flags.
  2417   // Parse args structure generated from the command line flags.
  2418   result = parse_each_vm_init_arg(cmd_line_args, &patch_mod_javabase, Flag::COMMAND_LINE);
  2418   result = parse_each_vm_init_arg(cmd_line_args, &patch_mod_javabase, JVMFlag::COMMAND_LINE);
  2419   if (result != JNI_OK) {
  2419   if (result != JNI_OK) {
  2420     return result;
  2420     return result;
  2421   }
  2421   }
  2422 
  2422 
  2423   // Parse args structure generated from the _JAVA_OPTIONS environment
  2423   // Parse args structure generated from the _JAVA_OPTIONS environment
  2424   // variable (if present) (mimics classic VM)
  2424   // variable (if present) (mimics classic VM)
  2425   result = parse_each_vm_init_arg(java_options_args, &patch_mod_javabase, Flag::ENVIRON_VAR);
  2425   result = parse_each_vm_init_arg(java_options_args, &patch_mod_javabase, JVMFlag::ENVIRON_VAR);
  2426   if (result != JNI_OK) {
  2426   if (result != JNI_OK) {
  2427     return result;
  2427     return result;
  2428   }
  2428   }
  2429 
  2429 
  2430   // We need to ensure processor and memory resources have been properly
  2430   // We need to ensure processor and memory resources have been properly
  2564   *out_ThreadStackSize = (intx)size_in_K;
  2564   *out_ThreadStackSize = (intx)size_in_K;
  2565 
  2565 
  2566   return JNI_OK;
  2566   return JNI_OK;
  2567 }
  2567 }
  2568 
  2568 
  2569 jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_mod_javabase, Flag::Flags origin) {
  2569 jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_mod_javabase, JVMFlag::Flags origin) {
  2570   // For match_option to return remaining or value part of option string
  2570   // For match_option to return remaining or value part of option string
  2571   const char* tail;
  2571   const char* tail;
  2572 
  2572 
  2573   // iterate over arguments
  2573   // iterate over arguments
  2574   for (int index = 0; index < args->nOptions; index++) {
  2574   for (int index = 0; index < args->nOptions; index++) {
  2597         LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, load));
  2597         LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, load));
  2598         LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, unload));
  2598         LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(module, unload));
  2599       } else if (!strcmp(tail, ":gc")) {
  2599       } else if (!strcmp(tail, ":gc")) {
  2600         LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
  2600         LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
  2601       } else if (!strcmp(tail, ":jni")) {
  2601       } else if (!strcmp(tail, ":jni")) {
  2602         if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != Flag::SUCCESS) {
  2602         if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != JVMFlag::SUCCESS) {
  2603           return JNI_EINVAL;
  2603           return JNI_EINVAL;
  2604         }
  2604         }
  2605       }
  2605       }
  2606     // -da / -ea / -disableassertions / -enableassertions
  2606     // -da / -ea / -disableassertions / -enableassertions
  2607     // These accept an optional class/package name separated by a colon, e.g.,
  2607     // These accept an optional class/package name separated by a colon, e.g.,
  2734     // --enable_preview
  2734     // --enable_preview
  2735     } else if (match_option(option, "--enable-preview")) {
  2735     } else if (match_option(option, "--enable-preview")) {
  2736       set_enable_preview();
  2736       set_enable_preview();
  2737     // -Xnoclassgc
  2737     // -Xnoclassgc
  2738     } else if (match_option(option, "-Xnoclassgc")) {
  2738     } else if (match_option(option, "-Xnoclassgc")) {
  2739       if (FLAG_SET_CMDLINE(bool, ClassUnloading, false) != Flag::SUCCESS) {
  2739       if (FLAG_SET_CMDLINE(bool, ClassUnloading, false) != JVMFlag::SUCCESS) {
  2740         return JNI_EINVAL;
  2740         return JNI_EINVAL;
  2741       }
  2741       }
  2742     // -Xconcgc
  2742     // -Xconcgc
  2743     } else if (match_option(option, "-Xconcgc")) {
  2743     } else if (match_option(option, "-Xconcgc")) {
  2744       if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true) != Flag::SUCCESS) {
  2744       if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, true) != JVMFlag::SUCCESS) {
  2745         return JNI_EINVAL;
  2745         return JNI_EINVAL;
  2746       }
  2746       }
  2747       handle_extra_cms_flags("-Xconcgc uses UseConcMarkSweepGC");
  2747       handle_extra_cms_flags("-Xconcgc uses UseConcMarkSweepGC");
  2748     // -Xnoconcgc
  2748     // -Xnoconcgc
  2749     } else if (match_option(option, "-Xnoconcgc")) {
  2749     } else if (match_option(option, "-Xnoconcgc")) {
  2750       if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false) != Flag::SUCCESS) {
  2750       if (FLAG_SET_CMDLINE(bool, UseConcMarkSweepGC, false) != JVMFlag::SUCCESS) {
  2751         return JNI_EINVAL;
  2751         return JNI_EINVAL;
  2752       }
  2752       }
  2753       handle_extra_cms_flags("-Xnoconcgc uses UseConcMarkSweepGC");
  2753       handle_extra_cms_flags("-Xnoconcgc uses UseConcMarkSweepGC");
  2754     // -Xbatch
  2754     // -Xbatch
  2755     } else if (match_option(option, "-Xbatch")) {
  2755     } else if (match_option(option, "-Xbatch")) {
  2756       if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != Flag::SUCCESS) {
  2756       if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != JVMFlag::SUCCESS) {
  2757         return JNI_EINVAL;
  2757         return JNI_EINVAL;
  2758       }
  2758       }
  2759     // -Xmn for compatibility with other JVM vendors
  2759     // -Xmn for compatibility with other JVM vendors
  2760     } else if (match_option(option, "-Xmn", &tail)) {
  2760     } else if (match_option(option, "-Xmn", &tail)) {
  2761       julong long_initial_young_size = 0;
  2761       julong long_initial_young_size = 0;
  2764         jio_fprintf(defaultStream::error_stream(),
  2764         jio_fprintf(defaultStream::error_stream(),
  2765                     "Invalid initial young generation size: %s\n", option->optionString);
  2765                     "Invalid initial young generation size: %s\n", option->optionString);
  2766         describe_range_error(errcode);
  2766         describe_range_error(errcode);
  2767         return JNI_EINVAL;
  2767         return JNI_EINVAL;
  2768       }
  2768       }
  2769       if (FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size) != Flag::SUCCESS) {
  2769       if (FLAG_SET_CMDLINE(size_t, MaxNewSize, (size_t)long_initial_young_size) != JVMFlag::SUCCESS) {
  2770         return JNI_EINVAL;
  2770         return JNI_EINVAL;
  2771       }
  2771       }
  2772       if (FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size) != Flag::SUCCESS) {
  2772       if (FLAG_SET_CMDLINE(size_t, NewSize, (size_t)long_initial_young_size) != JVMFlag::SUCCESS) {
  2773         return JNI_EINVAL;
  2773         return JNI_EINVAL;
  2774       }
  2774       }
  2775     // -Xms
  2775     // -Xms
  2776     } else if (match_option(option, "-Xms", &tail)) {
  2776     } else if (match_option(option, "-Xms", &tail)) {
  2777       julong long_initial_heap_size = 0;
  2777       julong long_initial_heap_size = 0;
  2784         return JNI_EINVAL;
  2784         return JNI_EINVAL;
  2785       }
  2785       }
  2786       set_min_heap_size((size_t)long_initial_heap_size);
  2786       set_min_heap_size((size_t)long_initial_heap_size);
  2787       // Currently the minimum size and the initial heap sizes are the same.
  2787       // Currently the minimum size and the initial heap sizes are the same.
  2788       // Can be overridden with -XX:InitialHeapSize.
  2788       // Can be overridden with -XX:InitialHeapSize.
  2789       if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size) != Flag::SUCCESS) {
  2789       if (FLAG_SET_CMDLINE(size_t, InitialHeapSize, (size_t)long_initial_heap_size) != JVMFlag::SUCCESS) {
  2790         return JNI_EINVAL;
  2790         return JNI_EINVAL;
  2791       }
  2791       }
  2792     // -Xmx
  2792     // -Xmx
  2793     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
  2793     } else if (match_option(option, "-Xmx", &tail) || match_option(option, "-XX:MaxHeapSize=", &tail)) {
  2794       julong long_max_heap_size = 0;
  2794       julong long_max_heap_size = 0;
  2797         jio_fprintf(defaultStream::error_stream(),
  2797         jio_fprintf(defaultStream::error_stream(),
  2798                     "Invalid maximum heap size: %s\n", option->optionString);
  2798                     "Invalid maximum heap size: %s\n", option->optionString);
  2799         describe_range_error(errcode);
  2799         describe_range_error(errcode);
  2800         return JNI_EINVAL;
  2800         return JNI_EINVAL;
  2801       }
  2801       }
  2802       if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size) != Flag::SUCCESS) {
  2802       if (FLAG_SET_CMDLINE(size_t, MaxHeapSize, (size_t)long_max_heap_size) != JVMFlag::SUCCESS) {
  2803         return JNI_EINVAL;
  2803         return JNI_EINVAL;
  2804       }
  2804       }
  2805     // Xmaxf
  2805     // Xmaxf
  2806     } else if (match_option(option, "-Xmaxf", &tail)) {
  2806     } else if (match_option(option, "-Xmaxf", &tail)) {
  2807       char* err;
  2807       char* err;
  2810         jio_fprintf(defaultStream::error_stream(),
  2810         jio_fprintf(defaultStream::error_stream(),
  2811                     "Bad max heap free percentage size: %s\n",
  2811                     "Bad max heap free percentage size: %s\n",
  2812                     option->optionString);
  2812                     option->optionString);
  2813         return JNI_EINVAL;
  2813         return JNI_EINVAL;
  2814       } else {
  2814       } else {
  2815         if (FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf) != Flag::SUCCESS) {
  2815         if (FLAG_SET_CMDLINE(uintx, MaxHeapFreeRatio, maxf) != JVMFlag::SUCCESS) {
  2816             return JNI_EINVAL;
  2816             return JNI_EINVAL;
  2817         }
  2817         }
  2818       }
  2818       }
  2819     // Xminf
  2819     // Xminf
  2820     } else if (match_option(option, "-Xminf", &tail)) {
  2820     } else if (match_option(option, "-Xminf", &tail)) {
  2824         jio_fprintf(defaultStream::error_stream(),
  2824         jio_fprintf(defaultStream::error_stream(),
  2825                     "Bad min heap free percentage size: %s\n",
  2825                     "Bad min heap free percentage size: %s\n",
  2826                     option->optionString);
  2826                     option->optionString);
  2827         return JNI_EINVAL;
  2827         return JNI_EINVAL;
  2828       } else {
  2828       } else {
  2829         if (FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf) != Flag::SUCCESS) {
  2829         if (FLAG_SET_CMDLINE(uintx, MinHeapFreeRatio, minf) != JVMFlag::SUCCESS) {
  2830           return JNI_EINVAL;
  2830           return JNI_EINVAL;
  2831         }
  2831         }
  2832       }
  2832       }
  2833     // -Xss
  2833     // -Xss
  2834     } else if (match_option(option, "-Xss", &tail)) {
  2834     } else if (match_option(option, "-Xss", &tail)) {
  2835       intx value = 0;
  2835       intx value = 0;
  2836       jint err = parse_xss(option, tail, &value);
  2836       jint err = parse_xss(option, tail, &value);
  2837       if (err != JNI_OK) {
  2837       if (err != JNI_OK) {
  2838         return err;
  2838         return err;
  2839       }
  2839       }
  2840       if (FLAG_SET_CMDLINE(intx, ThreadStackSize, value) != Flag::SUCCESS) {
  2840       if (FLAG_SET_CMDLINE(intx, ThreadStackSize, value) != JVMFlag::SUCCESS) {
  2841         return JNI_EINVAL;
  2841         return JNI_EINVAL;
  2842       }
  2842       }
  2843     } else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
  2843     } else if (match_option(option, "-Xmaxjitcodesize", &tail) ||
  2844                match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
  2844                match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) {
  2845       julong long_ReservedCodeCacheSize = 0;
  2845       julong long_ReservedCodeCacheSize = 0;
  2848       if (errcode != arg_in_range) {
  2848       if (errcode != arg_in_range) {
  2849         jio_fprintf(defaultStream::error_stream(),
  2849         jio_fprintf(defaultStream::error_stream(),
  2850                     "Invalid maximum code cache size: %s.\n", option->optionString);
  2850                     "Invalid maximum code cache size: %s.\n", option->optionString);
  2851         return JNI_EINVAL;
  2851         return JNI_EINVAL;
  2852       }
  2852       }
  2853       if (FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize) != Flag::SUCCESS) {
  2853       if (FLAG_SET_CMDLINE(uintx, ReservedCodeCacheSize, (uintx)long_ReservedCodeCacheSize) != JVMFlag::SUCCESS) {
  2854         return JNI_EINVAL;
  2854         return JNI_EINVAL;
  2855       }
  2855       }
  2856     // -green
  2856     // -green
  2857     } else if (match_option(option, "-green")) {
  2857     } else if (match_option(option, "-green")) {
  2858       jio_fprintf(defaultStream::error_stream(),
  2858       jio_fprintf(defaultStream::error_stream(),
  2862     } else if (match_option(option, "-native")) {
  2862     } else if (match_option(option, "-native")) {
  2863           // HotSpot always uses native threads, ignore silently for compatibility
  2863           // HotSpot always uses native threads, ignore silently for compatibility
  2864     // -Xrs
  2864     // -Xrs
  2865     } else if (match_option(option, "-Xrs")) {
  2865     } else if (match_option(option, "-Xrs")) {
  2866           // Classic/EVM option, new functionality
  2866           // Classic/EVM option, new functionality
  2867       if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != Flag::SUCCESS) {
  2867       if (FLAG_SET_CMDLINE(bool, ReduceSignalUsage, true) != JVMFlag::SUCCESS) {
  2868         return JNI_EINVAL;
  2868         return JNI_EINVAL;
  2869       }
  2869       }
  2870       // -Xprof
  2870       // -Xprof
  2871     } else if (match_option(option, "-Xprof")) {
  2871     } else if (match_option(option, "-Xprof")) {
  2872       char version[256];
  2872       char version[256];
  2873       // Obsolete in JDK 10
  2873       // Obsolete in JDK 10
  2874       JDK_Version::jdk(10).to_string(version, sizeof(version));
  2874       JDK_Version::jdk(10).to_string(version, sizeof(version));
  2875       warning("Ignoring option %s; support was removed in %s", option->optionString, version);
  2875       warning("Ignoring option %s; support was removed in %s", option->optionString, version);
  2876     // -Xconcurrentio
  2876     // -Xconcurrentio
  2877     } else if (match_option(option, "-Xconcurrentio")) {
  2877     } else if (match_option(option, "-Xconcurrentio")) {
  2878       if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != Flag::SUCCESS) {
  2878       if (FLAG_SET_CMDLINE(bool, UseLWPSynchronization, true) != JVMFlag::SUCCESS) {
  2879         return JNI_EINVAL;
  2879         return JNI_EINVAL;
  2880       }
  2880       }
  2881       if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != Flag::SUCCESS) {
  2881       if (FLAG_SET_CMDLINE(bool, BackgroundCompilation, false) != JVMFlag::SUCCESS) {
  2882         return JNI_EINVAL;
  2882         return JNI_EINVAL;
  2883       }
  2883       }
  2884       SafepointSynchronize::set_defer_thr_suspend_loop_count();
  2884       SafepointSynchronize::set_defer_thr_suspend_loop_count();
  2885       if (FLAG_SET_CMDLINE(bool, UseTLAB, false) != Flag::SUCCESS) {
  2885       if (FLAG_SET_CMDLINE(bool, UseTLAB, false) != JVMFlag::SUCCESS) {
  2886         return JNI_EINVAL;
  2886         return JNI_EINVAL;
  2887       }
  2887       }
  2888       if (FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K) != Flag::SUCCESS) {  // 20Kb per thread added to new generation
  2888       if (FLAG_SET_CMDLINE(size_t, NewSizeThreadIncrease, 16 * K) != JVMFlag::SUCCESS) {  // 20Kb per thread added to new generation
  2889         return JNI_EINVAL;
  2889         return JNI_EINVAL;
  2890       }
  2890       }
  2891 
  2891 
  2892       // -Xinternalversion
  2892       // -Xinternalversion
  2893     } else if (match_option(option, "-Xinternalversion")) {
  2893     } else if (match_option(option, "-Xinternalversion")) {
  2895                   VM_Version::internal_vm_info_string());
  2895                   VM_Version::internal_vm_info_string());
  2896       vm_exit(0);
  2896       vm_exit(0);
  2897 #ifndef PRODUCT
  2897 #ifndef PRODUCT
  2898     // -Xprintflags
  2898     // -Xprintflags
  2899     } else if (match_option(option, "-Xprintflags")) {
  2899     } else if (match_option(option, "-Xprintflags")) {
  2900       CommandLineFlags::printFlags(tty, false);
  2900       JVMFlag::printFlags(tty, false);
  2901       vm_exit(0);
  2901       vm_exit(0);
  2902 #endif
  2902 #endif
  2903     // -D
  2903     // -D
  2904     } else if (match_option(option, "-D", &tail)) {
  2904     } else if (match_option(option, "-D", &tail)) {
  2905       const char* value;
  2905       const char* value;
  2930         return JNI_ENOMEM;
  2930         return JNI_ENOMEM;
  2931       }
  2931       }
  2932       // Out of the box management support
  2932       // Out of the box management support
  2933       if (match_option(option, "-Dcom.sun.management", &tail)) {
  2933       if (match_option(option, "-Dcom.sun.management", &tail)) {
  2934 #if INCLUDE_MANAGEMENT
  2934 #if INCLUDE_MANAGEMENT
  2935         if (FLAG_SET_CMDLINE(bool, ManagementServer, true) != Flag::SUCCESS) {
  2935         if (FLAG_SET_CMDLINE(bool, ManagementServer, true) != JVMFlag::SUCCESS) {
  2936           return JNI_EINVAL;
  2936           return JNI_EINVAL;
  2937         }
  2937         }
  2938         // management agent in module jdk.management.agent
  2938         // management agent in module jdk.management.agent
  2939         if (!create_numbered_property("jdk.module.addmods", "jdk.management.agent", addmods_count++)) {
  2939         if (!create_numbered_property("jdk.module.addmods", "jdk.management.agent", addmods_count++)) {
  2940           return JNI_ENOMEM;
  2940           return JNI_ENOMEM;
  2955     } else if (match_option(option, "-Xcomp")) {
  2955     } else if (match_option(option, "-Xcomp")) {
  2956       // for testing the compiler; turn off all flags that inhibit compilation
  2956       // for testing the compiler; turn off all flags that inhibit compilation
  2957           set_mode_flags(_comp);
  2957           set_mode_flags(_comp);
  2958     // -Xshare:dump
  2958     // -Xshare:dump
  2959     } else if (match_option(option, "-Xshare:dump")) {
  2959     } else if (match_option(option, "-Xshare:dump")) {
  2960       if (FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true) != Flag::SUCCESS) {
  2960       if (FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true) != JVMFlag::SUCCESS) {
  2961         return JNI_EINVAL;
  2961         return JNI_EINVAL;
  2962       }
  2962       }
  2963       set_mode_flags(_int);     // Prevent compilation, which creates objects
  2963       set_mode_flags(_int);     // Prevent compilation, which creates objects
  2964     // -Xshare:on
  2964     // -Xshare:on
  2965     } else if (match_option(option, "-Xshare:on")) {
  2965     } else if (match_option(option, "-Xshare:on")) {
  2966       if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
  2966       if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != JVMFlag::SUCCESS) {
  2967         return JNI_EINVAL;
  2967         return JNI_EINVAL;
  2968       }
  2968       }
  2969       if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != Flag::SUCCESS) {
  2969       if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
  2970         return JNI_EINVAL;
  2970         return JNI_EINVAL;
  2971       }
  2971       }
  2972     // -Xshare:auto
  2972     // -Xshare:auto
  2973     } else if (match_option(option, "-Xshare:auto")) {
  2973     } else if (match_option(option, "-Xshare:auto")) {
  2974       if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
  2974       if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != JVMFlag::SUCCESS) {
  2975         return JNI_EINVAL;
  2975         return JNI_EINVAL;
  2976       }
  2976       }
  2977       if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != Flag::SUCCESS) {
  2977       if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != JVMFlag::SUCCESS) {
  2978         return JNI_EINVAL;
  2978         return JNI_EINVAL;
  2979       }
  2979       }
  2980     // -Xshare:off
  2980     // -Xshare:off
  2981     } else if (match_option(option, "-Xshare:off")) {
  2981     } else if (match_option(option, "-Xshare:off")) {
  2982       if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, false) != Flag::SUCCESS) {
  2982       if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, false) != JVMFlag::SUCCESS) {
  2983         return JNI_EINVAL;
  2983         return JNI_EINVAL;
  2984       }
  2984       }
  2985       if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != Flag::SUCCESS) {
  2985       if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false) != JVMFlag::SUCCESS) {
  2986         return JNI_EINVAL;
  2986         return JNI_EINVAL;
  2987       }
  2987       }
  2988     // -Xverify
  2988     // -Xverify
  2989     } else if (match_option(option, "-Xverify", &tail)) {
  2989     } else if (match_option(option, "-Xverify", &tail)) {
  2990       if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) {
  2990       if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) {
  2991         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true) != Flag::SUCCESS) {
  2991         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true) != JVMFlag::SUCCESS) {
  2992           return JNI_EINVAL;
  2992           return JNI_EINVAL;
  2993         }
  2993         }
  2994         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != Flag::SUCCESS) {
  2994         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != JVMFlag::SUCCESS) {
  2995           return JNI_EINVAL;
  2995           return JNI_EINVAL;
  2996         }
  2996         }
  2997       } else if (strcmp(tail, ":remote") == 0) {
  2997       } else if (strcmp(tail, ":remote") == 0) {
  2998         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != Flag::SUCCESS) {
  2998         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != JVMFlag::SUCCESS) {
  2999           return JNI_EINVAL;
  2999           return JNI_EINVAL;
  3000         }
  3000         }
  3001         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != Flag::SUCCESS) {
  3001         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true) != JVMFlag::SUCCESS) {
  3002           return JNI_EINVAL;
  3002           return JNI_EINVAL;
  3003         }
  3003         }
  3004       } else if (strcmp(tail, ":none") == 0) {
  3004       } else if (strcmp(tail, ":none") == 0) {
  3005         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != Flag::SUCCESS) {
  3005         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, false) != JVMFlag::SUCCESS) {
  3006           return JNI_EINVAL;
  3006           return JNI_EINVAL;
  3007         }
  3007         }
  3008         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != Flag::SUCCESS) {
  3008         if (FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, false) != JVMFlag::SUCCESS) {
  3009           return JNI_EINVAL;
  3009           return JNI_EINVAL;
  3010         }
  3010         }
  3011       } else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
  3011       } else if (is_bad_option(option, args->ignoreUnrecognized, "verification")) {
  3012         return JNI_EINVAL;
  3012         return JNI_EINVAL;
  3013       }
  3013       }
  3062     } else if (match_option(option, "abort")) {
  3062     } else if (match_option(option, "abort")) {
  3063       _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
  3063       _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
  3064     // Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
  3064     // Need to keep consistency of MaxTenuringThreshold and AlwaysTenure/NeverTenure;
  3065     // and the last option wins.
  3065     // and the last option wins.
  3066     } else if (match_option(option, "-XX:+NeverTenure")) {
  3066     } else if (match_option(option, "-XX:+NeverTenure")) {
  3067       if (FLAG_SET_CMDLINE(bool, NeverTenure, true) != Flag::SUCCESS) {
  3067       if (FLAG_SET_CMDLINE(bool, NeverTenure, true) != JVMFlag::SUCCESS) {
  3068         return JNI_EINVAL;
  3068         return JNI_EINVAL;
  3069       }
  3069       }
  3070       if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != Flag::SUCCESS) {
  3070       if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != JVMFlag::SUCCESS) {
  3071         return JNI_EINVAL;
  3071         return JNI_EINVAL;
  3072       }
  3072       }
  3073       if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1) != Flag::SUCCESS) {
  3073       if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, markOopDesc::max_age + 1) != JVMFlag::SUCCESS) {
  3074         return JNI_EINVAL;
  3074         return JNI_EINVAL;
  3075       }
  3075       }
  3076     } else if (match_option(option, "-XX:+AlwaysTenure")) {
  3076     } else if (match_option(option, "-XX:+AlwaysTenure")) {
  3077       if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != Flag::SUCCESS) {
  3077       if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != JVMFlag::SUCCESS) {
  3078         return JNI_EINVAL;
  3078         return JNI_EINVAL;
  3079       }
  3079       }
  3080       if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != Flag::SUCCESS) {
  3080       if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != JVMFlag::SUCCESS) {
  3081         return JNI_EINVAL;
  3081         return JNI_EINVAL;
  3082       }
  3082       }
  3083       if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0) != Flag::SUCCESS) {
  3083       if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, 0) != JVMFlag::SUCCESS) {
  3084         return JNI_EINVAL;
  3084         return JNI_EINVAL;
  3085       }
  3085       }
  3086     } else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
  3086     } else if (match_option(option, "-XX:MaxTenuringThreshold=", &tail)) {
  3087       uintx max_tenuring_thresh = 0;
  3087       uintx max_tenuring_thresh = 0;
  3088       if (!parse_uintx(tail, &max_tenuring_thresh, 0)) {
  3088       if (!parse_uintx(tail, &max_tenuring_thresh, 0)) {
  3089         jio_fprintf(defaultStream::error_stream(),
  3089         jio_fprintf(defaultStream::error_stream(),
  3090                     "Improperly specified VM option \'MaxTenuringThreshold=%s\'\n", tail);
  3090                     "Improperly specified VM option \'MaxTenuringThreshold=%s\'\n", tail);
  3091         return JNI_EINVAL;
  3091         return JNI_EINVAL;
  3092       }
  3092       }
  3093 
  3093 
  3094       if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh) != Flag::SUCCESS) {
  3094       if (FLAG_SET_CMDLINE(uintx, MaxTenuringThreshold, max_tenuring_thresh) != JVMFlag::SUCCESS) {
  3095         return JNI_EINVAL;
  3095         return JNI_EINVAL;
  3096       }
  3096       }
  3097 
  3097 
  3098       if (MaxTenuringThreshold == 0) {
  3098       if (MaxTenuringThreshold == 0) {
  3099         if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != Flag::SUCCESS) {
  3099         if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != JVMFlag::SUCCESS) {
  3100           return JNI_EINVAL;
  3100           return JNI_EINVAL;
  3101         }
  3101         }
  3102         if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != Flag::SUCCESS) {
  3102         if (FLAG_SET_CMDLINE(bool, AlwaysTenure, true) != JVMFlag::SUCCESS) {
  3103           return JNI_EINVAL;
  3103           return JNI_EINVAL;
  3104         }
  3104         }
  3105       } else {
  3105       } else {
  3106         if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != Flag::SUCCESS) {
  3106         if (FLAG_SET_CMDLINE(bool, NeverTenure, false) != JVMFlag::SUCCESS) {
  3107           return JNI_EINVAL;
  3107           return JNI_EINVAL;
  3108         }
  3108         }
  3109         if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != Flag::SUCCESS) {
  3109         if (FLAG_SET_CMDLINE(bool, AlwaysTenure, false) != JVMFlag::SUCCESS) {
  3110           return JNI_EINVAL;
  3110           return JNI_EINVAL;
  3111         }
  3111         }
  3112       }
  3112       }
  3113     } else if (match_option(option, "-XX:+DisplayVMOutputToStderr")) {
  3113     } else if (match_option(option, "-XX:+DisplayVMOutputToStderr")) {
  3114       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false) != Flag::SUCCESS) {
  3114       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, false) != JVMFlag::SUCCESS) {
  3115         return JNI_EINVAL;
  3115         return JNI_EINVAL;
  3116       }
  3116       }
  3117       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true) != Flag::SUCCESS) {
  3117       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, true) != JVMFlag::SUCCESS) {
  3118         return JNI_EINVAL;
  3118         return JNI_EINVAL;
  3119       }
  3119       }
  3120     } else if (match_option(option, "-XX:+DisplayVMOutputToStdout")) {
  3120     } else if (match_option(option, "-XX:+DisplayVMOutputToStdout")) {
  3121       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false) != Flag::SUCCESS) {
  3121       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStderr, false) != JVMFlag::SUCCESS) {
  3122         return JNI_EINVAL;
  3122         return JNI_EINVAL;
  3123       }
  3123       }
  3124       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true) != Flag::SUCCESS) {
  3124       if (FLAG_SET_CMDLINE(bool, DisplayVMOutputToStdout, true) != JVMFlag::SUCCESS) {
  3125         return JNI_EINVAL;
  3125         return JNI_EINVAL;
  3126       }
  3126       }
  3127     } else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
  3127     } else if (match_option(option, "-XX:+ExtendedDTraceProbes")) {
  3128 #if defined(DTRACE_ENABLED)
  3128 #if defined(DTRACE_ENABLED)
  3129       if (FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true) != Flag::SUCCESS) {
  3129       if (FLAG_SET_CMDLINE(bool, ExtendedDTraceProbes, true) != JVMFlag::SUCCESS) {
  3130         return JNI_EINVAL;
  3130         return JNI_EINVAL;
  3131       }
  3131       }
  3132       if (FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true) != Flag::SUCCESS) {
  3132       if (FLAG_SET_CMDLINE(bool, DTraceMethodProbes, true) != JVMFlag::SUCCESS) {
  3133         return JNI_EINVAL;
  3133         return JNI_EINVAL;
  3134       }
  3134       }
  3135       if (FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true) != Flag::SUCCESS) {
  3135       if (FLAG_SET_CMDLINE(bool, DTraceAllocProbes, true) != JVMFlag::SUCCESS) {
  3136         return JNI_EINVAL;
  3136         return JNI_EINVAL;
  3137       }
  3137       }
  3138       if (FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true) != Flag::SUCCESS) {
  3138       if (FLAG_SET_CMDLINE(bool, DTraceMonitorProbes, true) != JVMFlag::SUCCESS) {
  3139         return JNI_EINVAL;
  3139         return JNI_EINVAL;
  3140       }
  3140       }
  3141 #else // defined(DTRACE_ENABLED)
  3141 #else // defined(DTRACE_ENABLED)
  3142       jio_fprintf(defaultStream::error_stream(),
  3142       jio_fprintf(defaultStream::error_stream(),
  3143                   "ExtendedDTraceProbes flag is not applicable for this configuration\n");
  3143                   "ExtendedDTraceProbes flag is not applicable for this configuration\n");
  3144       return JNI_EINVAL;
  3144       return JNI_EINVAL;
  3145 #endif // defined(DTRACE_ENABLED)
  3145 #endif // defined(DTRACE_ENABLED)
  3146 #ifdef ASSERT
  3146 #ifdef ASSERT
  3147     } else if (match_option(option, "-XX:+FullGCALot")) {
  3147     } else if (match_option(option, "-XX:+FullGCALot")) {
  3148       if (FLAG_SET_CMDLINE(bool, FullGCALot, true) != Flag::SUCCESS) {
  3148       if (FLAG_SET_CMDLINE(bool, FullGCALot, true) != JVMFlag::SUCCESS) {
  3149         return JNI_EINVAL;
  3149         return JNI_EINVAL;
  3150       }
  3150       }
  3151       // disable scavenge before parallel mark-compact
  3151       // disable scavenge before parallel mark-compact
  3152       if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != Flag::SUCCESS) {
  3152       if (FLAG_SET_CMDLINE(bool, ScavengeBeforeFullGC, false) != JVMFlag::SUCCESS) {
  3153         return JNI_EINVAL;
  3153         return JNI_EINVAL;
  3154       }
  3154       }
  3155 #endif
  3155 #endif
  3156 #if !INCLUDE_MANAGEMENT
  3156 #if !INCLUDE_MANAGEMENT
  3157     } else if (match_option(option, "-XX:+ManagementServer")) {
  3157     } else if (match_option(option, "-XX:+ManagementServer")) {
  3176 
  3176 
  3177   // PrintSharedArchiveAndExit will turn on
  3177   // PrintSharedArchiveAndExit will turn on
  3178   //   -Xshare:on
  3178   //   -Xshare:on
  3179   //   -Xlog:class+path=info
  3179   //   -Xlog:class+path=info
  3180   if (PrintSharedArchiveAndExit) {
  3180   if (PrintSharedArchiveAndExit) {
  3181     if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
  3181     if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != JVMFlag::SUCCESS) {
  3182       return JNI_EINVAL;
  3182       return JNI_EINVAL;
  3183     }
  3183     }
  3184     if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != Flag::SUCCESS) {
  3184     if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != JVMFlag::SUCCESS) {
  3185       return JNI_EINVAL;
  3185       return JNI_EINVAL;
  3186     }
  3186     }
  3187     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
  3187     LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
  3188   }
  3188   }
  3189 
  3189 
  3854     if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions")) {
  3854     if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions")) {
  3855       IgnoreUnrecognizedVMOptions = false;
  3855       IgnoreUnrecognizedVMOptions = false;
  3856       continue;
  3856       continue;
  3857     }
  3857     }
  3858     if (match_option(option, "-XX:+PrintFlagsInitial")) {
  3858     if (match_option(option, "-XX:+PrintFlagsInitial")) {
  3859       CommandLineFlags::printFlags(tty, false);
  3859       JVMFlag::printFlags(tty, false);
  3860       vm_exit(0);
  3860       vm_exit(0);
  3861     }
  3861     }
  3862     if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
  3862     if (match_option(option, "-XX:NativeMemoryTracking", &tail)) {
  3863 #if INCLUDE_NMT
  3863 #if INCLUDE_NMT
  3864       // The launcher did not setup nmt environment variable properly.
  3864       // The launcher did not setup nmt environment variable properly.
  3883 #endif
  3883 #endif
  3884     }
  3884     }
  3885 
  3885 
  3886 #ifndef PRODUCT
  3886 #ifndef PRODUCT
  3887     if (match_option(option, "-XX:+PrintFlagsWithComments")) {
  3887     if (match_option(option, "-XX:+PrintFlagsWithComments")) {
  3888       CommandLineFlags::printFlags(tty, true);
  3888       JVMFlag::printFlags(tty, true);
  3889       vm_exit(0);
  3889       vm_exit(0);
  3890     }
  3890     }
  3891 #endif
  3891 #endif
  3892 
  3892 
  3893     if (match_option(option, "-XX:+UseAppCDS")) {
  3893     if (match_option(option, "-XX:+UseAppCDS")) {
  3894       Flag* flag = Flag::find_flag("SharedArchiveFile", 17, true, true);
  3894       JVMFlag* flag = JVMFlag::find_flag("SharedArchiveFile", 17, true, true);
  3895       if (flag->is_diagnostic()) {
  3895       if (flag->is_diagnostic()) {
  3896         flag->clear_diagnostic();
  3896         flag->clear_diagnostic();
  3897       }
  3897       }
  3898       continue;
  3898       continue;
  3899     }
  3899     }
  3945 
  3945 
  3946 jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
  3946 jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
  3947   assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent");
  3947   assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent");
  3948 
  3948 
  3949   // Initialize ranges, constraints and writeables
  3949   // Initialize ranges, constraints and writeables
  3950   CommandLineFlagRangeList::init();
  3950   JVMFlagRangeList::init();
  3951   CommandLineFlagConstraintList::init();
  3951   JVMFlagConstraintList::init();
  3952   CommandLineFlagWriteableList::init();
  3952   JVMFlagWriteableList::init();
  3953 
  3953 
  3954   // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
  3954   // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed.
  3955   const char* hotspotrc = ".hotspotrc";
  3955   const char* hotspotrc = ".hotspotrc";
  3956   bool settings_file_specified = false;
  3956   bool settings_file_specified = false;
  3957   bool needs_hotspotrc_warning = false;
  3957   bool needs_hotspotrc_warning = false;
  4248     }
  4248     }
  4249   }
  4249   }
  4250 #endif // PRODUCT
  4250 #endif // PRODUCT
  4251 
  4251 
  4252   if (PrintCommandLineFlags) {
  4252   if (PrintCommandLineFlags) {
  4253     CommandLineFlags::printSetFlags(tty);
  4253     JVMFlag::printSetFlags(tty);
  4254   }
  4254   }
  4255 
  4255 
  4256   // Apply CPU specific policy for the BiasedLocking
  4256   // Apply CPU specific policy for the BiasedLocking
  4257   if (UseBiasedLocking) {
  4257   if (UseBiasedLocking) {
  4258     if (!VM_Version::use_biased_locking() &&
  4258     if (!VM_Version::use_biased_locking() &&