3 import java.util.HashSet;
4 import java.util.Iterator;
6 import IR.TypeDescriptor;
8 public class MethodSummary {
10 public static final Integer VOID=new Integer(0);
11 public static final Integer ACCESSIBLE = new Integer(1);
12 public static final Integer INACCESSIBLE=new Integer(2);
14 private int childSESECount;
15 private HashSet<PreEffectsKey> effectsSet;
16 private Integer accessibility;
17 private StallSite returnStallSite;
19 public MethodSummary() {
20 effectsSet = new HashSet<PreEffectsKey>();
21 accessibility = MethodSummary.VOID;
26 public void setReturnStallSite(StallSite ss){
30 public StallSite getReturnStallSite(){
31 return returnStallSite;
34 public void increaseChildSESECount() {
38 public int getChildSESECount() {
39 return childSESECount;
42 public Integer getReturnValueAccessibility() {
46 public void setReturnValueAccessibility(Integer accessibility) {
47 this.accessibility = accessibility;
50 public HashSet<PreEffectsKey> getEffectsSet() {
55 public String toString() {
56 return "MethodSummary [accessibility=" + accessibility
57 + ", childSESECount=" + childSESECount + ", effectsSet="
61 public HashSet<PreEffectsKey> getEffectsSetByParamIdx(int paramIdx){
63 HashSet<PreEffectsKey> returnSet=new HashSet<PreEffectsKey>();
65 for (Iterator iterator = effectsSet.iterator(); iterator.hasNext();) {
66 PreEffectsKey preEffectsKey = (PreEffectsKey) iterator.next();
67 if(preEffectsKey.getParamIndex().equals(new Integer(paramIdx))){
68 returnSet.add(preEffectsKey);
79 public static final Integer READ_EFFECT = new Integer(1);
80 public static final Integer WRITE_EFFECT = new Integer(2);
84 private Integer effectType;
85 private Integer paramIndex;
87 public PreEffectsKey(Integer paramIndex, String field, String type,
89 this.paramIndex = paramIndex;
92 this.effectType = effectType;
95 public String getType() {
99 public String getField() {
103 public Integer getEffectType() {
107 public Integer getParamIndex() {
111 public String toString() {
112 return "PreEffectsKey [effectType=" + effectType + ", field=" + field
113 + ", paramIndex=" + paramIndex + ", type=" + type + "]";
116 public boolean equals(Object o) {
122 if (!(o instanceof PreEffectsKey)) {
126 PreEffectsKey in = (PreEffectsKey) o;
128 this.paramIndex = paramIndex;
131 this.effectType = effectType;
133 if (paramIndex.equals(in.getParamIndex())
134 && field.equals(in.getField()) && type.equals(in.getType())
135 && effectType.equals(in.getEffectType())) {