}
// modify rg with appropriate transfer function
- analyzeFlatNode( d, fm, fn, setReturns, rg );
+ rg = analyzeFlatNode( d, fm, fn, setReturns, rg );
+
if( takeDebugSnapshots &&
- d.getSymbol().equals( descSymbolDebug ) ) {
+ d.getSymbol().equals( descSymbolDebug )
+ ) {
debugSnapshot( rg, fn );
}
}
- protected void
+ protected ReachGraph
analyzeFlatNode( Descriptor d,
FlatMethod fmContaining,
FlatNode fn,
);
}
- rgMergeOfEffects.merge( rgCopy );
+ rgMergeOfEffects.merge( rgCopy );
}
-
-
// now that we've taken care of building heap models for
// callee analysis, finish this transformation
// at this point rg should be the correct update
// by an above transfer function, or untouched if
// the flat node type doesn't affect the heap
+ return rg;
}
rg.writeGraph( "COMPLETE"+d,
true, // write labels (variables)
true, // selectively hide intermediate temp vars
- true, // prune unreachable heap regions
+ false, // prune unreachable heap regions
false, // show back edges to confirm graph validity
true, // hide subset reachability states
true ); // hide edge taints
// get successive captures of the analysis state
boolean takeDebugSnapshots = false;
- String descSymbolDebug = "addSomething";
+ String descSymbolDebug = "addBar";
boolean stopAfterCapture = true;
// increments every visit to debugSnapshot, don't fiddle with it
try {
rg.writeGraph( graphName,
true, // write labels (variables)
- true, // selectively hide intermediate temp vars
+ false, // selectively hide intermediate temp vars
false, // prune unreachable heap regions
false, // show back edges to confirm graph validity
true, // hide subset reachability states
}
if( predType == TYPE_EDGE ) {
-
- System.out.println( " type==edge" );
-
// first establish whether the source of the
// reference edge exists
VariableNode vnSrc = null;
if( e_tdSrc != null ) {
vnSrc = rg.td2vn.get( e_tdSrc );
- System.out.println( " vnSrc="+vnSrc );
}
HeapRegionNode hrnSrc = null;
if( e_hrnSrcID != null ) {
if( !calleeReachableNodes.contains( hrnDst ) ) {
return false;
}
-
-
- System.out.println( " check the edge..." );
// is there an edge between them with the given
// type and field?
e_type,
e_field );
if( edge == null ) {
- System.out.println( " edge is null!" );
return false;
}
if( !calleeReachableEdges.contains( edge ) ) {
- System.out.println( " edge not reachable!" );
return false;
}
HeapRegionNode hrnReferencee = edge.getDst();
RefEdge edgeNew = edge.copy();
edgeNew.setSrc( hrnB );
- edgeNew.setDst( hrnB );
+ edgeNew.setDst( hrnReferencee );
addRefEdge( hrnB, hrnReferencee, edgeNew );
}
}
}
-
if( writeDebugDOTs ) {
try {
rg.writeGraph( "calleeview", true, false, false, false, true, true );
} catch( IOException e ) {}
}
-
return rg;
}
- if( writeDebugDOTs ) {
- System.out.println( "doing call site, edges:"+callerEdgesCopiedToCallee );
- }
-
-
// 1. mark what callee elements have satisfied predicates
Set<HeapRegionNode> calleeNodesSatisfied =
new HashSet<HeapRegionNode>();
)
) {
calleeNodesSatisfied.add( hrnCallee );
-
-
-
- if( writeDebugDOTs ) {
- System.out.println( " node satissfied: "+hrnCallee );
- }
-
}
Iterator<RefEdge> reItr = hrnCallee.iteratorToReferencees();
Iterator<RefEdge> reItr = vnCallee.iteratorToReferencees();
while( reItr.hasNext() ) {
RefEdge reCallee = reItr.next();
-
-
- if( writeDebugDOTs ) {
- System.out.println( " satisfied?: "+reCallee );
- }
-
if( reCallee.getPreds().isSatisfiedBy( this,
callerNodesCopiedToCallee,
)
) {
calleeEdgesSatisfied.add( reCallee );
-
- if( writeDebugDOTs ) {
- System.out.println( " satisfied: "+reCallee );
- }
}
-
- else
- if( writeDebugDOTs ) {
- System.out.println( " NOT satisfied: "+reCallee );
- }
-
-
}
-
}
while( hrnItr.hasNext() ) {
HeapRegionNode hrnCaller = hrnItr.next();
wipeOut( hrnCaller );
-
- if( writeDebugDOTs ) {
- System.out.println( " wiping: "+hrnCaller );
- }
}
);
}
- if( writeDebugDOTs ) {
- System.out.println( " stitching in: "+hrnCaller );
- }
-
// TODO: alpha should be some rewritten version of callee in caller context
hrnCaller.setAlpha( rsetEmpty );
TempDescriptor tdParam = vnCallee.getTempDescriptor();
TempDescriptor tdArg = fc.getArgMatchingParam( fm,
tdParam );
-
- if( writeDebugDOTs ) {
- System.out.println( " considering: "+rsnCallee );
- }
-
if( tdArg == null ) {
// this means the variable isn't a parameter, its local
// to the callee so we ignore it in call site transfer
}
rsnCaller = this.getVariableNodeFromTemp( tdArg );
-
- if( writeDebugDOTs ) {
- System.out.println( " stitching in: "+rsnCaller );
- }
} else {
HeapRegionNode hrnSrcCallee = (HeapRegionNode) reCallee.getSrc();
if( writeDebugDOTs ) {
try {
- writeGraph( "callerAfter",
+ writeGraph( "callerAfterTransfer",
true, false, false, false, true, true,
null, null );
} catch( IOException e ) {}
SOURCE_FILES=$(PROGRAM).java
BUILDSCRIPT=~/research/Robust/src/buildscript
-DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1
-DEBUGFLAGS= -disjoint-debug-callsite addBar addSomething 1
-#DEBUGFLAGS=
+#DEBUGFLAGS= -disjoint-debug-callsite addBar addSomething 1
+#DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1
+DEBUGFLAGS=
BSFLAGS= -mainclass Test -justanalyze -disjoint -disjoint-k 2 -disjoint-write-dots final -disjoint-write-ihms -disjoint-alias-file aliases.txt normal -enable-assertions
all: $(PROGRAM).bin
/*
Foo f2 = new Foo();
- addSomething( f2 );
+ addSomething( f2 );
*/
}