src/share/vm/runtime/arguments.cpp

changeset 2100
ebfb7c68865e
parent 2086
ee5cc9e78493
parent 2099
f8c5d1bdaad4
child 2119
14197af1010e
child 2123
6ee479178066
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Fri Aug 20 14:24:47 2010 -0700
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Mon Aug 23 08:44:03 2010 -0700
     1.3 @@ -1561,6 +1561,18 @@
     1.4    return false;
     1.5  }
     1.6  
     1.7 +bool Arguments::verify_min_value(intx val, intx min, const char* name) {
     1.8 +  // Returns true if given value is greater than specified min threshold
     1.9 +  // false, otherwise.
    1.10 +  if (val >= min ) {
    1.11 +      return true;
    1.12 +  }
    1.13 +  jio_fprintf(defaultStream::error_stream(),
    1.14 +              "%s of " INTX_FORMAT " is invalid; must be greater than " INTX_FORMAT "\n",
    1.15 +              name, val, min);
    1.16 +  return false;
    1.17 +}
    1.18 +
    1.19  bool Arguments::verify_percentage(uintx value, const char* name) {
    1.20    if (value <= 100) {
    1.21      return true;
    1.22 @@ -1613,6 +1625,16 @@
    1.23    return status;
    1.24  }
    1.25  
    1.26 +// Check stack pages settings
    1.27 +bool Arguments::check_stack_pages()
    1.28 +{
    1.29 +  bool status = true;
    1.30 +  status = status && verify_min_value(StackYellowPages, 1, "StackYellowPages");
    1.31 +  status = status && verify_min_value(StackRedPages, 1, "StackRedPages");
    1.32 +  status = status && verify_min_value(StackShadowPages, 1, "StackShadowPages");
    1.33 +  return status;
    1.34 +}
    1.35 +
    1.36  // Check the consistency of vm_init_args
    1.37  bool Arguments::check_vm_args_consistency() {
    1.38    // Method for adding checks for flag consistency.
    1.39 @@ -1725,6 +1747,7 @@
    1.40    }
    1.41  
    1.42    status = status && check_gc_consistency();
    1.43 +  status = status && check_stack_pages();
    1.44  
    1.45    if (_has_alloc_profile) {
    1.46      if (UseParallelGC || UseParallelOldGC) {

mercurial