JDK-8141042 : Typos and refactoring in Compiler constraints functions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-30
  • Updated: 2015-11-29
  • Resolved: 2015-11-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b94Fixed
Related Reports
Relates :  
Description
Constraints for compiler flags in src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp contains several typos and also can be refactored(use generic range framework instead of direct checks in constraint function for range). Here a list:
1) CodeCacheSegmentSizeConstraintFunc function
Additional space must be added on lines 209 and 227 at the end. I.e. change ")" to ") "

2) ArraycopyDstPrefetchDistanceConstraintFunc function
INTX_FORMAT should be changed to UINTX_FORMAT and 'value' must be added as argument to print function at line 311

3) ArraycopySrcPrefetchDistanceConstraintFunc function
INTX_FORMAT should be changed to UINTX_FORMAT and 'value' must be added as argument to print function at line 321

4) AllocatePrefetchStepSizeConstraintFunc function
Range for AllocatePrefetchStepSize should be narrowed from [0, max_jint] to [1, max_jint] because it used in denominator. Also, this range can be implemented by generic framework macro 'range', i.e. following can be added for this flag to the globals.hpp:
range(1, max_jint)
But check for range in constraint should be leaved, because AllocatePrefetchStepSize is modified after ergo state, i.e. after all check for ranges are done.

5) OptoLoopAlignmentConstraintFunc
Range for OptoLoopAlignmentshould be narrowed from [0, 16] to [1, 16] because 0 not seems as valid value(will violates constraint because not a power of 2). Also, this range can be implemented by generic framework macro 'range' and check in constraint can be removed, i.e. following can be added for this flag to the globals.hpp:
range(1, 16)

6) CompilerThreadPriorityConstraintFunc
Range can be implemented by generic framework macro 'range' and check in constraint can be removed, i.e. following can be added for this flag to the globals.hpp:
range(min_jint, max_jint)

Special case must be added to the Solaris OS. Solaris accept only priorities in [0,127] or -1(not change) or -60(FX special critical priority). Otherwise assertion will fail on Solaris OS. Thus, this special case should be handled by this constraint.

7) AliasLevelConstraintFunc function
Small alias level can crash JVM with "-Xmixed" mode, thus add one more condition to the 'if' statement and update error message:
Arguments::mode() == Arguments::_mixed

This constraint can be removed when JDK-8075816 will be fixed.