Package com.oracle.truffle.api.nodes
Enum Class NodeCost
- All Implemented Interfaces:
Serializable
,Comparable<NodeCost>
,Constable
Represents a rough estimate for the cost of a
Node
. This estimate can be used by runtime
systems or guest languages to implement heuristics based on Truffle ASTs.- Since:
- 0.8 or earlier
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis node represents a megamorphic version of an operation.This node represents a specialized monomorphic version of an operation.This node has literally no costs and should be ignored for heuristics.This node represents a polymorphic version of an operation.This node has aCompilerDirectives.transferToInterpreter()
orCompilerDirectives.transferToInterpreterAndInvalidate()
as its first unconditional statement. -
Method Summary
Modifier and TypeMethodDescriptionstatic NodeCost
fromCount
(int nodeCount) Finds the node cost for an associated node count.boolean
static NodeCost
Returns the enum constant of this class with the specified name.static NodeCost[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
This node has literally no costs and should be ignored for heuristics. This is particularly useful for wrapper and profiling nodes which should not influence the heuristics.- Since:
- 0.8 or earlier
-
UNINITIALIZED
This node has aCompilerDirectives.transferToInterpreter()
orCompilerDirectives.transferToInterpreterAndInvalidate()
as its first unconditional statement.- Since:
- 0.8 or earlier
-
MONOMORPHIC
This node represents a specialized monomorphic version of an operation.- Since:
- 0.8 or earlier
-
POLYMORPHIC
This node represents a polymorphic version of an operation. For multiple chained polymorphic nodes the first may returnMONOMORPHIC
and all additional nodes should returnPOLYMORPHIC
.- Since:
- 0.8 or earlier
-
MEGAMORPHIC
This node represents a megamorphic version of an operation. This value should only be used if the operation implementation supports monomorphism and polymorphism otherwiseMONOMORPHIC
should be used instead.- Since:
- 0.8 or earlier
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isTrivial
public boolean isTrivial()- Since:
- 0.8 or earlier
-
fromCount
Finds the node cost for an associated node count. ReturnsUNINITIALIZED
for 0,MONOMORPHIC
for 1 andPOLYMORPHIC
for any other value.- Since:
- 19.0
-