Integrated: 8296846: Minor cleanup of some dead code in Flow.java
Archie L. Cobbs
duke at openjdk.org
Fri Nov 18 04:29:17 UTC 2022
On Fri, 11 Nov 2022 21:40:36 GMT, Archie L. Cobbs <duke at openjdk.org> wrote:
> This patch removes two bits of dead code that I ran across.
>
> The only interesting bit is the second patch, which removes this check:
>
> /* Ignore synthetic methods, except for translated lambda methods.
> */
> if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
> return;
> }
>
> because it's always preceded by this more general check:
>
> /* MemberEnter can generate synthetic methods ignore them
> */
> if ((tree.sym.flags() & SYNTHETIC) != 0) {
> return;
> }
>
> and so can never match.
>
> So the patch preserves the existing behavior, but the bit being removed there begs the question: was there some scenario where `tree.sym.flags()` could have both `SYNTHETIC` and `LAMBDA_METHOD` that we were supposed to be handling?
>
> As it turns out, the `LAMBDA_METHOD` flag is only ever set by `LambdaToMethod`, but that class runs after this code (during flow analysis). So if there ever was any such scenario, it can no longer happen anyway.
This pull request has now been integrated.
Changeset: 2f063b86
Author: Archie L. Cobbs <archie.cobbs at gmail.com>
Committer: Vicente Romero <vromero at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/2f063b86fba785bce03f9f9b3092046be188b84c
Stats: 13 lines in 1 file changed: 0 ins; 13 del; 0 mod
8296846: Minor cleanup of some dead code in Flow.java
Reviewed-by: vromero
-------------
PR: https://git.openjdk.org/jdk/pull/11112
More information about the compiler-dev
mailing list