RFR: 8295486: Inconsistent constant field values observed during compilation
Vladimir Kozlov
kvn at openjdk.org
Fri Jan 6 18:15:28 UTC 2023
On Fri, 6 Jan 2023 08:01:25 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> The definition of @Stable is basically that we can constant-fold any value once it's initialized and (semantically) it does not make a difference which value we choose.
Okay. The spec is really bizarre for @Stable
> If we go with your proposed solution of a table of field values, we can as well use that one as cache instead of bailing out from compilation, right?
Right. I prefer caching because the value will be consistent at least during compilation and it may allow some optimizations to happen. Imaging you read same stable field on separate paths and then compare constants.
-------------
PR: https://git.openjdk.org/jdk/pull/11861
More information about the hotspot-compiler-dev
mailing list