Class ShimpleBody
- java.lang.Object
-
- soot.tagkit.AbstractHost
-
- soot.Body
-
- soot.jimple.StmtBody
-
- soot.shimple.ShimpleBody
-
- All Implemented Interfaces:
Serializable,Host
public class ShimpleBody extends StmtBody
Implementation of the Body class for the SSA Shimple IR. This class provides methods for maintaining SSA form as well as eliminating SSA form.- Author:
- Navindra Umanee
- See Also:
ShimpleBodyBuilder, Efficiently Computing Static Single Assignment Form and the Control Dependence Graph, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisSSASet isSSA boolean to indicate whether a ShimpleBody is still in SSA form or not.protected ShimpleOptionsoptionsHolds our options map...protected ShimpleBodyBuildersbb-
Fields inherited from class soot.Body
localChain, method, trapChain, unitChain
-
Fields inherited from class soot.tagkit.AbstractHost
col, line, mTagList
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a copy of the current ShimpleBody.Objectclone(boolean noLocalsClone)voideliminateNodes()voideliminatePhiNodes()Remove Phi nodes from body.voideliminatePiNodes()ShimpleOptionsgetOptions()Returns the Shimple options applicable to this body.booleanisExtendedSSA()booleanisSSA()Returns value of, optional, user-maintained SSA boolean.voidmakeUniqueLocalNames()Make sure the locals in this body all have unique String names.voidrebuild()Recompute SSA form.voidrebuild(boolean hasPhiNodes)Rebuild SSA form.voidsetSSA(boolean isSSA)Sets a flag that indicates whether ShimpleBody is still in SSA form after a transformation or not.JimpleBodytoJimpleBody()Returns an equivalent unbacked JimpleBody of the current Body by eliminating the Phi nodes.-
Methods inherited from class soot.Body
checkInit, getAllUnitBoxes, getDefBoxes, getLocalCount, getLocals, getMethod, getMethodUnsafe, getModificationCount, getParameterLocal, getParameterLocals, getParameterRefs, getThisLocal, getThisUnit, getTraps, getUnitBoxes, getUnits, getUseAndDefBoxes, getUseBoxes, importBodyContentsFrom, importBodyContentsFrom, runValidation, setMethod, toString, validate, validate, validateLocals, validateTraps, validateUnitBoxes, validateUses, validateValueBoxes
-
Methods inherited from class soot.tagkit.AbstractHost
addAllTagsOf, addTag, getJavaSourceStartColumnNumber, getJavaSourceStartLineNumber, getTag, getTags, hasTag, removeAllTags, removeTag
-
-
-
-
Field Detail
-
options
protected ShimpleOptions options
Holds our options map...
-
sbb
protected ShimpleBodyBuilder sbb
-
isSSA
protected boolean isSSA
Set isSSA boolean to indicate whether a ShimpleBody is still in SSA form or not. Could be useful for book-keeping purposes.
-
-
Method Detail
-
rebuild
public void rebuild()
Recompute SSA form.Note: assumes presence of Phi nodes in body that require elimination. If you *know* there are no Phi nodes present, you may prefer to use rebuild(false) in order to skip some transformations during the Phi elimination process.
-
rebuild
public void rebuild(boolean hasPhiNodes)
Rebuild SSA form.If there are Phi nodes already present in the body, it is imperative that we specify this so that the algorithm can eliminate them before rebuilding SSA.
The eliminate Phi nodes stage is harmless, but if you *know* that no Phi nodes are present and you wish to avoid the transformations involved in eliminating Phi nodes, use rebuild(false).
-
toJimpleBody
public JimpleBody toJimpleBody()
Returns an equivalent unbacked JimpleBody of the current Body by eliminating the Phi nodes.Currently available option is "naive-phi-elimination", typically specified in the "shimple" phase (eg, -p shimple naive-phi-elimination) which skips the dead code elimination and register allocation phase before eliminating Phi nodes. This can be useful for understanding the effect of analyses.
Remember to setActiveBody() if necessary in your SootMethod.
- See Also:
eliminatePhiNodes()
-
eliminatePhiNodes
public void eliminatePhiNodes()
Remove Phi nodes from body. SSA form is no longer a given once done.Currently available option is "naive-phi-elimination", typically specified in the "shimple" phase (eg, -p shimple naive-phi-elimination) which skips the dead code elimination and register allocation phase before eliminating Phi nodes. This can be useful for understanding the effect of analyses.
- See Also:
toJimpleBody()
-
eliminatePiNodes
public void eliminatePiNodes()
-
eliminateNodes
public void eliminateNodes()
-
clone
public Object clone()
Returns a copy of the current ShimpleBody.
-
setSSA
public void setSSA(boolean isSSA)
Sets a flag that indicates whether ShimpleBody is still in SSA form after a transformation or not. It is often up to the user to indicate if a body is no longer in SSA form.
-
isSSA
public boolean isSSA()
Returns value of, optional, user-maintained SSA boolean.- See Also:
setSSA(boolean)
-
isExtendedSSA
public boolean isExtendedSSA()
-
getOptions
public ShimpleOptions getOptions()
Returns the Shimple options applicable to this body.
-
makeUniqueLocalNames
public void makeUniqueLocalNames()
Make sure the locals in this body all have unique String names. If the standard-local-names option is specified to Shimple, this results in the LocalNameStandardizer being applied. Otherwise, renaming is kept to a minimum and an underscore notation is used to differentiate locals previously of the same name.- See Also:
LocalNameStandardizer
-
-