1 package Analysis.Pointer;
7 public class AllocFactory {
8 public static class AllocNode {
13 public AllocNode(int allocsite, TypeDescriptor type, boolean summary) {
14 this.allocsite=allocsite;
19 public int hashCode() {
20 return allocsite<<1^(summary?0:1);
23 public boolean equals(Object o) {
24 if (o instanceof AllocNode) {
25 AllocNode an=(AllocNode)o;
26 return (allocsite==an.allocsite)&&(summary==an.summary);
32 public AllocFactory(State state, TypeUtil typeUtil) {
33 allocMap=new HashMap<FlatNode, Integer>();
34 this.typeUtil=typeUtil;
35 ClassDescriptor stringcd=typeUtil.getClass(TypeUtil.StringClass);
36 TypeDescriptor stringtd=new TypeDescriptor(stringcd);
37 TypeDescriptor stringarraytd=stringtd.makeArray(state);
38 StringArray=new AllocNode(0, stringarraytd, false);
39 Strings=new AllocNode(1, stringtd, true);
42 HashMap<FlatNode, Integer> allocMap;
46 public AllocNode StringArray;
47 public AllocNode Strings;