Package soot.toolkits.exceptions
Class TrapTightener
- java.lang.Object
-
- soot.Transformer
-
- soot.BodyTransformer
-
- soot.toolkits.exceptions.TrapTransformer
-
- soot.toolkits.exceptions.TrapTightener
-
public final class TrapTightener extends TrapTransformer
ABodyTransformerthat shrinks the protected area covered by eachTrapin theBodyso that it begins at the first of theBody'sUnits which might throw an exception caught by theTrapand ends just after the lastUnitwhich might throw an exception caught by theTrap. In the case where none of theUnits protected by aTrapcan throw the exception it catches, theTrap's protected area is left completely empty, which will likely cause theUnreachableCodeEliminatorto remove theTrapcompletely. TheTrapTighteneris used to reduce the risk of unverifiable code which can result from the use ofExceptionalUnitGraphs from which unrealizable exceptional control flow edges have been removed.
-
-
Field Summary
Fields Modifier and Type Field Description protected ThrowAnalysisthrowAnalysis
-
Constructor Summary
Constructors Constructor Description TrapTightener(Singletons.Global g)TrapTightener(ThrowAnalysis ta)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinternalTransform(Body body, String phaseName, Map<String,String> options)This method is called to perform the transformation itself.protected booleanmightThrowTo(ExceptionalUnitGraph g, Unit u, Trap t)static TrapTightenerv()-
Methods inherited from class soot.toolkits.exceptions.TrapTransformer
getUnitsWithMonitor
-
Methods inherited from class soot.BodyTransformer
transform, transform, transform
-
-
-
-
Field Detail
-
throwAnalysis
protected ThrowAnalysis throwAnalysis
-
-
Constructor Detail
-
TrapTightener
public TrapTightener(Singletons.Global g)
-
TrapTightener
public TrapTightener(ThrowAnalysis ta)
-
-
Method Detail
-
v
public static TrapTightener v()
-
internalTransform
protected void internalTransform(Body body, String phaseName, Map<String,String> options)
Description copied from class:BodyTransformerThis method is called to perform the transformation itself. It is declared abstract; subclasses must implement this method by making it the entry point to their actual Body transformation.- Specified by:
internalTransformin classBodyTransformer- Parameters:
body- the body on which to apply the transformationphaseName- the phasename for this transform; not typically used by implementations.options- the actual computed options; a combination of default options and Scene specified options.
-
mightThrowTo
protected boolean mightThrowTo(ExceptionalUnitGraph g, Unit u, Trap t)
A utility routine which determines if a particularUnitmight throw an exception to a particularTrap, according to the information supplied by a particular control flow graph.- Parameters:
g- The control flow graph providing information about exceptions.u- The unit being inquired about.t- The trap being inquired about.- Returns:
- true if u might throw an exception caught by t, according to g
-
-