Package com.oracle.truffle.api.utilities
Class NeverValidAssumption
- java.lang.Object
-
- com.oracle.truffle.api.utilities.NeverValidAssumption
-
- All Implemented Interfaces:
Assumption
public final class NeverValidAssumption extends java.lang.Object implements Assumption
An assumption that is never valid. Used as a placeholder where an assumption is needed that should be invalid from the start.
-
-
Field Summary
Fields Modifier and Type Field Description static NeverValidAssumption
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check()
Checks that this assumption is still valid.java.lang.String
getName()
A name for the assumption that is used for debug output.void
invalidate()
Invalidates this assumption.boolean
isValid()
Checks whether the assumption is still valid.
-
-
-
Field Detail
-
INSTANCE
public static final NeverValidAssumption INSTANCE
-
-
Method Detail
-
check
public void check() throws InvalidAssumptionException
Description copied from interface:Assumption
Checks that this assumption is still valid. The method throws an exception, if this is no longer the case. This method is preferred over theAssumption.isValid()
method when writing guest language interpreter code. The catch block should perform a node rewrite (seeNode.replace(Node)
) with a node that no longer relies on the assumption.- Specified by:
check
in interfaceAssumption
- Throws:
InvalidAssumptionException
- If the assumption is no longer valid.
-
invalidate
public void invalidate()
Description copied from interface:Assumption
Invalidates this assumption. Performs no operation, if the assumption is already invalid.- Specified by:
invalidate
in interfaceAssumption
-
getName
public java.lang.String getName()
Description copied from interface:Assumption
A name for the assumption that is used for debug output.- Specified by:
getName
in interfaceAssumption
- Returns:
- the name of the assumption
-
isValid
public boolean isValid()
Description copied from interface:Assumption
Checks whether the assumption is still valid.- Specified by:
isValid
in interfaceAssumption
- Returns:
- a boolean value indicating the validity of the assumption
-
-