|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Analysis.Transformation.MethodSplitter | +--harpoon.Analysis.Transactions.SyncTransformer
SyncTransformer
transforms synchronized code to
atomic transactions. Works on QuadSSA
form.
Use the SyncTransformer.treeCodeFactory()
to clean
up the transformed code by doing low-level tree form optimizations.
Nested Class Summary |
Nested classes inherited from class harpoon.Analysis.Transformation.MethodSplitter |
MethodSplitter.Token |
Field Summary |
Fields inherited from class harpoon.Analysis.Transformation.MethodSplitter |
ORIGINAL |
Constructor Summary | |
SyncTransformer(HCodeFactory hcf,
ClassHierarchy ch,
Linker l,
HMethod mainM,
Set roots)
Creates a SyncTransformer with no safe methods. |
|
SyncTransformer(HCodeFactory hcf,
ClassHierarchy ch,
Linker l,
HMethod mainM,
Set roots,
Set safeMethods)
Creates a SyncTransformer with the specified safe
method set. |
|
SyncTransformer(HCodeFactory hcf,
ClassHierarchy ch,
Linker l,
HMethod mainM,
Set roots,
String resourceName)
Creates a SyncTransformer with a safe method set loaded
from the specified resource name. |
Method Summary | |
protected HCodeAndMaps |
cloneHCode(HCode hc,
HMethod newmethod)
Override this method if you do not want the mutatable HCode to be a straight clone of the original HCode: for example, if the input HCodes were QuadSSI and you wanted to
clone them into QuadRSSI s before mutating. |
HCodeFactory |
codeFactory()
Returns a HCodeFactory containing representations for
the methods split by the MethodSplitter . |
protected boolean |
isValidToken(MethodSplitter.Token which)
Check the validity of a given MethodSplitter.Token . |
protected String |
mutateCodeName(String codeName)
Override this method to change the codename which this MethodMutator 's codefactory reports. |
protected String |
mutateDescriptor(HMethod hm,
MethodSplitter.Token which)
Override this method if you want to create mutated methods with descriptors differing from that of the original method. |
protected HCode |
mutateHCode(HCodeAndMaps input,
MethodSplitter.Token which)
Override this method to effect transformations on split methods. |
HCodeFactory |
treeCodeFactory(Frame f,
HCodeFactory hcf)
Return an HCodeFactory that will clean up the
tree form of the transformed code by performing some optimizations
which can't be represented in quad form. |
Methods inherited from class harpoon.Analysis.Transformation.MethodSplitter |
isVirtual, select |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SyncTransformer(HCodeFactory hcf, ClassHierarchy ch, Linker l, HMethod mainM, Set roots)
SyncTransformer
with no safe methods.
public SyncTransformer(HCodeFactory hcf, ClassHierarchy ch, Linker l, HMethod mainM, Set roots, String resourceName)
SyncTransformer
with a safe method set loaded
from the specified resource name.
public SyncTransformer(HCodeFactory hcf, ClassHierarchy ch, Linker l, HMethod mainM, Set roots, Set safeMethods)
SyncTransformer
with the specified safe
method set.
Method Detail |
protected boolean isValidToken(MethodSplitter.Token which)
MethodSplitter
MethodSplitter.Token
.
Override if (when) your subclass defines new tokens.
isValidToken
in class MethodSplitter
public HCodeFactory codeFactory()
MethodSplitter
HCodeFactory
containing representations for
the methods split by the MethodSplitter
.
codeFactory
in class MethodSplitter
protected String mutateDescriptor(HMethod hm, MethodSplitter.Token which)
MethodSplitter
mutateDescriptor
in class MethodSplitter
protected HCodeAndMaps cloneHCode(HCode hc, HMethod newmethod)
MethodSplitter
QuadSSI
and you wanted to
clone them into QuadRSSI
s before mutating.
By default, this method returns hc.clone(newmethod)
.
cloneHCode
in class MethodSplitter
protected String mutateCodeName(String codeName)
MethodSplitter
MethodMutator
's codefactory reports.
mutateCodeName
in class MethodSplitter
protected HCode mutateHCode(HCodeAndMaps input, MethodSplitter.Token which)
MethodSplitter
mutateHCode
in class MethodSplitter
public HCodeFactory treeCodeFactory(Frame f, HCodeFactory hcf)
HCodeFactory
that will clean up the
tree form of the transformed code by performing some optimizations
which can't be represented in quad form.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |