RFR: 8261336: IGV: enhance default filters [v2]
Roberto Castañeda Lozano
rcastanedalo at openjdk.java.net
Mon Feb 15 11:17:42 UTC 2021
On Fri, 12 Feb 2021 12:18:35 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Roberto Castañeda Lozano has updated the pull request incrementally with five additional commits since the last revision:
>>
>> - Rewrite 'Show control flow only' filter using categories
>> - Add leading underscore field
>> - Move assertion to a default switch case
>> - Indent switch statements
>> - Use a scoped enum for type categories (as per the HotSpot style guide)
>
> src/hotspot/share/opto/type.hpp line 374:
>
>> 372: CatControl,
>> 373: CatOther, // {Type::Top, Type::Abio, Type::Bottom}.
>> 374: CatUndef // {Type::Bad, Type::lastype}, for completeness.
>
> Is "Cat" required when the enum is already called "CATEGORY"?
Right, it was required in a C-style unscoped-enum because of collisions with other enums in type.hpp. But I found in the HotSpot Style Guide that scoped-enums are actually encouraged, so I changed to that.
> src/hotspot/share/opto/idealGraphPrinter.cpp line 394:
>
>> 392: }
>> 393:
>> 394: switch (t->category()) {
>
> Might be more readable if switch cases are indented.
Done.
> src/hotspot/share/opto/type.cpp line 1178:
>
>> 1176: }
>> 1177: assert(false, "unmatched base type");
>> 1178: return CatUndef;
>
> You could add that to an explicit default case to the above switch statement to make it more clear.
Done.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2499
More information about the hotspot-compiler-dev
mailing list