-
CSR
-
Resolution: Approved
-
P4
-
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:
- The enum constants
ATTR_ONLY
andCHECK_ONLY
need to be removed from the enum classCompilePolicy
. - The places, where constants
ATTR_ONLY
andCHECK_ONLY
are used, need to be removed or revised. - 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.
- csr of
-
JDK-8266819 Separate the stop policies from the compile policies completely
-
- Resolved
-