Package soot.javaToJimple
Class JimpleBodyBuilder
- java.lang.Object
-
- soot.javaToJimple.AbstractJimpleBodyBuilder
-
- soot.javaToJimple.JimpleBodyBuilder
-
- Direct Known Subclasses:
AnonInitBodyBuilder
public class JimpleBodyBuilder extends AbstractJimpleBodyBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected List<List<Stmt>>afterReturnprotected List<List<Stmt>>beforeReturnprotected Stack<polyglot.ast.Try>catchStackprotected Stack<Stmt>condControlNoopprotected Stack<Stmt>endControlNoopprotected ArrayList<Trap>exceptionTableprotected Stack<Stmt>falseNoopprotected HashMapgetThisMapprotected HashMap<String,Stmt>labelBreakMapprotected HashMap<String,Stmt>labelContinueMapprotected HashMap<polyglot.ast.Stmt,Stmt>labelMapprotected LocalGeneratorlgprotected HashMap<polyglot.util.IdentityKey,Local>localsMapprotected Stack<Value>monitorStackprotected LocalouterClassParamLocalprotected intparamRefCountprotected LocalspecialThisLocalprotected Stack<Stmt>trueNoopprotected Stack<polyglot.ast.Try>tryStack-
Fields inherited from class soot.javaToJimple.AbstractJimpleBodyBuilder
body
-
-
Constructor Summary
Constructors Constructor Description JimpleBodyBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ValuecreateAggressiveExpr(polyglot.ast.Expr expr, boolean reduceAggressively, boolean reverseCondIfNec)Aggressive Expression Creation make reduceAggressively true to not reduce all the way to a localConstantcreateConstant(polyglot.ast.Expr expr)JimpleBodycreateJimpleBody(polyglot.ast.Block block, List formals, SootMethod sootMethod)Jimple Body Creationprotected ValuecreateLHS(polyglot.ast.Expr expr)create LHS expressionsprotected voidcreateStmt(polyglot.ast.Stmt stmt)Stmt creationprotected LocalgenerateLocal(polyglot.types.Type polyglotType)Extra Local Variables Generationprotected LocalgenerateLocal(Type sootType)protected ValuegetAssignLocal(polyglot.ast.Assign assign)Assign Expression Creationprotected ValuegetAssignRightLocal(polyglot.ast.Assign assign, Local leftLocal)protected ValuegetBaseLocal(polyglot.ast.Receiver receiver)protected ConstantgetConstant(Type type, int val)Returns a needed constant given a type and valprotected FieldRefgetFieldRef(polyglot.ast.Field field)creates a field refprotected ValuegetSimpleAssignRightLocal(polyglot.ast.Assign assign)protected SootMethodRefgetSootMethodRef(polyglot.ast.Call call)protected LocalgetThis(Type sootType)protected voidhandleFieldInits(ArrayList<polyglot.ast.FieldDecl> fieldInits)protected LocalhandlePrivateFieldAssignSet(polyglot.ast.Assign assign)protected LocalhandlePrivateFieldSet(polyglot.ast.Expr expr, Value right, Value base)protected LocalhandlePrivateFieldUnarySet(polyglot.ast.Unary unary)protected voidhandleStaticBlocks(ArrayList<polyglot.ast.Block> initializerBlocks)protected booleanneedsAccessor(polyglot.ast.Expr expr)protected booleanneedsAccessor(polyglot.types.MemberInstance inst)needs accessors: when field or meth is private and in some other class when field or meth is protected and inprotected booleanneedsOuterClassRef(polyglot.types.ClassType typeToInvoke)-
Methods inherited from class soot.javaToJimple.AbstractJimpleBodyBuilder
base, base, ext, ext
-
-
-
-
Field Detail
-
tryStack
protected Stack<polyglot.ast.Try> tryStack
-
catchStack
protected Stack<polyglot.ast.Try> catchStack
-
getThisMap
protected HashMap getThisMap
-
specialThisLocal
protected Local specialThisLocal
-
outerClassParamLocal
protected Local outerClassParamLocal
-
paramRefCount
protected int paramRefCount
-
lg
protected LocalGenerator lg
-
-
Method Detail
-
createJimpleBody
public JimpleBody createJimpleBody(polyglot.ast.Block block, List formals, SootMethod sootMethod)
Jimple Body Creation- Overrides:
createJimpleBodyin classAbstractJimpleBodyBuilder
-
handleFieldInits
protected void handleFieldInits(ArrayList<polyglot.ast.FieldDecl> fieldInits)
-
handleStaticBlocks
protected void handleStaticBlocks(ArrayList<polyglot.ast.Block> initializerBlocks)
-
createStmt
protected void createStmt(polyglot.ast.Stmt stmt)
Stmt creation- Overrides:
createStmtin classAbstractJimpleBodyBuilder
-
createConstant
public Constant createConstant(polyglot.ast.Expr expr)
-
createAggressiveExpr
protected Value createAggressiveExpr(polyglot.ast.Expr expr, boolean reduceAggressively, boolean reverseCondIfNec)
Aggressive Expression Creation make reduceAggressively true to not reduce all the way to a local- Overrides:
createAggressiveExprin classAbstractJimpleBodyBuilder
-
handlePrivateFieldUnarySet
protected Local handlePrivateFieldUnarySet(polyglot.ast.Unary unary)
- Overrides:
handlePrivateFieldUnarySetin classAbstractJimpleBodyBuilder
-
handlePrivateFieldAssignSet
protected Local handlePrivateFieldAssignSet(polyglot.ast.Assign assign)
- Overrides:
handlePrivateFieldAssignSetin classAbstractJimpleBodyBuilder
-
handlePrivateFieldSet
protected Local handlePrivateFieldSet(polyglot.ast.Expr expr, Value right, Value base)
- Overrides:
handlePrivateFieldSetin classAbstractJimpleBodyBuilder
-
getAssignRightLocal
protected Value getAssignRightLocal(polyglot.ast.Assign assign, Local leftLocal)
- Overrides:
getAssignRightLocalin classAbstractJimpleBodyBuilder
-
getSimpleAssignRightLocal
protected Value getSimpleAssignRightLocal(polyglot.ast.Assign assign)
- Overrides:
getSimpleAssignRightLocalin classAbstractJimpleBodyBuilder
-
getAssignLocal
protected Value getAssignLocal(polyglot.ast.Assign assign)
Assign Expression Creation
-
needsAccessor
protected boolean needsAccessor(polyglot.ast.Expr expr)
- Overrides:
needsAccessorin classAbstractJimpleBodyBuilder
-
needsAccessor
protected boolean needsAccessor(polyglot.types.MemberInstance inst)
needs accessors: when field or meth is private and in some other class when field or meth is protected and in
-
getFieldRef
protected FieldRef getFieldRef(polyglot.ast.Field field)
creates a field ref- Overrides:
getFieldRefin classAbstractJimpleBodyBuilder
-
getConstant
protected Constant getConstant(Type type, int val)
Returns a needed constant given a type and val- Overrides:
getConstantin classAbstractJimpleBodyBuilder
-
getThis
protected Local getThis(Type sootType)
- Overrides:
getThisin classAbstractJimpleBodyBuilder
-
needsOuterClassRef
protected boolean needsOuterClassRef(polyglot.types.ClassType typeToInvoke)
-
getSootMethodRef
protected SootMethodRef getSootMethodRef(polyglot.ast.Call call)
- Overrides:
getSootMethodRefin classAbstractJimpleBodyBuilder
-
getBaseLocal
protected Value getBaseLocal(polyglot.ast.Receiver receiver)
- Overrides:
getBaseLocalin classAbstractJimpleBodyBuilder
-
createLHS
protected Value createLHS(polyglot.ast.Expr expr)
create LHS expressions- Overrides:
createLHSin classAbstractJimpleBodyBuilder
-
generateLocal
protected Local generateLocal(polyglot.types.Type polyglotType)
Extra Local Variables Generation- Overrides:
generateLocalin classAbstractJimpleBodyBuilder
-
generateLocal
protected Local generateLocal(Type sootType)
- Overrides:
generateLocalin classAbstractJimpleBodyBuilder
-
-