Package com.oracle.truffle.api.utilities
Class AssumedValue<T>
- java.lang.Object
-
- com.oracle.truffle.api.utilities.AssumedValue<T>
-
public class AssumedValue<T> extends java.lang.Object
A value that the compiler can assume is constant, but can be changed by invalidation.Compiled code that uses the value will be invalidated each time the value changes, so you should take care to only change values infrequently, or to monitor the number of times the value has changed and at some point to replace the value with something more generic so that it does not have to be changed and code does not have to keep being recompiled.
-
-
Constructor Summary
Constructors Constructor Description AssumedValue(java.lang.String name, T initialValue)
AssumedValue(T initialValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Get the current value, updating it if it has beenset(T)
.void
set(T newValue)
Set a new value, which will be picked up the next timeget()
is called.
-