|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--envgen.codegen.EnvInterface
Discovers environment's interface that consists of environment classes, methods, and fields referenced in the unit.
| Field Summary | |
(package private) EnvCallGraph |
callGraph
|
(package private) int |
debug
Set to print debugging messages. |
(package private) static java.util.List |
envMethods
A list of concrete (analyzable) top-level environment methods |
(package private) java.util.HashMap |
envTable
Keeps track of environment components, including only those that get called inside the unit. |
(package private) boolean |
unitAnalysis
|
(package private) java.util.HashMap |
unitTable
Keeps track of unit classes. |
| Constructor Summary | |
EnvInterface(java.util.HashMap unitTable,
java.util.HashMap envTable,
EnvCallGraph callGraph)
|
|
| Method Summary | |
protected void |
addAbstractMethods(soot.SootClass externalClass,
soot.SootClass markedClass)
If externalClass extends an abstract
class, markedClass might need to have
all of the methods that implement abstract methods
of the parent. |
protected void |
addFinalFields(soot.SootClass externalClass,
soot.SootClass markedClass)
Gives markedClass all of the final
fields of the externalClass
to be able to resolve final field references
that are present in the source code
but might be absent in the class files. |
void |
addMethodToClass(soot.SootClass externalClass,
soot.SootMethod externalMethod)
Creates an image of externalMethod not including
the body, and adds it to the externalClass. |
boolean |
envCheck(soot.SootClass sc)
If sc is in the environment
records it in the envTable if it's not there, and returns
true. |
protected void |
envCheckExceptions(soot.SootMethod externalMethod)
If any of the exceptions of the externalMethod
are in the environment,
records them in the envTable. |
protected void |
envCheckField(soot.SootField field)
If field field
is a part of the environment,
records its type class in the envTable. |
protected void |
envCheckFieldRef(soot.SootField refField)
If field reference fieldRef
is a part of the environment,
records it in the envTable. |
protected void |
envCheckFields(soot.SootClass internalClass)
|
protected void |
envCheckInterfaces(soot.SootClass internalClass)
If any of the interfaces of the unit class internalClass
are external,
records them in the envTable. |
protected void |
envCheckInvokeExpr(soot.jimple.Stmt site,
soot.jimple.InvokeExpr expr,
soot.SootMethod internalMethod)
Resolves invoke expression expr and
calls envCheckMethod for all
possible methods at this site. |
protected void |
envCheckLocals(soot.Body jb)
If any of the locals of the internalMethod
are external,
records them in the envTable |
protected void |
envCheckMethod(soot.SootMethod internalMethod)
|
protected void |
envCheckMethods(soot.SootClass internalClass)
|
protected void |
envCheckMethodSignature(soot.SootMethod externalMethod)
If any of the components of the externalMethod signature are in the
environment, records them
in the /envTable. |
protected void |
envCheckParams(soot.SootMethod externalMethod)
If any of the parameter declared types of external
method are in the environment, records
them in the |
protected void |
envCheckParent(soot.SootClass internalClass)
If a parent of the unit class internalClass
is external to the unit,
records it in the envTable. |
protected void |
envCheckReturnType(soot.SootMethod externalMethod)
If the return type of externalMethod is in the
environment, records it in the envTable. |
protected void |
envCheckStmts(soot.SootMethod internalMethod,
soot.Body jb)
Records any of the external references found in the statement list of the internalMethod
in the envTable |
void |
envInsertClass(soot.SootClass sc)
|
protected void |
envInsertMethod(soot.SootMethod externalMethod)
If any of the components of the externalMethod signature are in the
environment, records them
in the /envTable. |
protected void |
envInsertMethods(soot.SootClass internalClass)
|
void |
findMissingComponents()
Processes unit classes and identifies all external references, recording them in the envTable. |
soot.SootClass |
getClass(soot.Type type)
Given a type returns a soot class. |
static java.util.List |
getEnvMethods()
|
java.util.HashMap |
getEnvTable()
|
java.util.HashSet |
getInterfaces(soot.SootClass sc)
Gets interfaces of the class. |
soot.SootClass |
getParent(soot.SootClass sc)
Gets a parent class from the system. |
java.util.ArrayList |
getSuperInterfaceClasses(soot.SootClass sc)
This method gets interfaces that are directly implements by sc and the super interfaces of these interfaces. |
void |
setHierarchy()
Sets the hierarchy among the environment classes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.util.HashMap unitTable
java.util.HashMap envTable
static java.util.List envMethods
EnvCallGraph callGraph
boolean unitAnalysis
int debug
| Constructor Detail |
public EnvInterface(java.util.HashMap unitTable,
java.util.HashMap envTable,
EnvCallGraph callGraph)
| Method Detail |
public void findMissingComponents()
envTable.
protected void envCheckParent(soot.SootClass internalClass)
internalClass
is external to the unit,
records it in the envTable.
protected void envCheckInterfaces(soot.SootClass internalClass)
internalClass
are external,
records them in the envTable.
protected void envCheckFields(soot.SootClass internalClass)
protected void envCheckMethods(soot.SootClass internalClass)
protected void envCheckMethod(soot.SootMethod internalMethod)
protected void envCheckLocals(soot.Body jb)
internalMethod
are external,
records them in the envTable.
protected void envCheckStmts(soot.SootMethod internalMethod,
soot.Body jb)
internalMethod
in the envTable.
protected void envCheckInvokeExpr(soot.jimple.Stmt site,
soot.jimple.InvokeExpr expr,
soot.SootMethod internalMethod)
expr and
calls envCheckMethod for all
possible methods at this site.
protected void envCheckMethodSignature(soot.SootMethod externalMethod)
externalMethod signature are in the
environment, records them
in the /envTable.
protected void envCheckReturnType(soot.SootMethod externalMethod)
externalMethod is in the
environment, records it in the envTable.
protected void envCheckParams(soot.SootMethod externalMethod)
external
method are in the environment, records
them in the
protected void envCheckExceptions(soot.SootMethod externalMethod)
externalMethod
are in the environment,
records them in the envTable.
protected void envCheckFieldRef(soot.SootField refField)
fieldRef
is a part of the environment,
records it in the envTable.
protected void envCheckField(soot.SootField field)
field
is a part of the environment,
records its type class in the envTable.
public boolean envCheck(soot.SootClass sc)
sc is in the environment
records it in the envTable if it's not there, and returns
true.
public void envInsertClass(soot.SootClass sc)
protected void envInsertMethods(soot.SootClass internalClass)
protected void envInsertMethod(soot.SootMethod externalMethod)
externalMethod signature are in the
environment, records them
in the /envTable.
public soot.SootClass getClass(soot.Type type)
public void setHierarchy()
public soot.SootClass getParent(soot.SootClass sc)
public java.util.HashSet getInterfaces(soot.SootClass sc)
public java.util.ArrayList getSuperInterfaceClasses(soot.SootClass sc)
sc - The soot class of which its direct implemented interfaces and the super interfaces of thes interfaces need to be found.
protected void addFinalFields(soot.SootClass externalClass,
soot.SootClass markedClass)
markedClass all of the final
fields of the externalClass
to be able to resolve final field references
that are present in the source code
but might be absent in the class files.
protected void addAbstractMethods(soot.SootClass externalClass,
soot.SootClass markedClass)
externalClass extends an abstract
class, markedClass might need to have
all of the methods that implement abstract methods
of the parent. This method should be used after the
hierarchy has been established among the environment
classes.
public void addMethodToClass(soot.SootClass externalClass,
soot.SootMethod externalMethod)
externalMethod not including
the body, and adds it to the externalClass.
public java.util.HashMap getEnvTable()
public static java.util.List getEnvMethods()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||