1 package Analysis.SSJava;
3 import java.io.BufferedWriter;
4 import java.io.FileWriter;
5 import java.io.IOException;
6 import java.util.ArrayList;
7 import java.util.Collections;
8 import java.util.Comparator;
9 import java.util.HashMap;
10 import java.util.HashSet;
11 import java.util.Hashtable;
12 import java.util.Iterator;
13 import java.util.LinkedList;
14 import java.util.List;
17 import java.util.StringTokenizer;
18 import java.util.Vector;
20 import Analysis.CallGraph.CallGraph;
21 import Analysis.Loops.GlobalFieldType;
22 import Analysis.Loops.LoopOptimize;
23 import Analysis.Loops.LoopTerminate;
24 import IR.AnnotationDescriptor;
25 import IR.ClassDescriptor;
27 import IR.FieldDescriptor;
28 import IR.MethodDescriptor;
30 import IR.SymbolTable;
32 import IR.Flat.BuildFlat;
33 import IR.Flat.FlatMethod;
34 import IR.Flat.FlatNode;
37 public class SSJavaAnalysis {
39 public static final String SSJAVA = "SSJAVA";
40 public static final String LATTICE = "LATTICE";
41 public static final String METHODDEFAULT = "METHODDEFAULT";
42 public static final String THISLOC = "THISLOC";
43 public static final String GLOBALLOC = "GLOBALLOC";
44 public static final String RETURNLOC = "RETURNLOC";
45 public static final String PCLOC = "PCLOC";
46 public static final String LOC = "LOC";
47 public static final String DELTA = "DELTA";
48 public static final String TERMINATE = "TERMINATE";
49 public static final String DELEGATE = "DELEGATE";
50 public static final String DELEGATETHIS = "DELEGATETHIS";
51 public static final String TRUST = "TRUST";
53 public static final String TOP = "_top_";
54 public static final String BOTTOM = "_bottom_";
58 FlowDownCheck flowDownChecker;
59 MethodAnnotationCheck methodAnnotationChecker;
62 // set containing method requires to be annoated
63 Set<MethodDescriptor> annotationRequireSet;
65 // class -> field lattice
66 Hashtable<ClassDescriptor, SSJavaLattice<String>> cd2lattice;
68 // class -> default local variable lattice
69 Hashtable<ClassDescriptor, MethodLattice<String>> cd2methodDefault;
71 // method -> local variable lattice
72 Hashtable<MethodDescriptor, MethodLattice<String>> md2lattice;
74 // method set that does not want to have loop termination analysis
75 Hashtable<MethodDescriptor, Integer> skipLoopTerminate;
77 // map shared location to its descriptors
78 Hashtable<Location, Set<Descriptor>> mapSharedLocation2DescriptorSet;
80 // set containing a class that has at least one annoated method
81 Set<ClassDescriptor> annotationRequireClassSet;
83 // the set of method descriptor required to check the linear type property
84 Set<MethodDescriptor> linearTypeCheckMethodSet;
86 // the set of method descriptors annotated as "TRUST"
87 Set<MethodDescriptor> trustWorthyMDSet;
89 // method -> the initial program counter location
90 Map<MethodDescriptor, CompositeLocation> md2pcLoc;
92 // points to method containing SSJAVA Loop
93 private MethodDescriptor methodContainingSSJavaLoop;
95 private FlatNode ssjavaLoopEntrance;
97 // keep the field ownership from the linear type checking
98 Hashtable<MethodDescriptor, Set<FieldDescriptor>> mapMethodToOwnedFieldSet;
100 Set<FlatNode> sameHeightWriteFlatNodeSet;
104 LinearTypeCheck checker;
106 // maps a descriptor to its known dependents: namely
107 // methods or tasks that call the descriptor's method
108 // AND are part of this analysis (reachable from main)
109 private Hashtable<Descriptor, Set<MethodDescriptor>> mapDescriptorToSetDependents;
111 private LinkedList<MethodDescriptor> sortedDescriptors;
113 public SSJavaAnalysis(State state, TypeUtil tu, BuildFlat bf, CallGraph callgraph) {
116 this.callgraph = callgraph;
117 this.cd2lattice = new Hashtable<ClassDescriptor, SSJavaLattice<String>>();
118 this.cd2methodDefault = new Hashtable<ClassDescriptor, MethodLattice<String>>();
119 this.md2lattice = new Hashtable<MethodDescriptor, MethodLattice<String>>();
120 this.annotationRequireSet = new HashSet<MethodDescriptor>();
121 this.annotationRequireClassSet = new HashSet<ClassDescriptor>();
122 this.skipLoopTerminate = new Hashtable<MethodDescriptor, Integer>();
123 this.mapSharedLocation2DescriptorSet = new Hashtable<Location, Set<Descriptor>>();
124 this.linearTypeCheckMethodSet = new HashSet<MethodDescriptor>();
126 this.trustWorthyMDSet = new HashSet<MethodDescriptor>();
127 this.mapMethodToOwnedFieldSet = new Hashtable<MethodDescriptor, Set<FieldDescriptor>>();
128 this.sameHeightWriteFlatNodeSet = new HashSet<FlatNode>();
129 this.mapDescriptorToSetDependents = new Hashtable<Descriptor, Set<MethodDescriptor>>();
130 this.sortedDescriptors = new LinkedList<MethodDescriptor>();
131 this.md2pcLoc = new HashMap<MethodDescriptor, CompositeLocation>();
134 public void doCheck() {
135 doMethodAnnotationCheck();
138 computeLinearTypeCheckMethodSet();
144 if (state.SSJAVADEBUG) {
145 // debug_printAnnotationRequiredSet();
147 if (state.SSJAVAINFER) {
151 parseLocationAnnotation();
153 doDefinitelyWrittenCheck();
158 private void init() {
159 // perform topological sort over the set of methods accessed by the main
161 Set<MethodDescriptor> methodDescriptorsToAnalyze = new HashSet<MethodDescriptor>();
162 methodDescriptorsToAnalyze.addAll(getAnnotationRequireSet());
163 sortedDescriptors = topologicalSort(methodDescriptorsToAnalyze);
166 public LinkedList<MethodDescriptor> getSortedDescriptors() {
167 return (LinkedList<MethodDescriptor>) sortedDescriptors.clone();
170 private void inference() {
171 LocationInference inferEngine = new LocationInference(this, state);
172 inferEngine.inference();
175 private void doLoopCheck() {
176 GlobalFieldType gft = new GlobalFieldType(callgraph, state, tu.getMain());
177 LoopOptimize lo = new LoopOptimize(gft, tu);
179 SymbolTable classtable = state.getClassSymbolTable();
181 List<ClassDescriptor> toanalyzeList = new ArrayList<ClassDescriptor>();
182 List<MethodDescriptor> toanalyzeMethodList = new ArrayList<MethodDescriptor>();
184 toanalyzeList.addAll(classtable.getValueSet());
185 Collections.sort(toanalyzeList, new Comparator<ClassDescriptor>() {
186 public int compare(ClassDescriptor o1, ClassDescriptor o2) {
187 return o1.getClassName().compareTo(o2.getClassName());
191 for (int i = 0; i < toanalyzeList.size(); i++) {
192 ClassDescriptor cd = toanalyzeList.get(i);
194 SymbolTable methodtable = cd.getMethodTable();
195 toanalyzeMethodList.clear();
196 toanalyzeMethodList.addAll(methodtable.getValueSet());
197 Collections.sort(toanalyzeMethodList, new Comparator<MethodDescriptor>() {
198 public int compare(MethodDescriptor o1, MethodDescriptor o2) {
199 return o1.getSymbol().compareTo(o2.getSymbol());
203 for (int mdIdx = 0; mdIdx < toanalyzeMethodList.size(); mdIdx++) {
204 MethodDescriptor md = toanalyzeMethodList.get(mdIdx);
205 if (needTobeAnnotated(md)) {
206 lo.analyze(state.getMethodFlat(md));
207 doLoopTerminationCheck(lo, state.getMethodFlat(md));
215 public void addTrustMethod(MethodDescriptor md) {
216 trustWorthyMDSet.add(md);
219 public boolean isTrustMethod(MethodDescriptor md) {
220 return trustWorthyMDSet.contains(md);
223 private void computeLinearTypeCheckMethodSet() {
225 Set<MethodDescriptor> allCalledSet = callgraph.getMethodCalls(tu.getMain());
226 linearTypeCheckMethodSet.addAll(allCalledSet);
228 Set<MethodDescriptor> trustedSet = new HashSet<MethodDescriptor>();
230 for (Iterator iterator = trustWorthyMDSet.iterator(); iterator.hasNext();) {
231 MethodDescriptor trustMethod = (MethodDescriptor) iterator.next();
232 Set<MethodDescriptor> calledFromTrustMethodSet = callgraph.getMethodCalls(trustMethod);
233 trustedSet.add(trustMethod);
234 trustedSet.addAll(calledFromTrustMethodSet);
237 linearTypeCheckMethodSet.removeAll(trustedSet);
239 // if a method is called only by trusted method, no need to check linear
240 // type & flow down rule
241 for (Iterator iterator = trustedSet.iterator(); iterator.hasNext();) {
242 MethodDescriptor md = (MethodDescriptor) iterator.next();
243 Set<MethodDescriptor> callerSet = callgraph.getCallerSet(md);
244 if (!trustedSet.containsAll(callerSet) && !trustWorthyMDSet.contains(md)) {
245 linearTypeCheckMethodSet.add(md);
251 private void doLinearTypeCheck() {
252 LinearTypeCheck checker = new LinearTypeCheck(this, state);
253 checker.linearTypeCheck();
256 public void debug_printAnnotationRequiredSet() {
257 System.out.println("SSJAVA: SSJava is checking the following methods:");
258 for (Iterator<MethodDescriptor> iterator = annotationRequireSet.iterator(); iterator.hasNext();) {
259 MethodDescriptor md = iterator.next();
260 System.out.println(md);
262 System.out.println();
265 private void doMethodAnnotationCheck() {
266 methodAnnotationChecker = new MethodAnnotationCheck(this, state, tu);
267 methodAnnotationChecker.methodAnnoatationCheck();
268 methodAnnotationChecker.methodAnnoataionInheritanceCheck();
269 if (state.SSJAVAINFER) {
270 annotationRequireClassSet.add(methodContainingSSJavaLoop.getClassDesc());
271 annotationRequireSet.add(methodContainingSSJavaLoop);
273 state.setAnnotationRequireSet(annotationRequireSet);
276 public void doFlowDownCheck() {
277 flowDownChecker = new FlowDownCheck(this, state);
278 flowDownChecker.flowDownCheck();
281 public void doDefinitelyWrittenCheck() {
282 DefinitelyWrittenCheck checker = new DefinitelyWrittenCheck(this, state);
283 checker.definitelyWrittenCheck();
286 private void parseLocationAnnotation() {
287 Iterator it = state.getClassSymbolTable().getDescriptorsIterator();
288 while (it.hasNext()) {
289 ClassDescriptor cd = (ClassDescriptor) it.next();
290 // parsing location hierarchy declaration for the class
291 Vector<AnnotationDescriptor> classAnnotations = cd.getModifier().getAnnotations();
292 for (int i = 0; i < classAnnotations.size(); i++) {
293 AnnotationDescriptor an = classAnnotations.elementAt(i);
294 String marker = an.getMarker();
295 if (marker.equals(LATTICE)) {
296 SSJavaLattice<String> locOrder =
297 new SSJavaLattice<String>(SSJavaAnalysis.TOP, SSJavaAnalysis.BOTTOM);
298 cd2lattice.put(cd, locOrder);
299 parseClassLatticeDefinition(cd, an.getValue(), locOrder);
301 if (state.SSJAVADEBUG) {
302 // generate lattice dot file
303 writeLatticeDotFile(cd, null, locOrder);
306 } else if (marker.equals(METHODDEFAULT)) {
307 MethodLattice<String> locOrder =
308 new MethodLattice<String>(SSJavaAnalysis.TOP, SSJavaAnalysis.BOTTOM);
309 cd2methodDefault.put(cd, locOrder);
310 parseMethodDefaultLatticeDefinition(cd, an.getValue(), locOrder);
314 for (Iterator method_it = cd.getMethods(); method_it.hasNext();) {
315 MethodDescriptor md = (MethodDescriptor) method_it.next();
316 // parsing location hierarchy declaration for the method
318 if (needTobeAnnotated(md)) {
319 Vector<AnnotationDescriptor> methodAnnotations = md.getModifiers().getAnnotations();
320 if (methodAnnotations != null) {
321 for (int i = 0; i < methodAnnotations.size(); i++) {
322 AnnotationDescriptor an = methodAnnotations.elementAt(i);
323 if (an.getMarker().equals(LATTICE)) {
324 // developer explicitly defines method lattice
325 MethodLattice<String> locOrder =
326 new MethodLattice<String>(SSJavaAnalysis.TOP, SSJavaAnalysis.BOTTOM);
327 md2lattice.put(md, locOrder);
328 parseMethodDefaultLatticeDefinition(cd, an.getValue(), locOrder);
329 } else if (an.getMarker().equals(TERMINATE)) {
330 // developer explicitly wants to skip loop termination analysis
331 String value = an.getValue();
332 int maxIteration = 0;
334 maxIteration = Integer.parseInt(value);
336 skipLoopTerminate.put(md, new Integer(maxIteration));
347 public <T> void writeLatticeDotFile(ClassDescriptor cd, MethodDescriptor md,
348 SSJavaLattice<T> locOrder) {
350 String fileName = "lattice_";
353 cd.getSymbol().replaceAll("[\\W_]", "") + "_" + md.getSymbol().replaceAll("[\\W_]", "");
355 fileName += cd.getSymbol().replaceAll("[\\W_]", "");
358 Set<Pair<T, T>> pairSet = locOrder.getOrderingPairSet();
360 if (pairSet.size() > 0) {
362 BufferedWriter bw = new BufferedWriter(new FileWriter(fileName + ".dot"));
364 bw.write("digraph " + fileName + " {\n");
366 for (Iterator iterator = pairSet.iterator(); iterator.hasNext();) {
367 // pair is in the form of <higher, lower>
368 Pair<T, T> pair = (Pair<T, T>) iterator.next();
370 T highLocId = pair.getFirst();
371 String highLocStr, lowLocStr;
372 if (locOrder.isSharedLoc(highLocId)) {
373 highLocStr = "\"" + highLocId + "*\"";
375 highLocStr = highLocId.toString();
377 T lowLocId = pair.getSecond();
378 if (locOrder.isSharedLoc(lowLocId)) {
379 lowLocStr = "\"" + lowLocId + "*\"";
381 lowLocStr = lowLocId.toString();
383 bw.write(highLocStr + " -> " + lowLocStr + ";\n");
388 } catch (IOException e) {
396 private void parseMethodDefaultLatticeDefinition(ClassDescriptor cd, String value,
397 MethodLattice<String> locOrder) {
399 value = value.replaceAll(" ", ""); // remove all blank spaces
401 StringTokenizer tokenizer = new StringTokenizer(value, ",");
403 while (tokenizer.hasMoreTokens()) {
404 String orderElement = tokenizer.nextToken();
405 int idx = orderElement.indexOf("<");
406 if (idx > 0) {// relative order element
407 String lowerLoc = orderElement.substring(0, idx);
408 String higherLoc = orderElement.substring(idx + 1);
409 locOrder.put(higherLoc, lowerLoc);
410 if (locOrder.isIntroducingCycle(higherLoc)) {
411 throw new Error("Error: the order relation " + lowerLoc + " < " + higherLoc
412 + " introduces a cycle.");
414 } else if (orderElement.startsWith(THISLOC + "=")) {
415 String thisLoc = orderElement.substring(8);
416 locOrder.setThisLoc(thisLoc);
417 } else if (orderElement.startsWith(GLOBALLOC + "=")) {
418 String globalLoc = orderElement.substring(10);
419 locOrder.setGlobalLoc(globalLoc);
420 } else if (orderElement.startsWith(RETURNLOC + "=")) {
421 String returnLoc = orderElement.substring(10);
422 locOrder.setReturnLoc(returnLoc);
423 } else if (orderElement.endsWith("*")) {
424 // spin loc definition
425 locOrder.addSharedLoc(orderElement.substring(0, orderElement.length() - 1));
428 locOrder.put(orderElement);
433 if (locOrder.getThisLoc() != null && !locOrder.containsKey(locOrder.getThisLoc())) {
434 throw new Error("Variable 'this' location '" + locOrder.getThisLoc()
435 + "' is not defined in the local variable lattice at " + cd.getSourceFileName());
438 if (locOrder.getGlobalLoc() != null && !locOrder.containsKey(locOrder.getGlobalLoc())) {
439 throw new Error("Variable global location '" + locOrder.getGlobalLoc()
440 + "' is not defined in the local variable lattice at " + cd.getSourceFileName());
444 private void parseClassLatticeDefinition(ClassDescriptor cd, String value,
445 SSJavaLattice<String> locOrder) {
447 value = value.replaceAll(" ", ""); // remove all blank spaces
449 StringTokenizer tokenizer = new StringTokenizer(value, ",");
451 while (tokenizer.hasMoreTokens()) {
452 String orderElement = tokenizer.nextToken();
453 int idx = orderElement.indexOf("<");
455 if (idx > 0) {// relative order element
456 String lowerLoc = orderElement.substring(0, idx);
457 String higherLoc = orderElement.substring(idx + 1);
458 locOrder.put(higherLoc, lowerLoc);
459 if (locOrder.isIntroducingCycle(higherLoc)) {
460 throw new Error("Error: the order relation " + lowerLoc + " < " + higherLoc
461 + " introduces a cycle.");
463 } else if (orderElement.contains("*")) {
464 // spin loc definition
465 locOrder.addSharedLoc(orderElement.substring(0, orderElement.length() - 1));
468 locOrder.put(orderElement);
473 Set<String> spinLocSet = locOrder.getSharedLocSet();
474 for (Iterator iterator = spinLocSet.iterator(); iterator.hasNext();) {
475 String spinLoc = (String) iterator.next();
476 if (!locOrder.containsKey(spinLoc)) {
477 throw new Error("Spin location '" + spinLoc
478 + "' is not defined in the default local variable lattice at " + cd.getSourceFileName());
483 public Hashtable<ClassDescriptor, SSJavaLattice<String>> getCd2lattice() {
487 public Hashtable<ClassDescriptor, MethodLattice<String>> getCd2methodDefault() {
488 return cd2methodDefault;
491 public Hashtable<MethodDescriptor, MethodLattice<String>> getMd2lattice() {
495 public SSJavaLattice<String> getClassLattice(ClassDescriptor cd) {
496 return cd2lattice.get(cd);
499 public MethodLattice<String> getMethodDefaultLattice(ClassDescriptor cd) {
500 return cd2methodDefault.get(cd);
503 public MethodLattice<String> getMethodLattice(MethodDescriptor md) {
504 if (md2lattice.containsKey(md)) {
505 return md2lattice.get(md);
508 if (cd2methodDefault.containsKey(md.getClassDesc())) {
509 return cd2methodDefault.get(md.getClassDesc());
511 throw new Error("Method Lattice of " + md + " is not defined.");
517 public CompositeLocation getPCLocation(MethodDescriptor md) {
518 if (!md2pcLoc.containsKey(md)) {
519 // by default, the initial pc location is TOP
520 CompositeLocation pcLoc = new CompositeLocation(new Location(md, Location.TOP));
521 md2pcLoc.put(md, pcLoc);
523 return md2pcLoc.get(md);
526 public void setPCLocation(MethodDescriptor md, CompositeLocation pcLoc) {
527 md2pcLoc.put(md, pcLoc);
530 public boolean needToCheckLinearType(MethodDescriptor md) {
531 return linearTypeCheckMethodSet.contains(md);
534 public boolean needTobeAnnotated(MethodDescriptor md) {
535 return annotationRequireSet.contains(md);
538 public boolean needToBeAnnoated(ClassDescriptor cd) {
539 return annotationRequireClassSet.contains(cd);
542 public void addAnnotationRequire(ClassDescriptor cd) {
543 annotationRequireClassSet.add(cd);
546 public void addAnnotationRequire(MethodDescriptor md) {
548 ClassDescriptor cd = md.getClassDesc();
549 // if a method requires to be annotated, class containg that method also
550 // requires to be annotated
551 if (!isSSJavaUtil(cd)) {
552 annotationRequireClassSet.add(cd);
553 annotationRequireSet.add(md);
557 public Set<MethodDescriptor> getAnnotationRequireSet() {
558 return annotationRequireSet;
561 public void doLoopTerminationCheck(LoopOptimize lo, FlatMethod fm) {
562 LoopTerminate lt = new LoopTerminate(this, state);
563 if (needTobeAnnotated(fm.getMethod())) {
564 lt.terminateAnalysis(fm, lo.getLoopInvariant(fm));
568 public CallGraph getCallGraph() {
572 public SSJavaLattice<String> getLattice(Descriptor d) {
574 if (d instanceof MethodDescriptor) {
575 return getMethodLattice((MethodDescriptor) d);
577 return getClassLattice((ClassDescriptor) d);
582 public boolean isSharedLocation(Location loc) {
583 SSJavaLattice<String> lattice = getLattice(loc.getDescriptor());
584 return lattice.getSharedLocSet().contains(loc.getLocIdentifier());
587 public void mapSharedLocation2Descriptor(Location loc, Descriptor d) {
588 Set<Descriptor> set = mapSharedLocation2DescriptorSet.get(loc);
590 set = new HashSet<Descriptor>();
591 mapSharedLocation2DescriptorSet.put(loc, set);
596 public BuildFlat getBuildFlat() {
600 public MethodDescriptor getMethodContainingSSJavaLoop() {
601 return methodContainingSSJavaLoop;
604 public void setMethodContainingSSJavaLoop(MethodDescriptor methodContainingSSJavaLoop) {
605 this.methodContainingSSJavaLoop = methodContainingSSJavaLoop;
608 public boolean isSSJavaUtil(ClassDescriptor cd) {
609 if (cd.getSymbol().equals("SSJAVA")) {
615 public void setFieldOnwership(MethodDescriptor md, FieldDescriptor field) {
617 Set<FieldDescriptor> fieldSet = mapMethodToOwnedFieldSet.get(md);
618 if (fieldSet == null) {
619 fieldSet = new HashSet<FieldDescriptor>();
620 mapMethodToOwnedFieldSet.put(md, fieldSet);
625 public boolean isOwnedByMethod(MethodDescriptor md, FieldDescriptor field) {
626 Set<FieldDescriptor> fieldSet = mapMethodToOwnedFieldSet.get(md);
627 if (fieldSet != null) {
628 return fieldSet.contains(field);
633 public FlatNode getSSJavaLoopEntrance() {
634 return ssjavaLoopEntrance;
637 public void setSSJavaLoopEntrance(FlatNode ssjavaLoopEntrance) {
638 this.ssjavaLoopEntrance = ssjavaLoopEntrance;
641 public void addSameHeightWriteFlatNode(FlatNode fn) {
642 this.sameHeightWriteFlatNodeSet.add(fn);
645 public boolean isSameHeightWrite(FlatNode fn) {
646 return this.sameHeightWriteFlatNodeSet.contains(fn);
649 public LinkedList<MethodDescriptor> topologicalSort(Set<MethodDescriptor> toSort) {
651 Set<MethodDescriptor> discovered = new HashSet<MethodDescriptor>();
653 LinkedList<MethodDescriptor> sorted = new LinkedList<MethodDescriptor>();
655 Iterator<MethodDescriptor> itr = toSort.iterator();
656 while (itr.hasNext()) {
657 MethodDescriptor d = itr.next();
659 if (!discovered.contains(d)) {
660 dfsVisit(d, toSort, sorted, discovered);
667 // While we're doing DFS on call graph, remember
668 // dependencies for efficient queuing of methods
669 // during interprocedural analysis:
671 // a dependent of a method decriptor d for this analysis is:
672 // 1) a method or task that invokes d
673 // 2) in the descriptorsToAnalyze set
674 private void dfsVisit(MethodDescriptor md, Set<MethodDescriptor> toSort,
675 LinkedList<MethodDescriptor> sorted, Set<MethodDescriptor> discovered) {
679 Iterator itr2 = callgraph.getCalleeSet(md).iterator();
680 while (itr2.hasNext()) {
681 MethodDescriptor dCallee = (MethodDescriptor) itr2.next();
682 addDependent(dCallee, md);
685 Iterator itr = callgraph.getCallerSet(md).iterator();
686 while (itr.hasNext()) {
687 MethodDescriptor dCaller = (MethodDescriptor) itr.next();
688 // only consider callers in the original set to analyze
689 if (!toSort.contains(dCaller)) {
692 if (!discovered.contains(dCaller)) {
693 addDependent(md, // callee
697 dfsVisit(dCaller, toSort, sorted, discovered);
701 // for leaf-nodes last now!
705 public void addDependent(MethodDescriptor callee, MethodDescriptor caller) {
706 Set<MethodDescriptor> deps = mapDescriptorToSetDependents.get(callee);
708 deps = new HashSet<MethodDescriptor>();
711 mapDescriptorToSetDependents.put(callee, deps);
714 public Set<MethodDescriptor> getDependents(MethodDescriptor callee) {
715 Set<MethodDescriptor> deps = mapDescriptorToSetDependents.get(callee);
717 deps = new HashSet<MethodDescriptor>();
718 mapDescriptorToSetDependents.put(callee, deps);