ComputedConstant condenser
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Sep 1 10:29:14 UTC 2023
On 01/09/2023 10:55, Remi Forax wrote:
> The API of ComputedConstant also shows too much. All the methods is* should not be part of the public API so a condenser has more freedom in term of implementation and the user has less chance to see that a computed constant is perhaps not equals to itself (at least until the first part of Valhalla lands).
I agree that exposing stateful queries makes it hard for these things to
be translated into pure values.
I see (at least) two possible paths here - one is, as you suggest, to
remove the predicates. The other is to tweak the condenser so that it
only optimizes away the CC for which clients do not call the predicates.
Another possible approach would be to always assume that optimized CC
are bound - after all, it's like asking if a static field is
initialized, which is a question that 99.9% cases makes no sense
(because the JVM takes care of initializing it before you need it). But
this would change semantics. (and possibly lead to API violations - e.g.
what if the initialization action fails?)
Maurizio
More information about the leyden-dev
mailing list