Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8141042

Typos and refactoring in Compiler constraints functions

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b94

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ddmitriev Dmitry Dmitriev
                Reporter:
                ddmitriev Dmitry Dmitriev
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: