362 { "ParallelGCRetainPLAB", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
362 { "ParallelGCRetainPLAB", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
363 { "ThreadSafetyMargin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
363 { "ThreadSafetyMargin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
364 { "LazyBootClassLoader", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
364 { "LazyBootClassLoader", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
365 { "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
365 { "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
366 { "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
366 { "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
|
367 { "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, |
367 |
368 |
368 #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS |
369 #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS |
369 { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, |
370 { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, |
370 { "dep > exp ", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(8) }, |
371 { "dep > exp ", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(8) }, |
371 { "obs > exp ", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(8) }, |
372 { "obs > exp ", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(8) }, |
815 static bool set_numeric_flag(const char* name, char* value, Flag::Flags origin) { |
816 static bool set_numeric_flag(const char* name, char* value, Flag::Flags origin) { |
816 julong v; |
817 julong v; |
817 int int_v; |
818 int int_v; |
818 intx intx_v; |
819 intx intx_v; |
819 bool is_neg = false; |
820 bool is_neg = false; |
|
821 Flag* result = Flag::find_flag(name, strlen(name)); |
|
822 |
|
823 if (result == NULL) { |
|
824 return false; |
|
825 } |
|
826 |
820 // Check the sign first since atomull() parses only unsigned values. |
827 // Check the sign first since atomull() parses only unsigned values. |
821 if (*value == '-') { |
828 if (*value == '-') { |
822 if ((CommandLineFlags::intxAt(name, &intx_v) != Flag::SUCCESS) && (CommandLineFlags::intAt(name, &int_v) != Flag::SUCCESS)) { |
829 if (!result->is_intx() && !result->is_int()) { |
823 return false; |
830 return false; |
824 } |
831 } |
825 value++; |
832 value++; |
826 is_neg = true; |
833 is_neg = true; |
827 } |
834 } |
828 if (!atomull(value, &v)) { |
835 if (!atomull(value, &v)) { |
829 return false; |
836 return false; |
830 } |
837 } |
831 int_v = (int) v; |
838 if (result->is_int()) { |
832 if (is_neg) { |
839 int_v = (int) v; |
833 int_v = -int_v; |
840 if (is_neg) { |
834 } |
841 int_v = -int_v; |
835 if (CommandLineFlags::intAtPut(name, &int_v, origin) == Flag::SUCCESS) { |
842 } |
836 return true; |
843 return CommandLineFlags::intAtPut(result, &int_v, origin) == Flag::SUCCESS; |
837 } |
844 } else if (result->is_uint()) { |
838 uint uint_v = (uint) v; |
845 uint uint_v = (uint) v; |
839 if (!is_neg && CommandLineFlags::uintAtPut(name, &uint_v, origin) == Flag::SUCCESS) { |
846 return CommandLineFlags::uintAtPut(result, &uint_v, origin) == Flag::SUCCESS; |
840 return true; |
847 } else if (result->is_intx()) { |
841 } |
848 intx_v = (intx) v; |
842 intx_v = (intx) v; |
849 if (is_neg) { |
843 if (is_neg) { |
850 intx_v = -intx_v; |
844 intx_v = -intx_v; |
851 } |
845 } |
852 return CommandLineFlags::intxAtPut(result, &intx_v, origin) == Flag::SUCCESS; |
846 if (CommandLineFlags::intxAtPut(name, &intx_v, origin) == Flag::SUCCESS) { |
853 } else if (result->is_uintx()) { |
847 return true; |
854 uintx uintx_v = (uintx) v; |
848 } |
855 return CommandLineFlags::uintxAtPut(result, &uintx_v, origin) == Flag::SUCCESS; |
849 uintx uintx_v = (uintx) v; |
856 } else if (result->is_uint64_t()) { |
850 if (!is_neg && (CommandLineFlags::uintxAtPut(name, &uintx_v, origin) == Flag::SUCCESS)) { |
857 uint64_t uint64_t_v = (uint64_t) v; |
851 return true; |
858 return CommandLineFlags::uint64_tAtPut(result, &uint64_t_v, origin) == Flag::SUCCESS; |
852 } |
859 } else if (result->is_size_t()) { |
853 uint64_t uint64_t_v = (uint64_t) v; |
860 size_t size_t_v = (size_t) v; |
854 if (!is_neg && (CommandLineFlags::uint64_tAtPut(name, &uint64_t_v, origin) == Flag::SUCCESS)) { |
861 return CommandLineFlags::size_tAtPut(result, &size_t_v, origin) == Flag::SUCCESS; |
855 return true; |
862 } else { |
856 } |
863 return false; |
857 size_t size_t_v = (size_t) v; |
864 } |
858 if (!is_neg && (CommandLineFlags::size_tAtPut(name, &size_t_v, origin) == Flag::SUCCESS)) { |
|
859 return true; |
|
860 } |
|
861 return false; |
|
862 } |
865 } |
863 |
866 |
864 static bool set_string_flag(const char* name, const char* value, Flag::Flags origin) { |
867 static bool set_string_flag(const char* name, const char* value, Flag::Flags origin) { |
865 if (CommandLineFlags::ccstrAtPut(name, &value, origin) != Flag::SUCCESS) return false; |
868 if (CommandLineFlags::ccstrAtPut(name, &value, origin) != Flag::SUCCESS) return false; |
866 // Contract: CommandLineFlags always returns a pointer that needs freeing. |
869 // Contract: CommandLineFlags always returns a pointer that needs freeing. |