After JDK-8330685, the type of Compile::_barrier_set_state can be refined to the GC-agnostic BarrierSetC2State* (instead of current void*). This would improve the readability of the code and preclude some reinterpret_cast conversions. A sketch of the refactoring is available [1]. Thanks to [~mdoerr] for the suggestion [2].
[1] https://github.com/openjdk/jdk/commit/cf5c1587e0ea90a8b3de4c70e0a2bf6ba4158f15
[2] https://github.com/openjdk/jdk/pull/19026#issuecomment-2090523487
[1] https://github.com/openjdk/jdk/commit/cf5c1587e0ea90a8b3de4c70e0a2bf6ba4158f15
[2] https://github.com/openjdk/jdk/pull/19026#issuecomment-2090523487