RFR: 8357396: Refactor nmethod::make_not_entrant to use Enum instead of "const char*" [v3]

Cesar Soares Lucas cslucas at openjdk.org
Tue Jun 3 18:52:35 UTC 2025


On Tue, 3 Jun 2025 17:41:35 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Cesar Soares Lucas has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address PR feedback: more refactoring / renamings
>
> src/hotspot/share/code/nmethod.hpp line 500:
> 
>> 498:   static const char* change_reason_to_string(ChangeReason change_reason) {
>> 499:     switch (change_reason) {
>> 500:         case ChangeReason::C1_codepatch:                            return "C1 code patch";
> 
> Indenting: should be two spaces everywhere. Also, I think this kind of indenting forces us to re-align the switch for the largest enum label. Let's just break them. Plus, any multi-line blocks should be braced. So, in total:
> 
> 
> switch (change_reason) {
>   case ChangeReason::C1_codepatch: 
>     return "C1 code patch";
>   ...
>   default: {
>     assert(false, "Unhandled reason");
>     return "Unknown";
>   }
> }

Done, thanks.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25338#discussion_r2124655548


More information about the hotspot-dev mailing list