On Mon, 30 Mar 2026 14:29:25 GMT, Axel Boldt-Christmas <[email protected]> wrote:
>>> Axel says `PreviewFeatures.isEnabled` can already reliably constant fold >> >> What I am trying to say is that I do not know if that is the case, but if >> that was the case we should just use it directly. >> >> My original patch was just defensive with what I know works. > > From my original PR: >> Also I am not sure if it is the case that we always trust the internal final >> values and do fold them, but I changed it to use `@stable` checks vs a >> sentinel, which I know are trusted as final. However maybe this is >> unnecessary, and some core library / compiler person has some input. @xmas92 It can. It is a static final field so its result is naturally trusted, adding `@Stable` would actually untrust its `false` value. Check `ciField.cpp`. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2249#discussion_r3010268716
