jbet
Class Node
java.lang.Object
jbet.Node
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- Node.aload, Node.assign, Node.astore, Node.Cast, Node.constant, Node.getfield, Node.Goto, Node.invokes, Node.invokev, Node.Label, Node.marker, Node.monitorop, Node.MultiNewArray, Node.N1, Node.N2, Node.New, Node.NewArray, Node.param, Node.ret, Node.setfield, Node.var
public class Node
- extends java.lang.Object
- implements java.lang.Cloneable
Value-DAG stores input, output, and operations as nodes. Nodes are capable
of generating their own code. This means that any rearrangement of common
subexpressions etc. should take place within the DAG representation.
Different DAG node types use subclasses of Node:
Two argument arithmetic uses Node.N2
One argument arithmetic uses Node.N1
Block inputs are Node.var
Temporary outputs are Node.assign
Constants are Node.c*
JVM new instruction is Node.New
Method calls are Node.invoke?
instanceof and checkcast Node.Cast
Constructor Summary |
Node()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
sb
public BasicBlock sb
op
public int op
count
public int count
destinations
public java.util.HashSet destinations
esneed
public boolean esneed
clocal
public int clocal
done
public boolean done
required
public boolean required
external
public boolean external
otype
public java.lang.Object otype
comment
public java.lang.String comment
requires
public java.util.Vector requires
serial
public int serial
NONE
public static Node.var[] NONE
EXIT
public static Node EXIT
OP_VAR
public static final int OP_VAR
- See Also:
- Constant Field Values
OP_CINT
public static final int OP_CINT
- See Also:
- Constant Field Values
OP_CSTRING
public static final int OP_CSTRING
- See Also:
- Constant Field Values
OP_INEG
public static final int OP_INEG
- See Also:
- Constant Field Values
OP_ARRAYLENGTH
public static final int OP_ARRAYLENGTH
- See Also:
- Constant Field Values
OP_L2I
public static final int OP_L2I
- See Also:
- Constant Field Values
OP_I2L
public static final int OP_I2L
- See Also:
- Constant Field Values
OP_FNEG
public static final int OP_FNEG
- See Also:
- Constant Field Values
OP_L2F
public static final int OP_L2F
- See Also:
- Constant Field Values
OP_I2F
public static final int OP_I2F
- See Also:
- Constant Field Values
OP_F2I
public static final int OP_F2I
- See Also:
- Constant Field Values
OP_F2L
public static final int OP_F2L
- See Also:
- Constant Field Values
OP_DNEG
public static final int OP_DNEG
- See Also:
- Constant Field Values
OP_L2D
public static final int OP_L2D
- See Also:
- Constant Field Values
OP_I2D
public static final int OP_I2D
- See Also:
- Constant Field Values
OP_F2D
public static final int OP_F2D
- See Also:
- Constant Field Values
OP_D2I
public static final int OP_D2I
- See Also:
- Constant Field Values
OP_D2L
public static final int OP_D2L
- See Also:
- Constant Field Values
OP_D2F
public static final int OP_D2F
- See Also:
- Constant Field Values
OP_I2B
public static final int OP_I2B
- See Also:
- Constant Field Values
OP_I2C
public static final int OP_I2C
- See Also:
- Constant Field Values
OP_I2S
public static final int OP_I2S
- See Also:
- Constant Field Values
OP_LNEG
public static final int OP_LNEG
- See Also:
- Constant Field Values
OP_IADD
public static final int OP_IADD
- See Also:
- Constant Field Values
OP_ISUB
public static final int OP_ISUB
- See Also:
- Constant Field Values
OP_IMUL
public static final int OP_IMUL
- See Also:
- Constant Field Values
OP_IDIV
public static final int OP_IDIV
- See Also:
- Constant Field Values
OP_IAND
public static final int OP_IAND
- See Also:
- Constant Field Values
OP_IOR
public static final int OP_IOR
- See Also:
- Constant Field Values
OP_IXOR
public static final int OP_IXOR
- See Also:
- Constant Field Values
OP_LADD
public static final int OP_LADD
- See Also:
- Constant Field Values
OP_LSUB
public static final int OP_LSUB
- See Also:
- Constant Field Values
OP_LMUL
public static final int OP_LMUL
- See Also:
- Constant Field Values
OP_LDIV
public static final int OP_LDIV
- See Also:
- Constant Field Values
OP_LAND
public static final int OP_LAND
- See Also:
- Constant Field Values
OP_LOR
public static final int OP_LOR
- See Also:
- Constant Field Values
OP_LXOR
public static final int OP_LXOR
- See Also:
- Constant Field Values
OP_LCMP
public static final int OP_LCMP
- See Also:
- Constant Field Values
OP_FADD
public static final int OP_FADD
- See Also:
- Constant Field Values
OP_FSUB
public static final int OP_FSUB
- See Also:
- Constant Field Values
OP_FMUL
public static final int OP_FMUL
- See Also:
- Constant Field Values
OP_FDIV
public static final int OP_FDIV
- See Also:
- Constant Field Values
OP_FCMPL
public static final int OP_FCMPL
- See Also:
- Constant Field Values
OP_FCMPG
public static final int OP_FCMPG
- See Also:
- Constant Field Values
OP_DADD
public static final int OP_DADD
- See Also:
- Constant Field Values
OP_DSUB
public static final int OP_DSUB
- See Also:
- Constant Field Values
OP_DMUL
public static final int OP_DMUL
- See Also:
- Constant Field Values
OP_DDIV
public static final int OP_DDIV
- See Also:
- Constant Field Values
OP_DCMPL
public static final int OP_DCMPL
- See Also:
- Constant Field Values
OP_DCMPG
public static final int OP_DCMPG
- See Also:
- Constant Field Values
OP_IREM
public static final int OP_IREM
- See Also:
- Constant Field Values
OP_ISHR
public static final int OP_ISHR
- See Also:
- Constant Field Values
OP_ISHL
public static final int OP_ISHL
- See Also:
- Constant Field Values
OP_LSHR
public static final int OP_LSHR
- See Also:
- Constant Field Values
OP_LSHL
public static final int OP_LSHL
- See Also:
- Constant Field Values
OP_LREM
public static final int OP_LREM
- See Also:
- Constant Field Values
OP_IUSHR
public static final int OP_IUSHR
- See Also:
- Constant Field Values
OP_LUSHR
public static final int OP_LUSHR
- See Also:
- Constant Field Values
OP_FREM
public static final int OP_FREM
- See Also:
- Constant Field Values
OP_DREM
public static final int OP_DREM
- See Also:
- Constant Field Values
OP_INVOKESTATIC
public static final int OP_INVOKESTATIC
- See Also:
- Constant Field Values
OP_INVOKEVIRTUAL
public static final int OP_INVOKEVIRTUAL
- See Also:
- Constant Field Values
OP_INVOKEINTERFACE
public static final int OP_INVOKEINTERFACE
- See Also:
- Constant Field Values
OP_GETFIELD
public static final int OP_GETFIELD
- See Also:
- Constant Field Values
OP_GETSTATIC
public static final int OP_GETSTATIC
- See Also:
- Constant Field Values
OP_PUTFIELD
public static final int OP_PUTFIELD
- See Also:
- Constant Field Values
OP_PUTSTATIC
public static final int OP_PUTSTATIC
- See Also:
- Constant Field Values
TOSTR_DFL
public static final int TOSTR_DFL
- See Also:
- Constant Field Values
TOSTR_EXTRA
public static final int TOSTR_EXTRA
- See Also:
- Constant Field Values
TOSTR_SRC
public static final int TOSTR_SRC
- See Also:
- Constant Field Values
TOSTR_FLAGS1
public static final int TOSTR_FLAGS1
- See Also:
- Constant Field Values
TOSTR_COMMENT
public static final int TOSTR_COMMENT
- See Also:
- Constant Field Values
op1jvm
public static final int[] op1jvm
op2jvm
public static final int[] op2jvm
jvm2node
public static final int[] jvm2node
Node
public Node()
isFake
public boolean isFake()
isinit
public boolean isinit()
usesAt
public Node usesAt(int i)
paramType
public Type paramType(int i)
numParams
public int numParams()
- Return the count of input parameters for this
subtype of Node. The first numParams() items in "requires"
are parameter Nodes.
- Returns:
- count of parameters
toString
public final java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
toString
public final java.lang.String toString(int flags)
toString1
protected java.lang.String toString1(int flags)
jvm2node
public final int jvm2node(int jvm_op)
destinationString
public final java.lang.String destinationString()
addDestination
public void addDestination(Node n)
addDestination2
public void addDestination2(Node.var n)
findinputs
public void findinputs(int[] mk)
addrefcounts
public final void addrefcounts()
allnodes
public final java.util.HashSet allnodes()
allnodes
public final void allnodes(java.util.Collection v)
allnodes
public void allnodes(java.util.Collection v,
boolean doRequires)
idempotent
public boolean idempotent()
hasSideEffect
public boolean hasSideEffect()
countDests
public final int countDests(int extra,
boolean leaveonstack)
storeDests
public final void storeDests(Snippit out,
LocalAccess locals,
int extra,
boolean leaveonstack)
- Generate code for storing to the destinations (which should have been
pushed by the code generated by this.codegen().
type
public Type type()
requires
public final InternSet requires()
- Returns:
- the set of nodes rquired by this node, not counting the inputs
require
public void require(Node n)
- indicate that this node requires another as input
require
public final void require(java.util.Collection c)
require2
public void require2(Node n)
require2
public final void require2(java.util.Collection c)
urequire
public final void urequire(java.util.Collection c)
replace
public final Node replace(java.util.Hashtable subs,
Node.SubMethod sm)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
replace
public final Node replace(java.util.Hashtable subs,
Node.SubMethod sm,
boolean recursive)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
replace1
protected final void replace1(java.util.Hashtable subs,
Node.SubMethod sm)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
codegen1
public void codegen1(Snippit out)
Constant
public static Node Constant(java.lang.Object val)