Package EDU.purdue.cs.bloat.tree
Class Tree
- java.lang.Object
-
- EDU.purdue.cs.bloat.tree.Node
-
- EDU.purdue.cs.bloat.tree.Tree
-
- All Implemented Interfaces:
InstructionVisitor,Opcode
public class Tree extends Node implements InstructionVisitor, Opcode
Tree represents the expression tree of a basic Block. It consists of an operand (expression) stack comprised of expressions and a list of statements contained in the block.- See Also:
Block,Expr,OperandStack,see StmtList
-
-
Field Summary
Fields Modifier and Type Field Description static booleanAUPDATE_FIX_HACKstatic booleanAUPDATE_FIX_HACK_CHANGEDstatic booleanDEBUGstatic booleanFLATTENstatic booleanUSE_PERSISTENTstatic booleanUSE_STACK-
Fields inherited from interface EDU.purdue.cs.bloat.editor.Opcode
opc_aaload, opc_aastore, opc_aconst_null, opc_aload, opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3, opc_anewarray, opc_areturn, opc_arraylength, opc_astore, opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3, opc_aswizzle, opc_aswrange, opc_athrow, opc_aupdate, opc_baload, opc_bastore, opc_bipush, opc_breakpoint, opc_caload, opc_castore, opc_checkcast, opc_d2f, opc_d2i, opc_d2l, opc_dadd, opc_daload, opc_dastore, opc_dcmpg, opc_dcmpl, opc_dconst_0, opc_dconst_1, opc_ddiv, opc_dload, opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3, opc_dmul, opc_dneg, opc_drem, opc_dreturn, opc_dstore, opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3, opc_dsub, opc_dup, opc_dup_x1, opc_dup_x2, opc_dup2, opc_dup2_x1, opc_dup2_x2, opc_f2d, opc_f2i, opc_f2l, opc_fadd, opc_faload, opc_fastore, opc_fcmpg, opc_fcmpl, opc_fconst_0, opc_fconst_1, opc_fconst_2, opc_fdiv, opc_fload, opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3, opc_fmul, opc_fneg, opc_frem, opc_freturn, opc_fstore, opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3, opc_fsub, opc_getfield, opc_getstatic, opc_goto, opc_goto_w, opc_i2b, opc_i2c, opc_i2d, opc_i2f, opc_i2l, opc_i2s, opc_iadd, opc_iaload, opc_iand, opc_iastore, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5, opc_iconst_m1, opc_idiv, opc_if_acmpeq, opc_if_acmpne, opc_if_icmpeq, opc_if_icmpge, opc_if_icmpgt, opc_if_icmple, opc_if_icmplt, opc_if_icmpne, opc_ifeq, opc_ifge, opc_ifgt, opc_ifle, opc_iflt, opc_ifne, opc_ifnonnull, opc_ifnull, opc_iinc, opc_iload, opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3, opc_imul, opc_ineg, opc_instanceof, opc_invokeinterface, opc_invokespecial, opc_invokestatic, opc_invokevirtual, opc_ior, opc_irem, opc_ireturn, opc_ishl, opc_ishr, opc_istore, opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3, opc_isub, opc_iushr, opc_ixor, opc_jsr, opc_jsr_w, opc_l2d, opc_l2f, opc_l2i, opc_ladd, opc_laload, opc_land, opc_lastore, opc_lcmp, opc_lconst_0, opc_lconst_1, opc_ldc, opc_ldc_w, opc_ldc2_w, opc_ldiv, opc_lload, opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3, opc_lmul, opc_lneg, opc_lookupswitch, opc_lor, opc_lrem, opc_lreturn, opc_lshl, opc_lshr, opc_lstore, opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3, opc_lsub, opc_lushr, opc_lxor, opc_monitorenter, opc_monitorexit, opc_multianewarray, opc_new, opc_newarray, opc_nop, opc_pop, opc_pop2, opc_putfield, opc_putfield_nowb, opc_putstatic, opc_putstatic_nowb, opc_rc, opc_ret, opc_return, opc_saload, opc_sastore, opc_sipush, opc_supdate, opc_swap, opc_tableswitch, opc_wide, opc_xxxunusedxxx, opcNames, opcSize, opcx_aaload, opcx_aastore, opcx_aload, opcx_areturn, opcx_arraylength, opcx_astore, opcx_aswizzle, opcx_aswrange, opcx_athrow, opcx_aupdate, opcx_baload, opcx_bastore, opcx_caload, opcx_castore, opcx_checkcast, opcx_d2f, opcx_d2i, opcx_d2l, opcx_dadd, opcx_daload, opcx_dastore, opcx_dcmpg, opcx_dcmpl, opcx_ddiv, opcx_dload, opcx_dmul, opcx_dneg, opcx_drem, opcx_dreturn, opcx_dstore, opcx_dsub, opcx_dup, opcx_dup_x1, opcx_dup_x2, opcx_dup2, opcx_dup2_x1, opcx_dup2_x2, opcx_f2d, opcx_f2i, opcx_f2l, opcx_fadd, opcx_faload, opcx_fastore, opcx_fcmpg, opcx_fcmpl, opcx_fdiv, opcx_fload, opcx_fmul, opcx_fneg, opcx_frem, opcx_freturn, opcx_fstore, opcx_fsub, opcx_getfield, opcx_getstatic, opcx_goto, opcx_i2b, opcx_i2c, opcx_i2d, opcx_i2f, opcx_i2l, opcx_i2s, opcx_iadd, opcx_iaload, opcx_iand, opcx_iastore, opcx_idiv, opcx_if_acmpeq, opcx_if_acmpne, opcx_if_icmpeq, opcx_if_icmpge, opcx_if_icmpgt, opcx_if_icmple, opcx_if_icmplt, opcx_if_icmpne, opcx_ifeq, opcx_ifge, opcx_ifgt, opcx_ifle, opcx_iflt, opcx_ifne, opcx_ifnonnull, opcx_ifnull, opcx_iinc, opcx_iload, opcx_imul, opcx_ineg, opcx_instanceof, opcx_invokeinterface, opcx_invokespecial, opcx_invokestatic, opcx_invokevirtual, opcx_ior, opcx_irem, opcx_ireturn, opcx_ishl, opcx_ishr, opcx_istore, opcx_isub, opcx_iushr, opcx_ixor, opcx_jsr, opcx_l2d, opcx_l2f, opcx_l2i, opcx_ladd, opcx_laload, opcx_land, opcx_lastore, opcx_lcmp, opcx_ldc, opcx_ldiv, opcx_lload, opcx_lmul, opcx_lneg, opcx_lor, opcx_lrem, opcx_lreturn, opcx_lshl, opcx_lshr, opcx_lstore, opcx_lsub, opcx_lushr, opcx_lxor, opcx_monitorenter, opcx_monitorexit, opcx_multianewarray, opcx_new, opcx_newarray, opcx_nop, opcx_pop, opcx_pop2, opcx_putfield, opcx_putfield_nowb, opcx_putstatic, opcx_putstatic_nowb, opcx_rc, opcx_ret, opcx_return, opcx_saload, opcx_sastore, opcx_supdate, opcx_swap, opcx_switch, opcXMap, VARIABLE
-
-
Constructor Summary
Constructors Constructor Description Tree(Block block, OperandStack predStack)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInstruction(Instruction inst)Adds an instruction that does not change the control flow (a normal instruction).voidaddInstruction(Instruction inst, Block next)Adds an instruction that jumps to another basic block.voidaddInstruction(Instruction inst, Subroutine sub)Add an instruction such as ret or astore that may involve a subroutine.voidaddLabel(Label label)Add a label to the statement list.voidaddStmt(Stmt stmt)Save the contents of the stack and add stmt to the statement list.voidaddStmtAfter(Stmt stmt, Stmt after)Inserts a statement into the statement list after another given statement.voidaddStmtBefore(Stmt stmt, Stmt before)Inserts a statement into the statement list before a specified statement.voidaddStmtBeforeJump(Stmt stmt)Adds a statement to the statement list before the last jump statement.Blockblock()Returns the basic block in which this Node resides.voidcleanupOnly()Cleans up this node.voidinitLocals(java.util.Collection locals)Add a Collection of local variables to the block.StmtlastStmt()Returns the last non-Label statement in the statement list.LocalExprnewLocal(int index, Type type)Returns a new LocalExpr that is not allocated on the stack.LocalExprnewLocal(Type type)Returns a local variable (LocalExpr) located in this method.StackExprnewStack(Type type)Returns a new StackExpr for the top of the operand stack.LocalExprnewStackLocal(int index, Type type)Returns a new LocalExpr that represents an element of the stack.Nodeparent()voidprependStmt(Stmt stmt)Add an statement to the statement list before the first non-Label statement.voidremoveLastStmt()Removes the last non-Label statement from the statement list.voidremoveStmt(Stmt stmt)Removes a statement from the statement list.OperandStackstack()Returns the operand stack.java.util.Liststmts()java.lang.StringtoString()Returns a String representation of this Tree.voidvisit(TreeVisitor visitor)voidvisit_aaload(Instruction inst)voidvisit_aastore(Instruction inst)voidvisit_aload(Instruction inst)voidvisit_areturn(Instruction inst)voidvisit_arraylength(Instruction inst)Pushes an ArrayLengthExpr onto the operand stack.voidvisit_astore(Instruction inst)Visit an astore instruction.voidvisit_aswizzle(Instruction inst)Add a SCStmt to the statement listvoidvisit_aswrange(Instruction inst)Add a SRStmt to the statement list.voidvisit_athrow(Instruction inst)Adds a ThrowStmt to the statement list.voidvisit_aupdate(Instruction inst)voidvisit_baload(Instruction inst)voidvisit_bastore(Instruction inst)voidvisit_caload(Instruction inst)voidvisit_castore(Instruction inst)voidvisit_checkcast(Instruction inst)Pushes a CastExpr onto the operand stack.voidvisit_d2f(Instruction inst)voidvisit_d2i(Instruction inst)voidvisit_d2l(Instruction inst)voidvisit_dadd(Instruction inst)voidvisit_daload(Instruction inst)voidvisit_dastore(Instruction inst)voidvisit_dcmpg(Instruction inst)voidvisit_dcmpl(Instruction inst)voidvisit_ddiv(Instruction inst)voidvisit_dload(Instruction inst)voidvisit_dmul(Instruction inst)voidvisit_dneg(Instruction inst)voidvisit_drem(Instruction inst)voidvisit_dreturn(Instruction inst)voidvisit_dstore(Instruction inst)voidvisit_dsub(Instruction inst)voidvisit_dup(Instruction inst)When processing the dup instructions one of two situations can occur.voidvisit_dup_x1(Instruction inst)voidvisit_dup_x2(Instruction inst)voidvisit_dup2(Instruction inst)voidvisit_dup2_x1(Instruction inst)voidvisit_dup2_x2(Instruction inst)voidvisit_f2d(Instruction inst)voidvisit_f2i(Instruction inst)voidvisit_f2l(Instruction inst)voidvisit_fadd(Instruction inst)voidvisit_faload(Instruction inst)voidvisit_fastore(Instruction inst)voidvisit_fcmpg(Instruction inst)voidvisit_fcmpl(Instruction inst)voidvisit_fdiv(Instruction inst)voidvisit_fload(Instruction inst)voidvisit_fmul(Instruction inst)voidvisit_fneg(Instruction inst)voidvisit_frem(Instruction inst)voidvisit_freturn(Instruction inst)voidvisit_fstore(Instruction inst)voidvisit_fsub(Instruction inst)voidvisit_getfield(Instruction inst)Pushes a FieldExpr onto the operand stack.voidvisit_getstatic(Instruction inst)Pushes a StaticFieldExpr onto the operand stack.voidvisit_goto(Instruction inst)Adds a GotoStmt to the statement list.voidvisit_i2b(Instruction inst)voidvisit_i2c(Instruction inst)voidvisit_i2d(Instruction inst)voidvisit_i2f(Instruction inst)voidvisit_i2l(Instruction inst)All cast visitors push a CastExpr onto the operand stack.voidvisit_i2s(Instruction inst)voidvisit_iadd(Instruction inst)All visit_xadd, visit_xsub, visit_xmul, visit_xdiv, etc.voidvisit_iaload(Instruction inst)All visit_xaload push an ArrayRefExpr onto the operand stack.voidvisit_iand(Instruction inst)All visit_x op push an ArithExpr onto the stack.voidvisit_iastore(Instruction inst)voidvisit_idiv(Instruction inst)voidvisit_if_acmpeq(Instruction inst)voidvisit_if_acmpne(Instruction inst)voidvisit_if_icmpeq(Instruction inst)All visit_if_xcmpy add a IfCmpStmt to the statement list.voidvisit_if_icmpge(Instruction inst)voidvisit_if_icmpgt(Instruction inst)voidvisit_if_icmple(Instruction inst)voidvisit_if_icmplt(Instruction inst)voidvisit_if_icmpne(Instruction inst)voidvisit_ifeq(Instruction inst)All visit_xeg add an IfZeroStmt to the statement list.voidvisit_ifge(Instruction inst)voidvisit_ifgt(Instruction inst)voidvisit_ifle(Instruction inst)voidvisit_iflt(Instruction inst)voidvisit_ifne(Instruction inst)voidvisit_ifnonnull(Instruction inst)voidvisit_ifnull(Instruction inst)Both visit_xnull add an IfZeroStmt to the statement list.voidvisit_iinc(Instruction inst)Visiting an iinc involves creating a ConstantExpr, LocalExpr, ArithExpr StoreExpr, and a ExprStmt.voidvisit_iload(Instruction inst)All visit_xload push a LocalExpr onto the operand stack.voidvisit_imul(Instruction inst)voidvisit_ineg(Instruction inst)All visit_xneg push a NegExpr onto the stack.voidvisit_instanceof(Instruction inst)Pushes an InstanceOfExpr onto the operand stack.voidvisit_invokeinterface(Instruction inst)voidvisit_invokespecial(Instruction inst)voidvisit_invokestatic(Instruction inst)voidvisit_invokevirtual(Instruction inst)All visit_invokex deal with a CallMethodExpr or a CallStaticExpr.voidvisit_ior(Instruction inst)voidvisit_irem(Instruction inst)voidvisit_ireturn(Instruction inst)All visit_xreturn add a ReturnExprStmt to the statement list.voidvisit_ishl(Instruction inst)All visit_xshd push a ShiftExpr onto the operand stack.voidvisit_ishr(Instruction inst)voidvisit_istore(Instruction inst)All visit_xstore add a LocalExpr statement to the statement list.voidvisit_isub(Instruction inst)voidvisit_iushr(Instruction inst)voidvisit_ixor(Instruction inst)voidvisit_jsr(Instruction inst)Adds a JsrStmt to the statement list.voidvisit_l2d(Instruction inst)voidvisit_l2f(Instruction inst)voidvisit_l2i(Instruction inst)voidvisit_ladd(Instruction inst)voidvisit_laload(Instruction inst)voidvisit_land(Instruction inst)voidvisit_lastore(Instruction inst)voidvisit_lcmp(Instruction inst)All visit_xcmp push an ArithExpr onto the stack.voidvisit_ldc(Instruction inst)Pushes a ConstantExpr onto the operand stack.voidvisit_ldiv(Instruction inst)voidvisit_lload(Instruction inst)voidvisit_lmul(Instruction inst)voidvisit_lneg(Instruction inst)voidvisit_lor(Instruction inst)voidvisit_lrem(Instruction inst)voidvisit_lreturn(Instruction inst)voidvisit_lshl(Instruction inst)voidvisit_lshr(Instruction inst)voidvisit_lstore(Instruction inst)voidvisit_lsub(Instruction inst)voidvisit_lushr(Instruction inst)voidvisit_lxor(Instruction inst)voidvisit_monitorenter(Instruction inst)Both monitor visitors add a MonitorStmt to the statement list.voidvisit_monitorexit(Instruction inst)voidvisit_multianewarray(Instruction inst)Push a NewMultiArrayExpr onto the operand stack.voidvisit_new(Instruction inst)Pushes a NewExpr onto the operand stack.voidvisit_newarray(Instruction inst)Pushes a NewArrayExpr onto the operand stack.voidvisit_nop(Instruction inst)Adds no statements to the statement list.voidvisit_pop(Instruction inst)Pop the expression off the top of the stack and add it as an ExprStmt to the statement list.voidvisit_pop2(Instruction inst)voidvisit_putfield(Instruction inst)voidvisit_putfield_nowb(Instruction inst)voidvisit_putstatic(Instruction inst)voidvisit_putstatic_nowb(Instruction inst)voidvisit_rc(Instruction inst)Replaces the expression on the top of the stack with an RCExpr.voidvisit_ret(Instruction inst)Adds a RetStmt to the statement list.voidvisit_return(Instruction inst)Adds a ReturnStmt to the statement list.voidvisit_saload(Instruction inst)voidvisit_sastore(Instruction inst)voidvisit_supdate(Instruction inst)Replace the expression at the stack depth specified in the instruction with a UCExpr.voidvisit_swap(Instruction inst)voidvisit_switch(Instruction inst)Add a SwitchStmt to the statement list.voidvisitForceChildren(TreeVisitor visitor)Visit all the statements in the statement list.-
Methods inherited from class EDU.purdue.cs.bloat.tree.Node
cleanup, copyInto, hasParent, key, replaceWith, replaceWith, setKey, setParent, setValueNumber, valueNumber, visitChildren, visitOnly
-
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
-
FLATTEN
public static boolean FLATTEN
-
USE_STACK
public static boolean USE_STACK
-
AUPDATE_FIX_HACK
public static boolean AUPDATE_FIX_HACK
-
AUPDATE_FIX_HACK_CHANGED
public static boolean AUPDATE_FIX_HACK_CHANGED
-
USE_PERSISTENT
public static boolean USE_PERSISTENT
-
-
Constructor Detail
-
Tree
public Tree(Block block, OperandStack predStack)
Constructor.- Parameters:
block- The basic Block of code represented in this Tree.predStack- The contents of the operand stack from the previous basic Block.
-
-
Method Detail
-
cleanupOnly
public void cleanupOnly()
Cleans up this node. Does nothing in this case.- Specified by:
cleanupOnlyin classNode
-
initLocals
public void initLocals(java.util.Collection locals)
Add a Collection of local variables to the block. Add an InitStmt to the statement list.
-
removeStmt
public void removeStmt(Stmt stmt)
Removes a statement from the statement list.- Parameters:
stmt- The statement to remove
-
removeLastStmt
public void removeLastStmt()
Removes the last non-Label statement from the statement list.
-
stmts
public java.util.List stmts()
- Returns:
- The statement list
-
lastStmt
public Stmt lastStmt()
Returns the last non-Label statement in the statement list.
-
stack
public OperandStack stack()
Returns the operand stack.
-
addStmtAfter
public void addStmtAfter(Stmt stmt, Stmt after)
Inserts a statement into the statement list after another given statement.- Parameters:
stmt- The statement to add.after- The statement after which to add stmt.
-
addStmtBefore
public void addStmtBefore(Stmt stmt, Stmt before)
Inserts a statement into the statement list before a specified statement.- Parameters:
stmt- The statement to insertbefore- The statement before which to add stmt.
-
prependStmt
public void prependStmt(Stmt stmt)
Add an statement to the statement list before the first non-Label statement.- Parameters:
stmt- The statement to add.
-
addStmt
public void addStmt(Stmt stmt)
Save the contents of the stack and add stmt to the statement list.- Parameters:
stmt- A statement to add to the statement list.
-
addStmtBeforeJump
public void addStmtBeforeJump(Stmt stmt)
Adds a statement to the statement list before the last jump statement. It is assumed that the last statement in the statement list is a jump statement.- See Also:
JumpStmt
-
addInstruction
public void addInstruction(Instruction inst, Block next)
Adds an instruction that jumps to another basic block.- Parameters:
inst- The instruction to add.next- The basic block after the jump. Remember that a jump ends a basic block.- See Also:
Instruction.isJsr(),Instruction.isConditionalJump()
-
addInstruction
public void addInstruction(Instruction inst)
Adds an instruction that does not change the control flow (a normal instruction).- Parameters:
inst- Instruction to add.
-
addInstruction
public void addInstruction(Instruction inst, Subroutine sub)
Add an instruction such as ret or astore that may involve a subroutine.- Parameters:
inst- Instruction to add.sub- Subroutine in which inst resides. The ret instruction always resides in a Subroutine. An astore may store the return address of a subroutine in a local variable.- See Also:
Instruction.isRet()
-
addLabel
public void addLabel(Label label)
Add a label to the statement list. A label is inserted before a dup statement, but after any other statement.- Parameters:
label- Label to add.
-
newStack
public StackExpr newStack(Type type)
Returns a new StackExpr for the top of the operand stack.
-
newStackLocal
public LocalExpr newStackLocal(int index, Type type)
Returns a new LocalExpr that represents an element of the stack. They are created when the USE_STACK flag is not set.- Parameters:
index- Stack index of variable.type- The type of the LocalExpr
-
newLocal
public LocalExpr newLocal(int index, Type type)
Returns a new LocalExpr that is not allocated on the stack.- Parameters:
index- Stack index of variable.type- The type of the LocalExpr
-
newLocal
public LocalExpr newLocal(Type type)
Returns a local variable (LocalExpr) located in this method.- Parameters:
type- The type of the new LocalExpr.
-
toString
public java.lang.String toString()
Returns a String representation of this Tree.
-
visit_nop
public void visit_nop(Instruction inst)
Adds no statements to the statement list.- Specified by:
visit_nopin interfaceInstructionVisitor
-
visit_ldc
public void visit_ldc(Instruction inst)
Pushes a ConstantExpr onto the operand stack.- Specified by:
visit_ldcin interfaceInstructionVisitor- See Also:
ConstantExpr
-
visit_iload
public void visit_iload(Instruction inst)
All visit_xload push a LocalExpr onto the operand stack.- Specified by:
visit_iloadin interfaceInstructionVisitor- See Also:
LocalExpr
-
visit_lload
public void visit_lload(Instruction inst)
- Specified by:
visit_lloadin interfaceInstructionVisitor
-
visit_fload
public void visit_fload(Instruction inst)
- Specified by:
visit_floadin interfaceInstructionVisitor
-
visit_dload
public void visit_dload(Instruction inst)
- Specified by:
visit_dloadin interfaceInstructionVisitor
-
visit_aload
public void visit_aload(Instruction inst)
- Specified by:
visit_aloadin interfaceInstructionVisitor
-
visit_iaload
public void visit_iaload(Instruction inst)
All visit_xaload push an ArrayRefExpr onto the operand stack.- Specified by:
visit_ialoadin interfaceInstructionVisitor
-
visit_laload
public void visit_laload(Instruction inst)
- Specified by:
visit_laloadin interfaceInstructionVisitor
-
visit_faload
public void visit_faload(Instruction inst)
- Specified by:
visit_faloadin interfaceInstructionVisitor
-
visit_daload
public void visit_daload(Instruction inst)
- Specified by:
visit_daloadin interfaceInstructionVisitor
-
visit_aaload
public void visit_aaload(Instruction inst)
- Specified by:
visit_aaloadin interfaceInstructionVisitor
-
visit_baload
public void visit_baload(Instruction inst)
- Specified by:
visit_baloadin interfaceInstructionVisitor
-
visit_caload
public void visit_caload(Instruction inst)
- Specified by:
visit_caloadin interfaceInstructionVisitor
-
visit_saload
public void visit_saload(Instruction inst)
- Specified by:
visit_saloadin interfaceInstructionVisitor
-
visit_istore
public void visit_istore(Instruction inst)
All visit_xstore add a LocalExpr statement to the statement list.- Specified by:
visit_istorein interfaceInstructionVisitor
-
visit_lstore
public void visit_lstore(Instruction inst)
- Specified by:
visit_lstorein interfaceInstructionVisitor
-
visit_fstore
public void visit_fstore(Instruction inst)
- Specified by:
visit_fstorein interfaceInstructionVisitor
-
visit_dstore
public void visit_dstore(Instruction inst)
- Specified by:
visit_dstorein interfaceInstructionVisitor
-
visit_astore
public void visit_astore(Instruction inst)
Visit an astore instruction. If the type of the operand to the instruction is an address add an AddressStoreStmt to the tree, else add a StoreStmt to the tree consisting of a LocalExpr and the top Expr on the operand stack.- Specified by:
visit_astorein interfaceInstructionVisitor- See Also:
AddressStoreStmt,LocalExpr,StoreExpr
-
visit_iastore
public void visit_iastore(Instruction inst)
- Specified by:
visit_iastorein interfaceInstructionVisitor
-
visit_lastore
public void visit_lastore(Instruction inst)
- Specified by:
visit_lastorein interfaceInstructionVisitor
-
visit_fastore
public void visit_fastore(Instruction inst)
- Specified by:
visit_fastorein interfaceInstructionVisitor
-
visit_dastore
public void visit_dastore(Instruction inst)
- Specified by:
visit_dastorein interfaceInstructionVisitor
-
visit_aastore
public void visit_aastore(Instruction inst)
- Specified by:
visit_aastorein interfaceInstructionVisitor
-
visit_bastore
public void visit_bastore(Instruction inst)
- Specified by:
visit_bastorein interfaceInstructionVisitor
-
visit_castore
public void visit_castore(Instruction inst)
- Specified by:
visit_castorein interfaceInstructionVisitor
-
visit_sastore
public void visit_sastore(Instruction inst)
- Specified by:
visit_sastorein interfaceInstructionVisitor
-
visit_pop
public void visit_pop(Instruction inst)
Pop the expression off the top of the stack and add it as an ExprStmt to the statement list.- Specified by:
visit_popin interfaceInstructionVisitor- See Also:
ExprStmt
-
visit_pop2
public void visit_pop2(Instruction inst)
- Specified by:
visit_pop2in interfaceInstructionVisitor
-
visit_dup
public void visit_dup(Instruction inst)
When processing the dup instructions one of two situations can occur. If the USE_STACK flag is set, then a StackManipStmt is created to represent the transformation that the dup instruction performs on the stack. If the USE_STACK flag is not set, then the transformation is simulated by creating new local variables containing the appropriate element of the stack.- Specified by:
visit_dupin interfaceInstructionVisitor- See Also:
LocalExpr,StackExpr,StackManipStmt
-
visit_dup_x1
public void visit_dup_x1(Instruction inst)
- Specified by:
visit_dup_x1in interfaceInstructionVisitor
-
visit_dup_x2
public void visit_dup_x2(Instruction inst)
- Specified by:
visit_dup_x2in interfaceInstructionVisitor
-
visit_dup2
public void visit_dup2(Instruction inst)
- Specified by:
visit_dup2in interfaceInstructionVisitor
-
visit_dup2_x1
public void visit_dup2_x1(Instruction inst)
- Specified by:
visit_dup2_x1in interfaceInstructionVisitor
-
visit_dup2_x2
public void visit_dup2_x2(Instruction inst)
- Specified by:
visit_dup2_x2in interfaceInstructionVisitor
-
visit_swap
public void visit_swap(Instruction inst)
- Specified by:
visit_swapin interfaceInstructionVisitor
-
visit_iadd
public void visit_iadd(Instruction inst)
All visit_xadd, visit_xsub, visit_xmul, visit_xdiv, etc. push an ArithExpr onto the operand stack.- Specified by:
visit_iaddin interfaceInstructionVisitor- See Also:
ArithExpr
-
visit_ladd
public void visit_ladd(Instruction inst)
- Specified by:
visit_laddin interfaceInstructionVisitor
-
visit_fadd
public void visit_fadd(Instruction inst)
- Specified by:
visit_faddin interfaceInstructionVisitor
-
visit_dadd
public void visit_dadd(Instruction inst)
- Specified by:
visit_daddin interfaceInstructionVisitor
-
visit_isub
public void visit_isub(Instruction inst)
- Specified by:
visit_isubin interfaceInstructionVisitor
-
visit_lsub
public void visit_lsub(Instruction inst)
- Specified by:
visit_lsubin interfaceInstructionVisitor
-
visit_fsub
public void visit_fsub(Instruction inst)
- Specified by:
visit_fsubin interfaceInstructionVisitor
-
visit_dsub
public void visit_dsub(Instruction inst)
- Specified by:
visit_dsubin interfaceInstructionVisitor
-
visit_imul
public void visit_imul(Instruction inst)
- Specified by:
visit_imulin interfaceInstructionVisitor
-
visit_lmul
public void visit_lmul(Instruction inst)
- Specified by:
visit_lmulin interfaceInstructionVisitor
-
visit_fmul
public void visit_fmul(Instruction inst)
- Specified by:
visit_fmulin interfaceInstructionVisitor
-
visit_dmul
public void visit_dmul(Instruction inst)
- Specified by:
visit_dmulin interfaceInstructionVisitor
-
visit_idiv
public void visit_idiv(Instruction inst)
- Specified by:
visit_idivin interfaceInstructionVisitor
-
visit_ldiv
public void visit_ldiv(Instruction inst)
- Specified by:
visit_ldivin interfaceInstructionVisitor
-
visit_fdiv
public void visit_fdiv(Instruction inst)
- Specified by:
visit_fdivin interfaceInstructionVisitor
-
visit_ddiv
public void visit_ddiv(Instruction inst)
- Specified by:
visit_ddivin interfaceInstructionVisitor
-
visit_irem
public void visit_irem(Instruction inst)
- Specified by:
visit_iremin interfaceInstructionVisitor
-
visit_lrem
public void visit_lrem(Instruction inst)
- Specified by:
visit_lremin interfaceInstructionVisitor
-
visit_frem
public void visit_frem(Instruction inst)
- Specified by:
visit_fremin interfaceInstructionVisitor
-
visit_drem
public void visit_drem(Instruction inst)
- Specified by:
visit_dremin interfaceInstructionVisitor
-
visit_ineg
public void visit_ineg(Instruction inst)
All visit_xneg push a NegExpr onto the stack.- Specified by:
visit_inegin interfaceInstructionVisitor- See Also:
NegExpr
-
visit_lneg
public void visit_lneg(Instruction inst)
- Specified by:
visit_lnegin interfaceInstructionVisitor
-
visit_fneg
public void visit_fneg(Instruction inst)
- Specified by:
visit_fnegin interfaceInstructionVisitor
-
visit_dneg
public void visit_dneg(Instruction inst)
- Specified by:
visit_dnegin interfaceInstructionVisitor
-
visit_ishl
public void visit_ishl(Instruction inst)
All visit_xshd push a ShiftExpr onto the operand stack.- Specified by:
visit_ishlin interfaceInstructionVisitor- See Also:
ShiftExpr
-
visit_lshl
public void visit_lshl(Instruction inst)
- Specified by:
visit_lshlin interfaceInstructionVisitor
-
visit_ishr
public void visit_ishr(Instruction inst)
- Specified by:
visit_ishrin interfaceInstructionVisitor
-
visit_lshr
public void visit_lshr(Instruction inst)
- Specified by:
visit_lshrin interfaceInstructionVisitor
-
visit_iushr
public void visit_iushr(Instruction inst)
- Specified by:
visit_iushrin interfaceInstructionVisitor
-
visit_lushr
public void visit_lushr(Instruction inst)
- Specified by:
visit_lushrin interfaceInstructionVisitor
-
visit_iand
public void visit_iand(Instruction inst)
All visit_x op push an ArithExpr onto the stack.- Specified by:
visit_iandin interfaceInstructionVisitor- See Also:
ArithExpr
-
visit_land
public void visit_land(Instruction inst)
- Specified by:
visit_landin interfaceInstructionVisitor
-
visit_ior
public void visit_ior(Instruction inst)
- Specified by:
visit_iorin interfaceInstructionVisitor
-
visit_lor
public void visit_lor(Instruction inst)
- Specified by:
visit_lorin interfaceInstructionVisitor
-
visit_ixor
public void visit_ixor(Instruction inst)
- Specified by:
visit_ixorin interfaceInstructionVisitor
-
visit_lxor
public void visit_lxor(Instruction inst)
- Specified by:
visit_lxorin interfaceInstructionVisitor
-
visit_iinc
public void visit_iinc(Instruction inst)
Visiting an iinc involves creating a ConstantExpr, LocalExpr, ArithExpr StoreExpr, and a ExprStmt.- Specified by:
visit_iincin interfaceInstructionVisitor
-
visit_i2l
public void visit_i2l(Instruction inst)
All cast visitors push a CastExpr onto the operand stack.- Specified by:
visit_i2lin interfaceInstructionVisitor
-
visit_i2f
public void visit_i2f(Instruction inst)
- Specified by:
visit_i2fin interfaceInstructionVisitor
-
visit_i2d
public void visit_i2d(Instruction inst)
- Specified by:
visit_i2din interfaceInstructionVisitor
-
visit_l2i
public void visit_l2i(Instruction inst)
- Specified by:
visit_l2iin interfaceInstructionVisitor
-
visit_l2f
public void visit_l2f(Instruction inst)
- Specified by:
visit_l2fin interfaceInstructionVisitor
-
visit_l2d
public void visit_l2d(Instruction inst)
- Specified by:
visit_l2din interfaceInstructionVisitor
-
visit_f2i
public void visit_f2i(Instruction inst)
- Specified by:
visit_f2iin interfaceInstructionVisitor
-
visit_f2l
public void visit_f2l(Instruction inst)
- Specified by:
visit_f2lin interfaceInstructionVisitor
-
visit_f2d
public void visit_f2d(Instruction inst)
- Specified by:
visit_f2din interfaceInstructionVisitor
-
visit_d2i
public void visit_d2i(Instruction inst)
- Specified by:
visit_d2iin interfaceInstructionVisitor
-
visit_d2l
public void visit_d2l(Instruction inst)
- Specified by:
visit_d2lin interfaceInstructionVisitor
-
visit_d2f
public void visit_d2f(Instruction inst)
- Specified by:
visit_d2fin interfaceInstructionVisitor
-
visit_i2b
public void visit_i2b(Instruction inst)
- Specified by:
visit_i2bin interfaceInstructionVisitor
-
visit_i2c
public void visit_i2c(Instruction inst)
- Specified by:
visit_i2cin interfaceInstructionVisitor
-
visit_i2s
public void visit_i2s(Instruction inst)
- Specified by:
visit_i2sin interfaceInstructionVisitor
-
visit_lcmp
public void visit_lcmp(Instruction inst)
All visit_xcmp push an ArithExpr onto the stack.- Specified by:
visit_lcmpin interfaceInstructionVisitor- See Also:
ArithExpr
-
visit_fcmpl
public void visit_fcmpl(Instruction inst)
- Specified by:
visit_fcmplin interfaceInstructionVisitor
-
visit_fcmpg
public void visit_fcmpg(Instruction inst)
- Specified by:
visit_fcmpgin interfaceInstructionVisitor
-
visit_dcmpl
public void visit_dcmpl(Instruction inst)
- Specified by:
visit_dcmplin interfaceInstructionVisitor
-
visit_dcmpg
public void visit_dcmpg(Instruction inst)
- Specified by:
visit_dcmpgin interfaceInstructionVisitor
-
visit_ifeq
public void visit_ifeq(Instruction inst)
All visit_xeg add an IfZeroStmt to the statement list.- Specified by:
visit_ifeqin interfaceInstructionVisitor- See Also:
IfZeroStmt
-
visit_ifne
public void visit_ifne(Instruction inst)
- Specified by:
visit_ifnein interfaceInstructionVisitor
-
visit_iflt
public void visit_iflt(Instruction inst)
- Specified by:
visit_ifltin interfaceInstructionVisitor
-
visit_ifge
public void visit_ifge(Instruction inst)
- Specified by:
visit_ifgein interfaceInstructionVisitor
-
visit_ifgt
public void visit_ifgt(Instruction inst)
- Specified by:
visit_ifgtin interfaceInstructionVisitor
-
visit_ifle
public void visit_ifle(Instruction inst)
- Specified by:
visit_iflein interfaceInstructionVisitor
-
visit_if_icmpeq
public void visit_if_icmpeq(Instruction inst)
All visit_if_xcmpy add a IfCmpStmt to the statement list.- Specified by:
visit_if_icmpeqin interfaceInstructionVisitor
-
visit_if_icmpne
public void visit_if_icmpne(Instruction inst)
- Specified by:
visit_if_icmpnein interfaceInstructionVisitor
-
visit_if_icmplt
public void visit_if_icmplt(Instruction inst)
- Specified by:
visit_if_icmpltin interfaceInstructionVisitor
-
visit_if_icmpge
public void visit_if_icmpge(Instruction inst)
- Specified by:
visit_if_icmpgein interfaceInstructionVisitor
-
visit_if_icmpgt
public void visit_if_icmpgt(Instruction inst)
- Specified by:
visit_if_icmpgtin interfaceInstructionVisitor
-
visit_if_icmple
public void visit_if_icmple(Instruction inst)
- Specified by:
visit_if_icmplein interfaceInstructionVisitor
-
visit_if_acmpeq
public void visit_if_acmpeq(Instruction inst)
- Specified by:
visit_if_acmpeqin interfaceInstructionVisitor
-
visit_if_acmpne
public void visit_if_acmpne(Instruction inst)
- Specified by:
visit_if_acmpnein interfaceInstructionVisitor
-
visit_goto
public void visit_goto(Instruction inst)
Adds a GotoStmt to the statement list.- Specified by:
visit_gotoin interfaceInstructionVisitor- See Also:
GotoStmt
-
visit_jsr
public void visit_jsr(Instruction inst)
Adds a JsrStmt to the statement list.- Specified by:
visit_jsrin interfaceInstructionVisitor- See Also:
JsrStmt
-
visit_ret
public void visit_ret(Instruction inst)
Adds a RetStmt to the statement list.- Specified by:
visit_retin interfaceInstructionVisitor- See Also:
RetStmt
-
visit_switch
public void visit_switch(Instruction inst)
Add a SwitchStmt to the statement list.- Specified by:
visit_switchin interfaceInstructionVisitor- See Also:
SwitchStmt
-
visit_ireturn
public void visit_ireturn(Instruction inst)
All visit_xreturn add a ReturnExprStmt to the statement list.- Specified by:
visit_ireturnin interfaceInstructionVisitor- See Also:
ReturnExprStmt
-
visit_lreturn
public void visit_lreturn(Instruction inst)
- Specified by:
visit_lreturnin interfaceInstructionVisitor
-
visit_freturn
public void visit_freturn(Instruction inst)
- Specified by:
visit_freturnin interfaceInstructionVisitor
-
visit_dreturn
public void visit_dreturn(Instruction inst)
- Specified by:
visit_dreturnin interfaceInstructionVisitor
-
visit_areturn
public void visit_areturn(Instruction inst)
- Specified by:
visit_areturnin interfaceInstructionVisitor
-
visit_return
public void visit_return(Instruction inst)
Adds a ReturnStmt to the statement list.- Specified by:
visit_returnin interfaceInstructionVisitor
-
visit_getstatic
public void visit_getstatic(Instruction inst)
Pushes a StaticFieldExpr onto the operand stack.- Specified by:
visit_getstaticin interfaceInstructionVisitor
-
visit_putstatic
public void visit_putstatic(Instruction inst)
- Specified by:
visit_putstaticin interfaceInstructionVisitor
-
visit_putstatic_nowb
public void visit_putstatic_nowb(Instruction inst)
- Specified by:
visit_putstatic_nowbin interfaceInstructionVisitor
-
visit_getfield
public void visit_getfield(Instruction inst)
Pushes a FieldExpr onto the operand stack.- Specified by:
visit_getfieldin interfaceInstructionVisitor
-
visit_putfield
public void visit_putfield(Instruction inst)
- Specified by:
visit_putfieldin interfaceInstructionVisitor
-
visit_putfield_nowb
public void visit_putfield_nowb(Instruction inst)
- Specified by:
visit_putfield_nowbin interfaceInstructionVisitor
-
visit_invokevirtual
public void visit_invokevirtual(Instruction inst)
All visit_invokex deal with a CallMethodExpr or a CallStaticExpr.- Specified by:
visit_invokevirtualin interfaceInstructionVisitor- See Also:
CallMethodExpr,CallStaticExpr
-
visit_invokespecial
public void visit_invokespecial(Instruction inst)
- Specified by:
visit_invokespecialin interfaceInstructionVisitor
-
visit_invokestatic
public void visit_invokestatic(Instruction inst)
- Specified by:
visit_invokestaticin interfaceInstructionVisitor
-
visit_invokeinterface
public void visit_invokeinterface(Instruction inst)
- Specified by:
visit_invokeinterfacein interfaceInstructionVisitor
-
visit_new
public void visit_new(Instruction inst)
Pushes a NewExpr onto the operand stack.- Specified by:
visit_newin interfaceInstructionVisitor- See Also:
NewExpr
-
visit_newarray
public void visit_newarray(Instruction inst)
Pushes a NewArrayExpr onto the operand stack.- Specified by:
visit_newarrayin interfaceInstructionVisitor
-
visit_arraylength
public void visit_arraylength(Instruction inst)
Pushes an ArrayLengthExpr onto the operand stack.- Specified by:
visit_arraylengthin interfaceInstructionVisitor- See Also:
ArrayLengthExpr
-
visit_athrow
public void visit_athrow(Instruction inst)
Adds a ThrowStmt to the statement list.- Specified by:
visit_athrowin interfaceInstructionVisitor- See Also:
ThrowStmt
-
visit_checkcast
public void visit_checkcast(Instruction inst)
Pushes a CastExpr onto the operand stack.- Specified by:
visit_checkcastin interfaceInstructionVisitor- See Also:
CastExpr
-
visit_instanceof
public void visit_instanceof(Instruction inst)
Pushes an InstanceOfExpr onto the operand stack.- Specified by:
visit_instanceofin interfaceInstructionVisitor- See Also:
InstanceOfExpr
-
visit_monitorenter
public void visit_monitorenter(Instruction inst)
Both monitor visitors add a MonitorStmt to the statement list.- Specified by:
visit_monitorenterin interfaceInstructionVisitor- See Also:
MonitorStmt
-
visit_monitorexit
public void visit_monitorexit(Instruction inst)
- Specified by:
visit_monitorexitin interfaceInstructionVisitor
-
visit_multianewarray
public void visit_multianewarray(Instruction inst)
Push a NewMultiArrayExpr onto the operand stack.- Specified by:
visit_multianewarrayin interfaceInstructionVisitor- See Also:
NewMultiArrayExpr
-
visit_ifnull
public void visit_ifnull(Instruction inst)
Both visit_xnull add an IfZeroStmt to the statement list. ssee IfZeroStmt- Specified by:
visit_ifnullin interfaceInstructionVisitor
-
visit_ifnonnull
public void visit_ifnonnull(Instruction inst)
- Specified by:
visit_ifnonnullin interfaceInstructionVisitor
-
visit_rc
public void visit_rc(Instruction inst)
Replaces the expression on the top of the stack with an RCExpr.- Specified by:
visit_rcin interfaceInstructionVisitor- See Also:
RCExpr
-
visit_aupdate
public void visit_aupdate(Instruction inst)
- Specified by:
visit_aupdatein interfaceInstructionVisitor
-
visit_supdate
public void visit_supdate(Instruction inst)
Replace the expression at the stack depth specified in the instruction with a UCExpr.- Specified by:
visit_supdatein interfaceInstructionVisitor- See Also:
UCExpr
-
visit_aswizzle
public void visit_aswizzle(Instruction inst)
Add a SCStmt to the statement list- Specified by:
visit_aswizzlein interfaceInstructionVisitor- See Also:
SCStmt
-
visit_aswrange
public void visit_aswrange(Instruction inst)
Add a SRStmt to the statement list.- Specified by:
visit_aswrangein interfaceInstructionVisitor- See Also:
SRStmt
-
visitForceChildren
public void visitForceChildren(TreeVisitor visitor)
Visit all the statements in the statement list.- Specified by:
visitForceChildrenin classNode
-
visit
public void visit(TreeVisitor visitor)
-
-