Search in sources :

Example 1 with LSTORE

use of org.apache.bcel.generic.LSTORE in project jop by jop-devel.

the class ReplaceAtomicAnnotation method getModifiedArguments.

protected static SortedSet<Integer> getModifiedArguments(MethodGen method) {
    SortedSet<Integer> result = new TreeSet<Integer>();
    int arguments = getArgsCount(method);
    for (Instruction in : method.getInstructionList().getInstructions()) {
        if (in instanceof IndexedInstruction) {
            IndexedInstruction i = (IndexedInstruction) in;
            if (i.getIndex() < arguments) {
                if (i instanceof DSTORE || i instanceof LSTORE) {
                    result.add(i.getIndex());
                    result.add(i.getIndex() + 1);
                } else if (i instanceof StoreInstruction || i instanceof IINC) {
                    result.add(i.getIndex());
                }
            }
        }
    }
    return result;
}
Also used : TreeSet(java.util.TreeSet) IINC(org.apache.bcel.generic.IINC) StoreInstruction(org.apache.bcel.generic.StoreInstruction) Instruction(org.apache.bcel.generic.Instruction) BranchInstruction(org.apache.bcel.generic.BranchInstruction) IndexedInstruction(org.apache.bcel.generic.IndexedInstruction) IndexedInstruction(org.apache.bcel.generic.IndexedInstruction) LSTORE(org.apache.bcel.generic.LSTORE) StoreInstruction(org.apache.bcel.generic.StoreInstruction) DSTORE(org.apache.bcel.generic.DSTORE)

Aggregations

TreeSet (java.util.TreeSet)1 BranchInstruction (org.apache.bcel.generic.BranchInstruction)1 DSTORE (org.apache.bcel.generic.DSTORE)1 IINC (org.apache.bcel.generic.IINC)1 IndexedInstruction (org.apache.bcel.generic.IndexedInstruction)1 Instruction (org.apache.bcel.generic.Instruction)1 LSTORE (org.apache.bcel.generic.LSTORE)1 StoreInstruction (org.apache.bcel.generic.StoreInstruction)1