if( writeDOTs && !writeAllDOTs ) {
writeFinalContextGraphs();
- }
+ }
if( aliasFile != null ) {
if( state.TASK ) {
}
- private HashSet<AllocationSite> getFlaggedAllocationSites(Descriptor d) {
+ private HashSet<AllocationSite> getFlaggedAllocationSites(Descriptor dIn) {
- HashSet<AllocationSite> out = new HashSet<AllocationSite>();
-
- HashSet<AllocationSite> asSet = getAllocationSiteSet(d);
- Iterator asItr = asSet.iterator();
- while( asItr.hasNext() ) {
- AllocationSite as = (AllocationSite) asItr.next();
- if( as.getDisjointId() != null ) {
- out.add(as);
+ HashSet<AllocationSite> out = new HashSet<AllocationSite>();
+ HashSet<Descriptor> toVisit = new HashSet<Descriptor>();
+ HashSet<Descriptor> visited = new HashSet<Descriptor>();
+
+ toVisit.add(dIn);
+
+ while( !toVisit.isEmpty() ) {
+ Descriptor d = toVisit.iterator().next();
+ toVisit.remove(d);
+ visited.add(d);
+
+ HashSet<AllocationSite> asSet = getAllocationSiteSet(d);
+ Iterator asItr = asSet.iterator();
+ while( asItr.hasNext() ) {
+ AllocationSite as = (AllocationSite) asItr.next();
+ if( as.getDisjointId() != null ) {
+ out.add(as);
+ }
+ }
+
+ // enqueue callees of this method to be searched for
+ // allocation sites also
+ Set callees = callGraph.getCalleeSet(d);
+ if( callees != null ) {
+ Iterator methItr = callees.iterator();
+ while( methItr.hasNext() ) {
+ MethodDescriptor md = (MethodDescriptor) methItr.next();
+
+ if( !visited.contains(md) ) {
+ toVisit.add(md);
+ }
+ }
}
}
if( n.getAlpha().contains(c.getSetToMatch() ) ) {
ReachabilitySet withChange =
- n.getAlpha().remove( c.getSetToMatch() ).union( c.getSetToAdd() );
+ //n.getAlpha().remove( c.getSetToMatch() ).union( c.getSetToAdd() );
+ n.getAlpha().union( c.getSetToAdd() );
n.setAlphaNew( n.getAlphaNew().union(withChange) );
nodesWithNewAlpha.add(n);
ChangeTuple c = itrC.next();
if( edgeE.getBeta().contains(c.getSetToMatch() ) ) {
ReachabilitySet withChange =
- edgeE.getBeta().remove( c.getSetToMatch() ).union( c.getSetToAdd() );
+ //edgeE.getBeta().remove( c.getSetToMatch() ).union( c.getSetToAdd() );
+ edgeE.getBeta().union( c.getSetToAdd() );
edgeE.setBetaNew(edgeE.getBetaNew().union(withChange) );
edgesWithNewBeta.add(edgeE);
ReferenceEdge edge = itrRes.next();
if( (edge.getBeta().containsWithZeroes( tts ) ||
- edge.getBeta().containsSuperSet ( tts )
+ edge.getBeta().containsSuperSet ( tts )
) &&
!edge.getBetaNew().contains( tts ) ) {
// if these are the same site, don't look for the same token, no alias.
// different tokens of the same site could alias together though
- if( idI1 == idI2 ) {
+ if( idI1.equals( idI2 ) ) {
continue;
}