public class ConstantNode extends LoadNode
v = constant
| Modifier and Type | Class and Description |
|---|---|
static class |
ConstantNode.Type
The different kinds of constant values.
|
EXCEPTION_REG, FIRST_ORDINARY_REG, NO_VALUE, RETURN_REG| Modifier and Type | Method and Description |
|---|---|
boolean |
canThrowExceptions()
Returns true if this node may throw exceptions.
|
boolean |
getBoolean()
Returns the boolean (for Type.BOOLEAN only).
|
double |
getNumber()
Returns the number (for Type.NUMBER only).
|
String |
getString()
Returns the string (for Type.STRING only).
|
ConstantNode.Type |
getType()
Returns the type.
|
boolean |
isSSA()
Returns true if result_reg is only assigned by this node.
|
static ConstantNode |
makeBoolean(boolean bool,
int result_reg,
boolean ssa,
SourceLocation location)
Constructs a new constant boolean node.
|
static ConstantNode |
makeBoolean(boolean bool,
int result_reg,
SourceLocation location)
Constructs a new constant boolean node.
|
static ConstantNode |
makeNull(int result_reg,
boolean ssa,
SourceLocation location)
Constructs a new constant 'null' node.
|
static ConstantNode |
makeNull(int result_reg,
SourceLocation location)
Constructs a new constant 'null' node.
|
static ConstantNode |
makeNumber(double number,
int result_reg,
boolean ssa,
SourceLocation location)
Constructs a new constant number node.
|
static ConstantNode |
makeNumber(double number,
int result_reg,
SourceLocation location)
Constructs a new constant number node.
|
static ConstantNode |
makeString(String string,
int result_reg,
boolean ssa,
SourceLocation location)
Constructs a new constant string node.
|
static ConstantNode |
makeString(String string,
int result_reg,
SourceLocation location)
Constructs a new constant string node.
|
static ConstantNode |
makeUndefined(int result_reg,
boolean ssa,
SourceLocation location)
Constructs a new constant 'undefined' node.
|
static ConstantNode |
makeUndefined(int result_reg,
SourceLocation location)
Constructs a new constant 'undefined' node.
|
String |
toString()
Returns a string description of this node.
|
<ArgType> void |
visitBy(NodeVisitor<ArgType> v,
ArgType a)
Visits this node with the given visitor.
|
getResultRegistercheck, getBlock, getDuplicateOf, getIndex, getSourceLocation, isArtificial, isDead, isRegistersDone, setArtificial, setBlock, setDead, setDuplicateOf, setIndex, setRegistersDonepublic boolean canThrowExceptions()
AbstractNodecanThrowExceptions in class AbstractNodepublic boolean getBoolean()
public double getNumber()
public String getString()
public ConstantNode.Type getType()
public boolean isSSA()
public static ConstantNode makeBoolean(boolean bool, int result_reg, boolean ssa, SourceLocation location)
bool - The boolean.result_reg - The register to store the boolean in.ssa - Is the boolean in SSA form.location - The source location.public static ConstantNode makeBoolean(boolean bool, int result_reg, SourceLocation location)
bool - The boolean.result_reg - The register to store the boolean in.location - The source location.public static ConstantNode makeNull(int result_reg, boolean ssa, SourceLocation location)
result_reg - The register to store the 'null' in.ssa - Is the null in SSA form.location - The source location.public static ConstantNode makeNull(int result_reg, SourceLocation location)
result_reg - The register to store the 'null' in.location - The source location.public static ConstantNode makeNumber(double number, int result_reg, boolean ssa, SourceLocation location)
number - The number.result_reg - The register to store the number in.ssa - Is the number in SSA form.location - The source location.public static ConstantNode makeNumber(double number, int result_reg, SourceLocation location)
number - The number.result_reg - The register to store the number in.location - The source location.public static ConstantNode makeString(String string, int result_reg, boolean ssa, SourceLocation location)
string - The string.result_reg - The register to store the string in.ssa - Is the string in SSA form.location - The source location.public static ConstantNode makeString(String string, int result_reg, SourceLocation location)
string - The string.result_reg - The register to store the string in.location - The source location.public static ConstantNode makeUndefined(int result_reg, boolean ssa, SourceLocation location)
result_reg - The register to store the undefined in.ssa - Is the undefined in SSA form.location - The source location.public static ConstantNode makeUndefined(int result_reg, SourceLocation location)
result_reg - The register to store the undefined in.location - The source location.public String toString()
AbstractNodetoString in class AbstractNodepublic <ArgType> void visitBy(NodeVisitor<ArgType> v, ArgType a)
NodeCopyright © 2012 Aarhus University