1 18 19 package alt.jiapi.instrumentor; 20 21 import java.util.ArrayList ; 22 import java.util.List ; 23 24 import alt.jiapi.reflect.Instruction; 25 import alt.jiapi.reflect.InstructionList; 26 import alt.jiapi.reflect.instruction.OpcodeGroups; 27 28 36 public class MethodReturnStrategy extends AbstractStrategy { 37 40 public MethodReturnStrategy() { 41 } 42 43 44 52 public List findHotSpots(InstructionList il) { 53 String name = il.getDeclaringMethod().getName(); 54 Instrumentation i = getInstrumentation(); 55 i.setTargetName(name); 56 57 List hotSpots = new ArrayList (); 58 int index = 0; 59 60 while ((index = il.indexOf(OpcodeGroups.RETURN_INSTRUCTIONS, 62 index)) != -1) { 63 if (match(name)) { 65 HotSpot h = new HotSpot(index, index + 1); 66 hotSpots.add(h); 67 } 68 69 index++; 70 } 71 72 return hotSpots; 73 } 74 75 78 public String toString() { 79 return this.getClass().getName(); 80 } 81 } 82 | Popular Tags |