RFR: 8296846: Minor cleanup of some dead code in Flow.java
Julian Waters
jwaters at openjdk.org
Thu Nov 17 04:59:23 UTC 2022
On Wed, 16 Nov 2022 20:24:54 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.
>
> Thanks for the review.
Guess my committer status promotion hasn't been fully registered with the integration system yet, sorry @archiecobbs
-------------
PR: https://git.openjdk.org/jdk/pull/11112
More information about the compiler-dev
mailing list