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

Manuel Hässig mhaessig at openjdk.org
Fri May 23 07:43:51 UTC 2025


On Tue, 20 May 2025 22:08:18 GMT, Cesar Soares Lucas <cslucas at openjdk.org> wrote:

> Please review this refactor to transform the reasons for making an nmethod not entrant from `const char*` into enum values.
> 
> Tested on Linux x64 with JTREG tier1-3 in fastdebug and release mode.

Thank you for working on this. I agree that an enum is the better option here.
However, a scoped enum might be more appropriate here. For one, because that is the guidance in the [style guide](https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md#enum). Secondly, I would argue that this enum should have some `as_string`-like function so the reason is still printed in plain text insteatd of an int. That spares me going into the source and counting down the enum, when I'm debugging a deopt 😅 . Once the codes does no rely on implicint conversion to print an int, we  do not care about the underlying type.

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

PR Review: https://git.openjdk.org/jdk/pull/25338#pullrequestreview-2863515112


More information about the graal-dev mailing list