|
SandMark version 3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sandmark.watermark.ct.embed.InsertStorageCreators
We need some kind of structure to store handles to watermark graph components. We can use arrays, vectors, hashtables, etc. At some point these structures need to be created. This class is in charge of inserting code for creating these storage structures.
Field Summary | |
(package private) Forest |
callForest
|
(package private) ClassFileCollection |
cfc
|
(package private) java.util.Properties |
props
|
(package private) java.lang.String[][] |
storageCreators
|
(package private) java.lang.String |
watermarkClassName
|
Constructor Summary | |
InsertStorageCreators(ClassFileCollection cfc,
java.util.Properties props,
java.lang.String[][] storageCreators,
Forest callForest)
We need some kind of structure to store handles to watermark graph components. |
Method Summary | |
(package private) de.fub.bytecode.generic.InstructionList |
createStorageCreatorCall(java.lang.String methodName,
java.lang.String returnType,
java.lang.String localName,
de.fub.bytecode.generic.ConstantPoolGen cp,
de.fub.bytecode.generic.MethodGen mg)
Return a list of instructions that invoke the method 'methodName', whose signature is "()returnType". |
(package private) ByteCodeLocation |
getCallForestRoot()
Return the location in the code where we should insert the calls to Watermark.CreateStorage_X(). |
void |
insert()
Insert calls to Watermark.CreateStorage_X(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.util.Properties props
ClassFileCollection cfc
java.lang.String watermarkClassName
java.lang.String[][] storageCreators
Forest callForest
Constructor Detail |
public InsertStorageCreators(ClassFileCollection cfc, java.util.Properties props, java.lang.String[][] storageCreators, Forest callForest)
Method Detail |
ByteCodeLocation getCallForestRoot()
main() { P(10); }where we might insert the calls between 'push 10' and 'call P'.
public void insert() throws java.lang.Exception
void main() { P(); }should turn into
void main() { java.util.Hashtable sm$hash = Watermark.CreateStorage_sm$hash(); java.util.Vector sm$vector = Watermark.CreateStorage_sm$vector(); P(); }If we're passing storage containers in formal parameters, this will eventually turn into
void main() { java.util.Hashtable sm$hash = Watermark.CreateStorage_sm$hash(); java.util.Vector sm$vector = Watermark.CreateStorage_sm$vector(); P(sm$hash,sm$vector); } storageCreators[][] is an array of quadruples: {methodName, returnType, localName, GLOBAL/FORMAL} for example {"CreateStorage_sm$hash", "java.util.Hashtable", "sm$hash", "FORMAL"}Rather than inserting the calls at the exact bytecode location we go to location 0, the beginning of the method. This avoids the unpleasant situation
main() { P(10); }where we might insert the calls between 'push 10' and 'call P'. This is the main entry point to this class.
java.lang.Exception
de.fub.bytecode.generic.InstructionList createStorageCreatorCall(java.lang.String methodName, java.lang.String returnType, java.lang.String localName, de.fub.bytecode.generic.ConstantPoolGen cp, de.fub.bytecode.generic.MethodGen mg)
methodName
- name of method to be calledreturnType
- return type of method to be calledlocalName
- name of local to store intocp
- constant poolmg
- method to be edited
|
SandMark version 3.0 Wed Jan 29 10:30:05 MST 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |