Package com.oracle.truffle.api.nodes

## Enum NodeCost

- java.lang.Object
- - java.lang.Enum<NodeCost>
  - - com.oracle.truffle.api.nodes.NodeCost

All Implemented Interfaces:
  `java.io.Serializable`, `java.lang.Comparable<NodeCost>`

    public enum NodeCost
    extends java.lang.Enum<NodeCost>

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.

See Also:
  `Node.getCost()`

### Enum Constant Summary

Enum Constants
`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.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `isTrivial()`
`static NodeCost` `valueOf​(java.lang.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.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### NONE

    public static final NodeCost 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.

#### UNINITIALIZED

    public static final NodeCost UNINITIALIZED

This node has a `CompilerDirectives.transferToInterpreter()` or `CompilerDirectives.transferToInterpreterAndInvalidate()` as its first unconditional statement.

#### MONOMORPHIC

    public static final NodeCost MONOMORPHIC

This node represents a specialized monomorphic version of an operation.

#### POLYMORPHIC

    public static final NodeCost POLYMORPHIC

This node represents a polymorphic version of an operation. For multiple chained polymorphic nodes the first may return `MONOMORPHIC` and all additional nodes should return `POLYMORPHIC`.

#### MEGAMORPHIC

    public static final NodeCost MEGAMORPHIC

This node represents a megamorphic version of an operation. This value should only be used if the operation implementation supports monomorphism and polymorphism otherwise `MONOMORPHIC` should be used instead.

### Method Detail

#### values

    public static NodeCost[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (NodeCost c : NodeCost.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static NodeCost valueOf​(java.lang.String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
  `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
  `java.lang.NullPointerException` - if the argument is null

#### isTrivial

    public boolean isTrivial()