RFR: 8350097: Make Compilation::current() and Compile::current() safer [v2]

Dean Long dlong at openjdk.org
Thu Feb 27 02:29:52 UTC 2025


On Sat, 15 Feb 2025 07:14:24 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Somewhat trivial.
>> 
>> I recently hunted a bug for an hour until I realized that I had accessed ciEnv::compiler_data() as C2 `Compile` when, in fact, it was C1 `Compilation`. Stupid mistake, but an assert is easy to do and saves time.
>
> Thomas Stuefe has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - redo
>  - Revert "start"
>    
>    This reverts commit e370e14abf2ee25019ed13cde9edfa24047d982d.

Since the callers already need to know which compiler they are asking about, I don't see the value in forcing void* through a single interface.  How about we improve things by replacing compiler_data with c1_compiler_data() and c2_compiler_data()?

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

PR Comment: https://git.openjdk.org/jdk/pull/23635#issuecomment-2686695012


More information about the hotspot-compiler-dev mailing list