--- a/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 27 22:38:37 2010 -0800
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Fri Jan 29 14:51:38 2010 -0800
@@ -1487,6 +1487,20 @@
//===========================================================================================================
// Parsing of main arguments
+bool Arguments::verify_interval(uintx val, uintx min,
+ uintx max, const char* name) {
+ // Returns true iff value is in the inclusive interval [min..max]
+ // false, otherwise.
+ if (val >= min && val <= max) {
+ return true;
+ }
+ jio_fprintf(defaultStream::error_stream(),
+ "%s of " UINTX_FORMAT " is invalid; must be between " UINTX_FORMAT
+ " and " UINTX_FORMAT "\n",
+ name, val, min, max);
+ return false;
+}
+
bool Arguments::verify_percentage(uintx value, const char* name) {
if (value <= 100) {
return true;
@@ -1723,6 +1737,16 @@
status = false;
}
+ status = status && verify_interval(RefDiscoveryPolicy,
+ ReferenceProcessor::DiscoveryPolicyMin,
+ ReferenceProcessor::DiscoveryPolicyMax,
+ "RefDiscoveryPolicy");
+
+ // Limit the lower bound of this flag to 1 as it is used in a division
+ // expression.
+ status = status && verify_interval(TLABWasteTargetPercent,
+ 1, 100, "TLABWasteTargetPercent");
+
return status;
}