--- old/src/share/vm/runtime/commandLineFlagRangeList.cpp 2015-06-16 15:48:03.000000000 -0500 +++ new/src/share/vm/runtime/commandLineFlagRangeList.cpp 2015-06-16 15:48:03.000000000 -0500 @@ -28,7 +28,7 @@ #include "gc/shared/referenceProcessor.hpp" #include "runtime/arguments.hpp" #include "runtime/commandLineFlagRangeList.hpp" -#include "runtime/os_ext.hpp" +#include "runtime/os.hpp" #include "utilities/defaultStream.hpp" #include "utilities/macros.hpp" @@ -37,6 +37,7 @@ int _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_int(const char* name, int min, int max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -45,8 +46,8 @@ if ((value < _min) || (value > _max)) { if (verbose == true) { jio_fprintf(defaultStream::error_stream(), - "intx %s=%d is outside the allowed range [ %d ... %d ]\n", - _name, value, _min, _max); + "int %s=%d is outside the allowed range [ %d ... D ]\n", + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -55,7 +56,7 @@ } void print(outputStream* st) { - st->print("[ %25d ... %25d ]", _min, _max); + st->print("[ %-25d ... %25d ]", _min, _max); } }; @@ -64,6 +65,7 @@ intx _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_intx(const char* name, intx min, intx max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -72,8 +74,8 @@ if ((value < _min) || (value > _max)) { if (verbose == true) { jio_fprintf(defaultStream::error_stream(), - "intx %s="INTX_FORMAT" is outside the allowed range [ "INTX_FORMAT" ... "INTX_FORMAT" ]\n", - _name, value, _min, _max); + "intx %s=" INTX_FORMAT " is outside the allowed range [ " INTX_FORMAT " ... " INTX_FORMAT " ]\n", + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -91,6 +93,7 @@ uint _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_uint(const char* name, uint min, uint max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -100,7 +103,7 @@ if (verbose == true) { jio_fprintf(defaultStream::error_stream(), "uintx %s=%u is outside the allowed range [ %u ... %u ]\n", - _name, value, _min, _max); + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -109,7 +112,7 @@ } void print(outputStream* st) { - st->print("[ %25u ... %25u ]", _min, _max); + st->print("[ %-25u ... %25u ]", _min, _max); } }; @@ -118,6 +121,7 @@ uintx _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_uintx(const char* name, uintx min, uintx max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -126,8 +130,8 @@ if ((value < _min) || (value > _max)) { if (verbose == true) { jio_fprintf(defaultStream::error_stream(), - "uintx %s="UINTX_FORMAT" is outside the allowed range [ "UINTX_FORMAT" ... "UINTX_FORMAT" ]\n", - _name, value, _min, _max); + "uintx %s=" UINTX_FORMAT " is outside the allowed range [ " UINTX_FORMAT " ... " UINTX_FORMAT " ]\n", + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -145,6 +149,7 @@ uint64_t _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_uint64_t(const char* name, uint64_t min, uint64_t max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -153,8 +158,8 @@ if ((value < _min) || (value > _max)) { if (verbose == true) { jio_fprintf(defaultStream::error_stream(), - "uint64_t %s="UINT64_FORMAT" is outside the allowed range [ "UINT64_FORMAT" ... "UINT64_FORMAT" ]\n", - _name, value, _min, _max); + "uint64_t %s=" UINT64_FORMAT " is outside the allowed range [ " UINT64_FORMAT " ... " UINT64_FORMAT " ]\n", + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -172,6 +177,7 @@ size_t _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_size_t(const char* name, size_t min, size_t max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -180,8 +186,8 @@ if ((value < _min) || (value > _max)) { if (verbose == true) { jio_fprintf(defaultStream::error_stream(), - "size_t %s="SIZE_FORMAT" is outside the allowed range [ "SIZE_FORMAT" ... "SIZE_FORMAT" ]\n", - _name, value, _min, _max); + "size_t %s=" SIZE_FORMAT " is outside the allowed range [ " SIZE_FORMAT " ... " SIZE_FORMAT " ]\n", + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -199,6 +205,7 @@ double _max; public: + // the "name" argument must be a string literal CommandLineFlagRange_double(const char* name, double min, double max) : CommandLineFlagRange(name) { _min=min, _max=max; } @@ -208,7 +215,7 @@ if (verbose == true) { jio_fprintf(defaultStream::error_stream(), "double %s=%f is outside the allowed range [ %f ... %f ]\n", - _name, value, _min, _max); + name(), value, _min, _max); } return Flag::OUT_OF_BOUNDS; } else { @@ -236,16 +243,10 @@ void emit_range_size_t(const char* /*name*/) { /* NOP */ } void emit_range_double(const char* /*name*/) { /* NOP */ } -// CommandLineFlagRange emitting code functions if function argument is provided -void emit_range_int(const char* name, int min, int max) { - CommandLineFlagRangeList::add(new CommandLineFlagRange_int(name, min, max)); -} +// CommandLineFlagRange emitting code functions if range arguments are provided void emit_range_intx(const char* name, intx min, intx max) { CommandLineFlagRangeList::add(new CommandLineFlagRange_intx(name, min, max)); } -void emit_range_uint(const char* name, uint min, uint max) { - CommandLineFlagRangeList::add(new CommandLineFlagRange_uint(name, min, max)); -} void emit_range_uintx(const char* name, uintx min, uintx max) { CommandLineFlagRangeList::add(new CommandLineFlagRange_uintx(name, min, max)); } @@ -348,7 +349,7 @@ CommandLineFlagRange* found = NULL; for (int i=0; i_name, name) == 0) { + if (strcmp(range->name(), name) == 0) { found = range; break; }