Elide GraalVM25.6.0-elide.4
All types
Versions and modules

AssumedValue

Javaclassin com.oracle.truffle.api.utilitiessince 0.8 or earlier

public class AssumedValue<T>
Inheritance
  1. Object
  2. AssumedValue

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.

Constructors2

AssumedValue(T)No description.

AssumedValue

since 0.8 or earlier
public AssumedValue(T initialValue)

No description.

Parameters

initialValueT
No description.
AssumedValue(String, T)No description.

AssumedValue

since 0.8 or earlier
public AssumedValue(String name, T initialValue)

No description.

Parameters

nameString
No description.
initialValueT
No description.

Methods2

T get()

get

since 0.8 or earlier
public T get()

Get the current value, updating it if it has been set. The compiler may be able to make this method return a constant value, but still accommodate mutation.

Returns

T
No description.
void set(T)

set

since 0.8 or earlier
public void set(T newValue)

Set a new value, which will be picked up the next time get is called.

Parameters

newValueT
No description.

Inherited members