8141042: Typos and refactoring in Compiler constraints functions

Reviewed-by: vlivanov, zmajo, kvn
This commit is contained in:
Dmitry Dmitriev 2015-11-02 11:32:26 +03:00
parent adbbc4e8d8
commit 8f6db1e1a7
4 changed files with 30 additions and 28 deletions

View file

@ -138,11 +138,6 @@
#define LGRP_RSRC_MEM 1 /* memory resources */ #define LGRP_RSRC_MEM 1 /* memory resources */
#endif #endif
// see thr_setprio(3T) for the basis of these numbers
#define MinimumPriority 0
#define NormalPriority 64
#define MaximumPriority 127
// Values for ThreadPriorityPolicy == 1 // Values for ThreadPriorityPolicy == 1
int prio_policy1[CriticalPriority+1] = { int prio_policy1[CriticalPriority+1] = {
-99999, 0, 16, 32, 48, 64, -99999, 0, 16, 32, 48, 64,
@ -3138,7 +3133,7 @@ static int myMax = 0;
static int myCur = 0; static int myCur = 0;
static bool priocntl_enable = false; static bool priocntl_enable = false;
static const int criticalPrio = 60; // FX/60 is critical thread class/priority on T4 static const int criticalPrio = FXCriticalPriority;
static int java_MaxPriority_to_os_priority = 0; // Saved mapping static int java_MaxPriority_to_os_priority = 0; // Saved mapping

View file

@ -27,6 +27,14 @@
// Solaris_OS defines the interface to Solaris operating systems // Solaris_OS defines the interface to Solaris operating systems
// see thr_setprio(3T) for the basis of these numbers
#define MinimumPriority 0
#define NormalPriority 64
#define MaximumPriority 127
// FX/60 is critical thread class/priority on T4
#define FXCriticalPriority 60
// Information about the protection of the page at address '0' on this os. // Information about the protection of the page at address '0' on this os.
static bool zero_page_read_protected() { return true; } static bool zero_page_read_protected() { return true; }

View file

@ -34,10 +34,10 @@
#include "utilities/defaultStream.hpp" #include "utilities/defaultStream.hpp"
Flag::Error AliasLevelConstraintFunc(intx value, bool verbose) { Flag::Error AliasLevelConstraintFunc(intx value, bool verbose) {
if ((value <= 1) && (Arguments::mode() == Arguments::_comp)) { if ((value <= 1) && (Arguments::mode() == Arguments::_comp || Arguments::mode() == Arguments::_mixed)) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"AliasLevel (" INTX_FORMAT ") is not " "AliasLevel (" INTX_FORMAT ") is not "
"compatible with -Xcomp \n", "compatible with -Xcomp or -Xmixed\n",
value); value);
return Flag::VIOLATES_CONSTRAINT; return Flag::VIOLATES_CONSTRAINT;
} else { } else {
@ -118,10 +118,10 @@ Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) {
} }
Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) {
if (value < 0 || value > max_jint) { if (value < 1 || value > max_jint) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"AllocatePrefetchStepSize (" INTX_FORMAT ") " "AllocatePrefetchStepSize (" INTX_FORMAT ") "
"must be between 0 and %d\n", "must be between 1 and %d\n",
AllocatePrefetchStepSize, AllocatePrefetchStepSize,
max_jint); max_jint);
return Flag::VIOLATES_CONSTRAINT; return Flag::VIOLATES_CONSTRAINT;
@ -235,15 +235,17 @@ Flag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
} }
Flag::Error CompilerThreadPriorityConstraintFunc(intx value, bool verbose) { Flag::Error CompilerThreadPriorityConstraintFunc(intx value, bool verbose) {
if (value < min_jint || value > max_jint) { #ifdef SOLARIS
if ((value < MinimumPriority || value > MaximumPriority) &&
(value != -1) && (value != -FXCriticalPriority)) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"CompileThreadPriority (" INTX_FORMAT ") " "CompileThreadPriority (" INTX_FORMAT ") must be "
"must be between %d and %d. " "between %d and %d inclusively or -1 (means no change) "
"Please also make sure to specify values that are " "or %d (special value for critical thread class/priority)\n",
"meaningful to your operating system\n", value, MinimumPriority, MaximumPriority, -FXCriticalPriority);
value, min_jint, max_jint);
return Flag::VIOLATES_CONSTRAINT; return Flag::VIOLATES_CONSTRAINT;
} }
#endif
return Flag::SUCCESS; return Flag::SUCCESS;
} }
@ -277,14 +279,6 @@ Flag::Error CodeEntryAlignmentConstraintFunc(intx value, bool verbose) {
} }
Flag::Error OptoLoopAlignmentConstraintFunc(intx value, bool verbose) { Flag::Error OptoLoopAlignmentConstraintFunc(intx value, bool verbose) {
if (value < 0 || value > 16) {
CommandLineError::print(verbose,
"OptoLoopAlignment (" INTX_FORMAT ") "
"must be between 0 and 16\n",
value);
return Flag::VIOLATES_CONSTRAINT;
}
if (!is_power_of_2(value)) { if (!is_power_of_2(value)) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"OptoLoopAlignment (" INTX_FORMAT ") " "OptoLoopAlignment (" INTX_FORMAT ") "
@ -308,7 +302,8 @@ Flag::Error OptoLoopAlignmentConstraintFunc(intx value, bool verbose) {
Flag::Error ArraycopyDstPrefetchDistanceConstraintFunc(uintx value, bool verbose) { Flag::Error ArraycopyDstPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
if (value != 0) { if (value != 0) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"ArraycopyDstPrefetchDistance (" INTX_FORMAT ") must be 0\n"); "ArraycopyDstPrefetchDistance (" UINTX_FORMAT ") must be 0\n",
value);
return Flag::VIOLATES_CONSTRAINT; return Flag::VIOLATES_CONSTRAINT;
} }
@ -318,7 +313,8 @@ Flag::Error ArraycopyDstPrefetchDistanceConstraintFunc(uintx value, bool verbose
Flag::Error ArraycopySrcPrefetchDistanceConstraintFunc(uintx value, bool verbose) { Flag::Error ArraycopySrcPrefetchDistanceConstraintFunc(uintx value, bool verbose) {
if (value != 0) { if (value != 0) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"ArraycopySrcPrefetchDistance (" INTX_FORMAT ") must be 0\n"); "ArraycopySrcPrefetchDistance (" UINTX_FORMAT ") must be 0\n",
value);
return Flag::VIOLATES_CONSTRAINT; return Flag::VIOLATES_CONSTRAINT;
} }

View file

@ -3085,6 +3085,7 @@ public:
\ \
product(intx, AllocatePrefetchStepSize, 16, \ product(intx, AllocatePrefetchStepSize, 16, \
"Step size in bytes of sequential prefetch instructions") \ "Step size in bytes of sequential prefetch instructions") \
range(1, max_jint) \
constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\ constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\
\ \
product(intx, AllocatePrefetchInstr, 0, \ product(intx, AllocatePrefetchInstr, 0, \
@ -3568,6 +3569,7 @@ public:
\ \
product_pd(intx, OptoLoopAlignment, \ product_pd(intx, OptoLoopAlignment, \
"Align inner loops to zero relative to this modulus") \ "Align inner loops to zero relative to this modulus") \
range(1, 16) \
constraint(OptoLoopAlignmentConstraintFunc, AfterErgo) \ constraint(OptoLoopAlignmentConstraintFunc, AfterErgo) \
\ \
product_pd(uintx, InitialCodeCacheSize, \ product_pd(uintx, InitialCodeCacheSize, \
@ -3729,6 +3731,7 @@ public:
product(intx, CompilerThreadPriority, -1, \ product(intx, CompilerThreadPriority, -1, \
"The native priority at which compiler threads should run " \ "The native priority at which compiler threads should run " \
"(-1 means no change)") \ "(-1 means no change)") \
range(min_jint, max_jint) \
constraint(CompilerThreadPriorityConstraintFunc, AfterErgo) \ constraint(CompilerThreadPriorityConstraintFunc, AfterErgo) \
\ \
product(intx, VMThreadPriority, -1, \ product(intx, VMThreadPriority, -1, \