public final class ConstantNode extends FloatingNode implements LIRLowerable
ConstantNode
represents a constant
.Node.ConstantNodeParameter, Node.InjectedNodeParameter, Node.Input, Node.NodeIntrinsic, Node.OptionalInput, Node.Successor, Node.ValueNumberable
Modifier and Type | Field and Description |
---|---|
static NodeClass<ConstantNode> |
TYPE |
protected Constant |
value |
NODE_LIST, NOT_ITERABLE, USE_UNSAFE_TO_CLONE, WithAllEdges, WithNoEdges, WithOnlyInputEdges, WithOnlySucessorEdges
Constructor and Description |
---|
ConstantNode(Constant value,
Stamp stamp)
Constructs a new node representing the specified constant.
|
Modifier and Type | Method and Description |
---|---|
private static ConstantNode |
createPrimitive(JavaConstant value) |
static ConstantNode |
defaultForKind(Kind kind,
StructuredGraph graph) |
static ConstantNode |
forBoolean(boolean i)
Returns a node for a boolean constant.
|
static ConstantNode |
forBoolean(boolean i,
StructuredGraph graph)
Returns a node for a boolean constant.
|
static ConstantNode |
forByte(byte i,
StructuredGraph graph)
Returns a node for a byte constant.
|
static ConstantNode |
forChar(char i,
StructuredGraph graph)
Returns a node for a char constant.
|
static ConstantNode |
forConstant(JavaConstant constant,
MetaAccessProvider metaAccess) |
static ConstantNode |
forConstant(JavaConstant constant,
MetaAccessProvider metaAccess,
StructuredGraph graph) |
static ConstantNode |
forConstant(Stamp stamp,
Constant constant,
MetaAccessProvider metaAccess) |
static ConstantNode |
forConstant(Stamp stamp,
Constant constant,
MetaAccessProvider metaAccess,
StructuredGraph graph) |
static ConstantNode |
forDouble(double d)
Returns a node for a double constant.
|
static ConstantNode |
forDouble(double d,
StructuredGraph graph)
Returns a node for a double constant.
|
static ConstantNode |
forFloat(float f)
Returns a node for a float constant.
|
static ConstantNode |
forFloat(float f,
StructuredGraph graph)
Returns a node for a float constant.
|
static ConstantNode |
forFloatingKind(Kind kind,
double value) |
static ConstantNode |
forFloatingKind(Kind kind,
double value,
StructuredGraph graph) |
static ConstantNode |
forFloatingStamp(Stamp stamp,
double value)
Returns a node for a constant double that's compatible to a given stamp.
|
static ConstantNode |
forFloatingStamp(Stamp stamp,
double value,
StructuredGraph graph)
Returns a node for a constant double that's compatible to a given stamp.
|
static ConstantNode |
forInt(int i)
Returns a node for an integer constant.
|
static ConstantNode |
forInt(int i,
StructuredGraph graph)
Returns a node for an integer constant.
|
private static ConstantNode |
forIntegerBits(int bits,
JavaConstant constant) |
private static ConstantNode |
forIntegerBits(int bits,
JavaConstant constant,
StructuredGraph graph) |
static ConstantNode |
forIntegerBits(int bits,
long value)
Returns a node for a constant integer that's not directly representable as Java primitive
(e.g.
|
static ConstantNode |
forIntegerBits(int bits,
long value,
StructuredGraph graph)
Returns a node for a constant integer that's not directly representable as Java primitive
(e.g.
|
static ConstantNode |
forIntegerKind(Kind kind,
long value) |
static ConstantNode |
forIntegerKind(Kind kind,
long value,
StructuredGraph graph) |
static ConstantNode |
forIntegerStamp(Stamp stamp,
long value)
Returns a node for a constant integer that's compatible to a given stamp.
|
static ConstantNode |
forIntegerStamp(Stamp stamp,
long value,
StructuredGraph graph)
Returns a node for a constant integer that's compatible to a given stamp.
|
static ConstantNode |
forLong(long i)
Returns a node for an long constant.
|
static ConstantNode |
forLong(long i,
StructuredGraph graph)
Returns a node for an long constant.
|
static ConstantNode |
forPrimitive(JavaConstant constant)
Returns a node for a Java primitive.
|
static ConstantNode |
forPrimitive(JavaConstant constant,
StructuredGraph graph)
Returns a node for a Java primitive.
|
static ConstantNode |
forPrimitive(Stamp stamp,
Constant constant)
Returns a node for a primitive of a given type.
|
static ConstantNode |
forPrimitive(Stamp stamp,
JavaConstant constant,
StructuredGraph graph)
Returns a node for a primitive of a given type.
|
static ConstantNode |
forShort(short i,
StructuredGraph graph)
Returns a node for a short constant.
|
void |
generate(NodeLIRBuilderTool gen) |
static NodeIterable<ConstantNode> |
getConstantNodes(StructuredGraph graph)
Gathers all the
ConstantNode s that are inputs to the
live nodes in a given graph. |
Map<Object,Object> |
getDebugProperties(Map<Object,Object> map)
Fills a
Map with properties of this node for use in debugging (e.g., to view in the
ideal graph visualizer). |
Constant |
getValue() |
private static boolean |
isCompatible(Constant value,
Stamp stamp) |
private boolean |
onlyUsedInVirtualState() |
void |
replace(StructuredGraph graph,
Node replacement)
Replaces this node at its usages with another node.
|
String |
toString(Verbosity verbosity)
Creates a String representation for this node with a given
Verbosity . |
private static ConstantNode |
unique(StructuredGraph graph,
ConstantNode node) |
asNode
asConstant, asJavaConstant, getKind, graph, inferStamp, isAllowedUsageType, isConstant, isConstantPredicate, isNullConstant, setStamp, stamp, updateStamp
acceptInputs, acceptSuccessors, afterClone, assertFalse, assertTrue, cfgPredecessors, cfgSuccessors, clearInputs, clearSuccessors, copyWithInputs, copyWithInputs, equals, fail, formatTo, getDebugProperties, getId, getNodeClass, getUsageAt, getUsageCount, hashCode, hasNoUsages, hasUsages, inputs, isAlive, isDeleted, markDeleted, modCount, newIdentityMap, newIdentityMap, newIdentityMap, newMap, newMap, newMap, newSet, newSet, predecessor, pushInputs, removeUsage, replaceAndDelete, replaceAtMatchingUsages, replaceAtPredecessor, replaceAtUsages, replaceAtUsages, replaceAtUsages, replaceFirstInput, replaceFirstSuccessor, safeDelete, simplify, successors, toString, updatePredecessor, updateUsages, updateUsagesInterface, usages, valueEquals, verify, verifyEdges, verifyInputs
public static final NodeClass<ConstantNode> TYPE
public ConstantNode(Constant value, Stamp stamp)
value
- the constantprivate static ConstantNode createPrimitive(JavaConstant value)
private static boolean isCompatible(Constant value, Stamp stamp)
public static NodeIterable<ConstantNode> getConstantNodes(StructuredGraph graph)
ConstantNode
s that are inputs to the
live nodes in a given graph.public void replace(StructuredGraph graph, Node replacement)
public void generate(NodeLIRBuilderTool gen)
generate
in interface LIRLowerable
private boolean onlyUsedInVirtualState()
public static ConstantNode forConstant(JavaConstant constant, MetaAccessProvider metaAccess, StructuredGraph graph)
public static ConstantNode forConstant(JavaConstant constant, MetaAccessProvider metaAccess)
public static ConstantNode forConstant(Stamp stamp, Constant constant, MetaAccessProvider metaAccess, StructuredGraph graph)
public static ConstantNode forConstant(Stamp stamp, Constant constant, MetaAccessProvider metaAccess)
public static ConstantNode forPrimitive(JavaConstant constant, StructuredGraph graph)
public static ConstantNode forPrimitive(JavaConstant constant)
public static ConstantNode forPrimitive(Stamp stamp, JavaConstant constant, StructuredGraph graph)
public static ConstantNode forPrimitive(Stamp stamp, Constant constant)
public static ConstantNode forDouble(double d, StructuredGraph graph)
d
- the double value for which to create the instructionpublic static ConstantNode forDouble(double d)
d
- the double value for which to create the instructionpublic static ConstantNode forFloat(float f, StructuredGraph graph)
f
- the float value for which to create the instructionpublic static ConstantNode forFloat(float f)
f
- the float value for which to create the instructionpublic static ConstantNode forLong(long i, StructuredGraph graph)
i
- the long value for which to create the instructionpublic static ConstantNode forLong(long i)
i
- the long value for which to create the instructionpublic static ConstantNode forInt(int i, StructuredGraph graph)
i
- the integer value for which to create the instructionpublic static ConstantNode forInt(int i)
i
- the integer value for which to create the instructionpublic static ConstantNode forBoolean(boolean i, StructuredGraph graph)
i
- the boolean value for which to create the instructionpublic static ConstantNode forBoolean(boolean i)
i
- the boolean value for which to create the instructionpublic static ConstantNode forByte(byte i, StructuredGraph graph)
i
- the byte value for which to create the instructionpublic static ConstantNode forChar(char i, StructuredGraph graph)
i
- the char value for which to create the instructionpublic static ConstantNode forShort(short i, StructuredGraph graph)
i
- the short value for which to create the instructionprivate static ConstantNode unique(StructuredGraph graph, ConstantNode node)
private static ConstantNode forIntegerBits(int bits, JavaConstant constant, StructuredGraph graph)
public static ConstantNode forIntegerBits(int bits, long value, StructuredGraph graph)
private static ConstantNode forIntegerBits(int bits, JavaConstant constant)
public static ConstantNode forIntegerBits(int bits, long value)
public static ConstantNode forIntegerStamp(Stamp stamp, long value, StructuredGraph graph)
public static ConstantNode forIntegerStamp(Stamp stamp, long value)
public static ConstantNode forIntegerKind(Kind kind, long value, StructuredGraph graph)
public static ConstantNode forIntegerKind(Kind kind, long value)
public static ConstantNode forFloatingKind(Kind kind, double value, StructuredGraph graph)
public static ConstantNode forFloatingKind(Kind kind, double value)
public static ConstantNode forFloatingStamp(Stamp stamp, double value, StructuredGraph graph)
public static ConstantNode forFloatingStamp(Stamp stamp, double value)
public static ConstantNode defaultForKind(Kind kind, StructuredGraph graph)
public Map<Object,Object> getDebugProperties(Map<Object,Object> map)
Node
Map
with properties of this node for use in debugging (e.g., to view in the
ideal graph visualizer). Subclasses overriding this method should also fill the map using
their superclass.getDebugProperties
in class Node