1 19 20 25 26 27 28 29 30 31 32 33 package soot.baf.internal; 34 35 import soot.*; 36 import soot.baf.*; 37 import soot.util.*; 38 import java.util.*; 39 40 public class BSwapInst extends AbstractInst implements SwapInst 41 { 42 43 protected Type mFromType, mToType; 44 45 46 public BSwapInst(Type fromType, Type toType) 47 { 48 49 if(fromType instanceof LongType || fromType instanceof DoubleType) 50 throw new RuntimeException ("fromType is LongType or DoubleType !"); 51 if(toType instanceof LongType || toType instanceof DoubleType) 52 throw new RuntimeException ("toType is LongType or DoubleType !"); 53 54 mFromType = Baf.getDescriptorTypeOf(fromType); 55 mToType = Baf.getDescriptorTypeOf(toType); 56 } 57 58 public Type getFromType() 59 { 60 return mFromType; 61 } 62 public void setFromType(Type fromType) 63 { 64 mFromType = fromType; 65 } 66 67 public Type getToType() 68 { 69 return mToType; 70 } 71 72 public void setToType(Type toType) 73 { 74 mToType = toType; 75 } 76 77 78 79 public int getInCount() 80 { 81 return 2; 82 } 83 84 public int getInMachineCount() 85 { 86 return 2; 87 } 88 89 public int getOutCount() 90 { 91 return 2; 92 } 93 94 public int getOutMachineCount() 95 { 96 return 2; 97 } 98 99 public void apply(Switch sw) 100 { 101 ((InstSwitch) sw).caseSwapInst(this); 102 } 103 104 public String toString() 105 { 106 return "swap." + Baf.bafDescriptorOf(mFromType) + Baf.bafDescriptorOf(mToType); 107 } 108 109 110 public String getName() {return "swap";} 111 112 113 114 } 115 116 117 | Popular Tags |