Holds an
Assumption, and knows how to recreate it with the same properties on
invalidation. Used as an Assumption factory that safely invalidates the previous Assumption and
creates a new Assumption on invalidation.
Note that you should be careful that repeated invalidations do not cause a deoptimization loop in
that same way that you would with any other assumption.
The Assumption instance should be obtained before doing the operation depending on it. In other
words:
- Obtain the current Assumption with
CyclicAssumption#getAssumption()
- Perform the operation/lookup which depends on the assumption
- Cache the result and the Assumption
On the fast-path, first check if the assumption is valid and in that case return the cached
result. When invalidating, first write the new value, then invalidate the CyclicAssumption.
cyclicassumption