1 19 20 25 26 27 28 29 30 package soot.baf.internal; 31 32 import soot.*; 33 import soot.baf.*; 34 import java.util.*; 35 36 abstract class AbstractInvokeInst extends AbstractInst 37 { 38 SootMethodRef methodRef; 39 40 public SootMethodRef getMethodRef() 41 { 42 return methodRef; 43 } 44 45 public SootMethod getMethod() 46 { 47 return methodRef.resolve(); 48 } 49 50 public Type getType() 51 { 52 return methodRef.returnType(); 53 } 54 55 public String toString() 56 { 57 return getName() + getParameters(); 58 } 59 60 abstract public String getName(); 61 String getParameters() 62 { return " " + methodRef.getSignature(); } 63 protected void getParameters(UnitPrinter up) { 64 up.literal(" "); 65 up.methodRef(methodRef); 66 } 67 68 69 70 71 public int getInCount() 72 { 73 return getMethodRef().parameterTypes().size(); 74 } 75 76 77 public int getOutCount() 78 { 79 if(getMethodRef().returnType() instanceof VoidType) 80 return 0; 81 else 82 return 1; 83 } 84 85 86 87 public int getInMachineCount() 88 { 89 int count = 0; 90 91 Iterator it = getMethodRef().parameterTypes().iterator(); 92 while(it.hasNext()) { 93 count += JasminClass.sizeOfType((Type) it.next()); 94 } 95 return count; 96 } 97 98 99 public int getOutMachineCount() 100 { 101 if(getMethodRef().returnType() instanceof VoidType) 102 return 0; 103 else 104 return JasminClass.sizeOfType(getMethodRef().returnType()); 105 } 106 107 public boolean containsInvokeExpr() { return true; } 108 109 } 110 | Popular Tags |