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

Separate the stop policies from the compile policies completely

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 17
    • tools
    • None
    • behavioral
    • minimal
    • The options described in this CSR are internal options (accessed using `-XD`), as such the compatibility impact is likely to be small. In addition, there exists a migration path for developers using these options (`-XDshouldStop`).
    • add/remove/modify command line option
    • Implementation

      Summary

      Remove two values, attr and check, of the compiler option -XDcompilePolicy. It means that -XDcompilePolicy=attr and -XDcompilePolicy=check can't be used any more.

      Problem

      Currently, the option -XDcompilePolicy has five values: attr, check, simple, byfile, bytodo. Actually, only the last three values (simple, byfile, bytodo) are the true compile policies. The attr and check could be named stop policies, because they control when the compiler stops. It is not appropriate to mix the compile policies(simple, byfile, bytodo) with the stop policies (attr, check), which would confuse some users and even compiler developers.

      Solution

      These years, some options about the stop policies have been added to the compiler, such as -XDshould-stop.ifError and -XDshould-stop.ifNoError. They are more expressive than -XDcompilePolicy=attr and -XDcompilePolicy=check. To separate the compile policies from the stop policies, it is good to remove the values attr and check of the option -XDcompilePolicy. And we can use -XDshould-stop.ifError, -XDshould-stop.ifNoError and other options to achieve the same feature.

      Specification

      The detailed changes:

      1. The enum constants ATTR_ONLY and CHECK_ONLY need to be removed from the enum class CompilePolicy.
      2. The places, where constants ATTR_ONLY and CHECK_ONLY are used, need to be removed or revised.
      3. The test code, which uses -XDcompilePolicy=attr and -XDcompilePolicy=check, need to be replaced by -XDshould-stop.ifError and -XDshould-stop.ifNoError.

      After completing this feature, -XDcompilePolicy=attr and -XDcompilePolicy=check can't be used any more.

      This change would not affect other options and the public API of the compiler.

            gli Guoxiong Li
            gli Guoxiong Li
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: