public enum NodeCost extends Enum<NodeCost>
Node
. This estimate can be used by runtime
systems or guest languages to implement heuristics based on Truffle ASTs.Node.getCost()
Enum.EnumDesc<E extends Enum<E>>
Enum Constant and Description |
---|
MEGAMORPHIC
This node represents a megamorphic version of an operation.
|
MONOMORPHIC
This node represents a specialized monomorphic version of an operation.
|
NONE
This node has literally no costs and should be ignored for heuristics.
|
POLYMORPHIC
This node represents a polymorphic version of an operation.
|
UNINITIALIZED
This node has a
CompilerDirectives.transferToInterpreter() or
CompilerDirectives.transferToInterpreterAndInvalidate() as its first unconditional
statement. |
Modifier and Type | Method and Description |
---|---|
static NodeCost |
fromCount(int nodeCount)
Finds the node cost for an associated node count.
|
boolean |
isTrivial() |
static NodeCost |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NodeCost[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NodeCost NONE
public static final NodeCost UNINITIALIZED
CompilerDirectives.transferToInterpreter()
or
CompilerDirectives.transferToInterpreterAndInvalidate()
as its first unconditional
statement.public static final NodeCost MONOMORPHIC
public static final NodeCost POLYMORPHIC
NodeCost.MONOMORPHIC
and all additional nodes should return
NodeCost.POLYMORPHIC
.public static final NodeCost MEGAMORPHIC
NodeCost.MONOMORPHIC
should be used instead.public static NodeCost[] values()
public static NodeCost valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isTrivial()
public static NodeCost fromCount(int nodeCount)
NodeCost.UNINITIALIZED
for
0, NodeCost.MONOMORPHIC
for 1 and NodeCost.POLYMORPHIC
for any other value.