RFR: 8241356: Use a more reliable way to encode Symbol flags [v2]

Jan Lahoda jlahoda at openjdk.java.net
Wed Feb 3 13:31:41 UTC 2021

On Wed, 3 Feb 2021 10:59:31 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> I'm also worried about where does this leave symbol construction - for instance, in TypeEnter I now see these lines (unchanged in this patch):
> ```
> params.add(new VarSymbol(
>                         GENERATED_MEMBER | PARAMETER | RECORD | (field == lastField && lastIsVarargs ? Flags.VARARGS : 0),
>                         field.name, field.sym.type, csym));
> ```
> Here, it seems, we are forced to just use a flat flags mask in the constructor - in other words, the new API is only for testing, and there is an asymmetry between construction and testing.

The flat flags work exactly as before (i.e. set as bits and checked as bit masks), and that are these bits set here. Only the symbol-kind specific flags are set and checked using methods, see e.g. the constructor for BindingSymbol.


PR: https://git.openjdk.java.net/jdk/pull/2316

More information about the compiler-dev mailing list