Package soot.toDex
Class StmtVisitor
- java.lang.Object
-
- soot.toDex.StmtVisitor
-
- All Implemented Interfaces:
StmtSwitch,Switch
public class StmtVisitor extends Object implements StmtSwitch
A visitor that builds a list of instructions from the Jimple statements it visits.
UseSwitchable.apply(soot.util.Switch)with this visitor to add statements and#getFinalInsns()to get the final dexlib instructions.
These final instructions do have correct offsets, jump targets and register numbers.- See Also:
intermediate representation of an instruction,final representation of an instruction
-
-
Field Summary
Fields Modifier and Type Field Description protected ConstantVisitorconstantVprotected ExprVisitorexprVprotected RegisterAllocatorregAlloc
-
Constructor Summary
Constructors Constructor Description StmtVisitor(SootMethod belongingMethod, DexArrayInitDetector arrayInitDetector)
-
Method Summary
-
-
-
Field Detail
-
constantV
protected ConstantVisitor constantV
-
regAlloc
protected RegisterAllocator regAlloc
-
exprV
protected ExprVisitor exprV
-
-
Constructor Detail
-
StmtVisitor
public StmtVisitor(SootMethod belongingMethod, DexArrayInitDetector arrayInitDetector)
-
-
Method Detail
-
setLastReturnTypeDescriptor
protected void setLastReturnTypeDescriptor(String typeDescriptor)
-
getBelongingClass
protected SootClass getBelongingClass()
-
getStmtForInstruction
public Stmt getStmtForInstruction(org.jf.dexlib2.iface.instruction.Instruction instruction)
-
getInsnForInstruction
public Insn getInsnForInstruction(org.jf.dexlib2.iface.instruction.Instruction instruction)
-
getInstructionRegisterMap
public Map<org.jf.dexlib2.iface.instruction.Instruction,LocalRegisterAssignmentInformation> getInstructionRegisterMap()
-
getParameterInstructionsList
public List<LocalRegisterAssignmentInformation> getParameterInstructionsList()
-
getInstructionPayloadMap
public Map<org.jf.dexlib2.iface.instruction.Instruction,AbstractPayload> getInstructionPayloadMap()
-
getInstructionCount
public int getInstructionCount()
-
beginNewStmt
protected void beginNewStmt(Stmt s)
-
getRealInsns
public List<org.jf.dexlib2.builder.BuilderInstruction> getRealInsns(LabelAssigner labelAssigner)
-
fakeNewInsn
public void fakeNewInsn(Stmt s, Insn insn, org.jf.dexlib2.iface.instruction.Instruction instruction)
-
getRegisterCount
protected int getRegisterCount()
-
defaultCase
public void defaultCase(Object o)
- Specified by:
defaultCasein interfaceStmtSwitch
-
caseBreakpointStmt
public void caseBreakpointStmt(BreakpointStmt stmt)
- Specified by:
caseBreakpointStmtin interfaceStmtSwitch
-
caseNopStmt
public void caseNopStmt(NopStmt stmt)
- Specified by:
caseNopStmtin interfaceStmtSwitch
-
caseRetStmt
public void caseRetStmt(RetStmt stmt)
- Specified by:
caseRetStmtin interfaceStmtSwitch
-
caseEnterMonitorStmt
public void caseEnterMonitorStmt(EnterMonitorStmt stmt)
- Specified by:
caseEnterMonitorStmtin interfaceStmtSwitch
-
caseExitMonitorStmt
public void caseExitMonitorStmt(ExitMonitorStmt stmt)
- Specified by:
caseExitMonitorStmtin interfaceStmtSwitch
-
caseThrowStmt
public void caseThrowStmt(ThrowStmt stmt)
- Specified by:
caseThrowStmtin interfaceStmtSwitch
-
caseAssignStmt
public void caseAssignStmt(AssignStmt stmt)
- Specified by:
caseAssignStmtin interfaceStmtSwitch
-
caseInvokeStmt
public void caseInvokeStmt(InvokeStmt stmt)
- Specified by:
caseInvokeStmtin interfaceStmtSwitch
-
caseReturnVoidStmt
public void caseReturnVoidStmt(ReturnVoidStmt stmt)
- Specified by:
caseReturnVoidStmtin interfaceStmtSwitch
-
caseReturnStmt
public void caseReturnStmt(ReturnStmt stmt)
- Specified by:
caseReturnStmtin interfaceStmtSwitch
-
caseIdentityStmt
public void caseIdentityStmt(IdentityStmt stmt)
- Specified by:
caseIdentityStmtin interfaceStmtSwitch
-
caseGotoStmt
public void caseGotoStmt(GotoStmt stmt)
- Specified by:
caseGotoStmtin interfaceStmtSwitch
-
caseLookupSwitchStmt
public void caseLookupSwitchStmt(LookupSwitchStmt stmt)
- Specified by:
caseLookupSwitchStmtin interfaceStmtSwitch
-
caseTableSwitchStmt
public void caseTableSwitchStmt(TableSwitchStmt stmt)
- Specified by:
caseTableSwitchStmtin interfaceStmtSwitch
-
caseIfStmt
public void caseIfStmt(IfStmt stmt)
- Specified by:
caseIfStmtin interfaceStmtSwitch
-
preAllocateMonitorConsts
public void preAllocateMonitorConsts(Set<ClassConstant> monitorConsts)
Pre-allocates and locks registers for the constants used in monitor expressions- Parameters:
monitorConsts- The set of monitor constants fow which to assign fixed registers
-
-