RFR: 8350097: Make Compilation::current() and Compile::current() safer

Thomas Stuefe stuefe at openjdk.org
Sat Feb 15 06:42:09 UTC 2025


On Sat, 15 Feb 2025 01:49:32 GMT, Dean Long <dlong at openjdk.org> wrote:

> If we derive C2 Compile and C1 Compilation from a common superclass, then ciEnv::compiler_data() could return that superclass and self-identify using a type field or virtual function. When looking into how we handle failure messages and how complicated it is, I thought moving some fields into a common superclass would be useful. Eventually we could even look into making ciEnv the common superclass, because the lifetimes are almost identical.

I thought about that, but Compile inherits from Phase, so any common superclass becomes one of Phase, too. I did not want to change the inheritance structure to deal with such a tiny problem.

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

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


More information about the hotspot-compiler-dev mailing list