}
if( predType == TYPE_EDGE ) {
+
+ System.out.println( " type==edge" );
+
// first establish whether the source of the
// reference edge exists
- VariableNode vnSrc = rg.td2vn.get( e_tdSrc );
- HeapRegionNode hrnSrc = rg.id2hrn.get( e_hrnSrcID );
+ 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 ) {
+ hrnSrc = rg.id2hrn.get( e_hrnSrcID );
+ }
assert (vnSrc == null) || (hrnSrc == null);
// the source is not present in graph
}
+ System.out.println( " check the edge..." );
+
// is there an edge between them with the given
// type and field?
// TODO: type OR a subtype?
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;
}
// 4. Global sweep it.
- System.out.println( );
+ if( writeDebugDOTs ) {
+ System.out.println( "doing call site, edges:"+callerEdgesCopiedToCallee );
+ }
// 1. mark what callee elements have satisfied predicates
-
+ if( writeDebugDOTs ) {
+ System.out.println( " node satissfied: "+hrnCallee );
+ }
}
}
}
+ // test param -> HRN edges, also
+ for( int i = 0; i < fm.numParameters(); ++i ) {
+
+ // parameter defined here is the symbol in the callee
+ TempDescriptor tdParam = fm.getParameter( i );
+ VariableNode vnCallee = rgCallee.getVariableNodeFromTemp( tdParam );
+
+ 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,
+ callerEdgesCopiedToCallee
+ )
+ ) {
+ calleeEdgesSatisfied.add( reCallee );
+
+ if( writeDebugDOTs ) {
+ System.out.println( " satisfied: "+reCallee );
+ }
+ }
+
+ else
+ if( writeDebugDOTs ) {
+ System.out.println( " NOT satisfied: "+reCallee );
+ }
+
+
+ }
+
+ }
+
+
// 2. predicates tested, ok to wipe out caller part
Iterator<HeapRegionNode> hrnItr = callerNodesCopiedToCallee.iterator();
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();
SOURCE_FILES=$(PROGRAM).java
BUILDSCRIPT=~/research/Robust/src/buildscript
+DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1
+DEBUGFLAGS= -disjoint-debug-callsite addBar addSomething 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
DOTs: $(PROGRAM).bin
$(PROGRAM).bin: $(SOURCE_FILES)
- $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+ $(BUILDSCRIPT) $(BSFLAGS) $(DEBUGFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
OLDBSFLAGS= -mainclass Test -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions
old: $(SOURCE_FILES)