public class JimpleBodyBuilder extends AbstractJimpleBodyBuilder
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<java.util.List<Stmt>> |
afterReturn |
protected java.util.List<java.util.List<Stmt>> |
beforeReturn |
protected java.util.Stack<Try> |
catchStack |
protected java.util.Stack<Stmt> |
condControlNoop |
protected java.util.Stack<Stmt> |
endControlNoop |
protected java.util.ArrayList<Trap> |
exceptionTable |
protected java.util.Stack<Stmt> |
falseNoop |
protected java.util.HashMap |
getThisMap |
protected java.util.HashMap<java.lang.String,Stmt> |
labelBreakMap |
protected java.util.HashMap<java.lang.String,Stmt> |
labelContinueMap |
protected java.util.HashMap<polyglot.ast.Stmt,Stmt> |
labelMap |
protected LocalGenerator |
lg |
protected java.util.HashMap<IdentityKey,Local> |
localsMap |
protected java.util.Stack<Value> |
monitorStack |
protected Local |
outerClassParamLocal |
protected int |
paramRefCount |
protected Local |
specialThisLocal |
protected java.util.Stack<Stmt> |
trueNoop |
protected java.util.Stack<Try> |
tryStack |
body| Constructor and Description |
|---|
JimpleBodyBuilder() |
| Modifier and Type | Method and Description |
|---|---|
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
|
Constant |
createConstant(polyglot.ast.Expr expr) |
JimpleBody |
createJimpleBody(polyglot.ast.Block block,
java.util.List formals,
SootMethod sootMethod)
Jimple Body Creation
|
protected Value |
createLHS(polyglot.ast.Expr expr)
create LHS expressions
|
protected void |
createStmt(polyglot.ast.Stmt stmt)
Stmt creation
|
protected Local |
generateLocal(polyglot.types.Type polyglotType)
Extra Local Variables Generation
|
protected Value |
getAssignLocal(polyglot.ast.Assign assign)
Assign Expression Creation
|
protected Value |
getAssignRightLocal(polyglot.ast.Assign assign,
Local leftLocal) |
protected Value |
getBaseLocal(polyglot.ast.Receiver receiver) |
protected Constant |
getConstant(Type type,
int val)
Returns a needed constant given a type and val
|
protected FieldRef |
getFieldRef(polyglot.ast.Field field)
creates a field ref
|
protected Value |
getSimpleAssignRightLocal(polyglot.ast.Assign assign) |
protected SootMethodRef |
getSootMethodRef(polyglot.ast.Call call) |
protected Local |
getThis(Type sootType) |
protected void |
handleFieldInits(java.util.ArrayList<FieldDecl> fieldInits) |
protected Local |
handlePrivateFieldAssignSet(polyglot.ast.Assign assign) |
protected Local |
handlePrivateFieldSet(polyglot.ast.Expr expr,
Value right,
Value base) |
protected Local |
handlePrivateFieldUnarySet(polyglot.ast.Unary unary) |
protected void |
handleStaticBlocks(java.util.ArrayList<Block> initializerBlocks) |
protected boolean |
needsAccessor(polyglot.ast.Expr expr) |
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
|
protected boolean |
needsOuterClassRef(polyglot.types.ClassType typeToInvoke) |
base, base, ext, extprotected java.util.List<java.util.List<Stmt>> beforeReturn
protected java.util.List<java.util.List<Stmt>> afterReturn
protected java.util.ArrayList<Trap> exceptionTable
protected java.util.Stack<Stmt> endControlNoop
protected java.util.Stack<Stmt> condControlNoop
protected java.util.Stack<Value> monitorStack
protected java.util.Stack<Try> tryStack
protected java.util.Stack<Try> catchStack
protected java.util.Stack<Stmt> trueNoop
protected java.util.Stack<Stmt> falseNoop
protected java.util.HashMap<java.lang.String,Stmt> labelBreakMap
protected java.util.HashMap<java.lang.String,Stmt> labelContinueMap
protected java.util.HashMap<polyglot.ast.Stmt,Stmt> labelMap
protected java.util.HashMap<IdentityKey,Local> localsMap
protected java.util.HashMap getThisMap
protected Local specialThisLocal
protected Local outerClassParamLocal
protected int paramRefCount
protected LocalGenerator lg
public JimpleBody createJimpleBody(polyglot.ast.Block block, java.util.List formals, SootMethod sootMethod)
createJimpleBody in class AbstractJimpleBodyBuilderprotected void handleFieldInits(java.util.ArrayList<FieldDecl> fieldInits)
protected void handleStaticBlocks(java.util.ArrayList<Block> initializerBlocks)
protected void createStmt(polyglot.ast.Stmt stmt)
createStmt in class AbstractJimpleBodyBuilderpublic Constant createConstant(polyglot.ast.Expr expr)
protected Value createAggressiveExpr(polyglot.ast.Expr expr, boolean reduceAggressively, boolean reverseCondIfNec)
createAggressiveExpr in class AbstractJimpleBodyBuilderprotected Local handlePrivateFieldUnarySet(polyglot.ast.Unary unary)
handlePrivateFieldUnarySet in class AbstractJimpleBodyBuilderprotected Local handlePrivateFieldAssignSet(polyglot.ast.Assign assign)
handlePrivateFieldAssignSet in class AbstractJimpleBodyBuilderprotected Local handlePrivateFieldSet(polyglot.ast.Expr expr, Value right, Value base)
handlePrivateFieldSet in class AbstractJimpleBodyBuilderprotected Value getAssignRightLocal(polyglot.ast.Assign assign, Local leftLocal)
getAssignRightLocal in class AbstractJimpleBodyBuilderprotected Value getSimpleAssignRightLocal(polyglot.ast.Assign assign)
getSimpleAssignRightLocal in class AbstractJimpleBodyBuilderprotected Value getAssignLocal(polyglot.ast.Assign assign)
protected boolean needsAccessor(polyglot.ast.Expr expr)
needsAccessor in class AbstractJimpleBodyBuilderprotected boolean needsAccessor(polyglot.types.MemberInstance inst)
needsAccessor in class AbstractJimpleBodyBuilderprotected FieldRef getFieldRef(polyglot.ast.Field field)
getFieldRef in class AbstractJimpleBodyBuilderprotected Constant getConstant(Type type, int val)
getConstant in class AbstractJimpleBodyBuilderprotected Local getThis(Type sootType)
getThis in class AbstractJimpleBodyBuilderprotected boolean needsOuterClassRef(polyglot.types.ClassType typeToInvoke)
protected SootMethodRef getSootMethodRef(polyglot.ast.Call call)
getSootMethodRef in class AbstractJimpleBodyBuilderprotected Value getBaseLocal(polyglot.ast.Receiver receiver)
getBaseLocal in class AbstractJimpleBodyBuilderprotected Value createLHS(polyglot.ast.Expr expr)
createLHS in class AbstractJimpleBodyBuilderprotected Local generateLocal(polyglot.types.Type polyglotType)
generateLocal in class AbstractJimpleBodyBuilder