From b98a499b0affe414647e7a0dec368e538c77faa8 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 15 Mar 2011 10:26:57 +0000 Subject: [PATCH] small hacks to speed up stuff...don't compute graphs for primitive field read/writes...just reuse other graphs that are the same --- Robust/src/Analysis/Pointer/Graph.java | 1 + Robust/src/Analysis/Pointer/Pointer.java | 97 +++++++++++++++++------- 2 files changed, 69 insertions(+), 29 deletions(-) diff --git a/Robust/src/Analysis/Pointer/Graph.java b/Robust/src/Analysis/Pointer/Graph.java index d4c5fb9a..c925ab72 100644 --- a/Robust/src/Analysis/Pointer/Graph.java +++ b/Robust/src/Analysis/Pointer/Graph.java @@ -125,6 +125,7 @@ public class Graph { TempDescriptor tmp=entry.getKey(); if (childvarMap!=null&&childvarMap.containsKey(tmp)) continue; + output.println(tmp.getSymbol()+"[shape=rectangle];"); for(Edge e:entry.getValue()) { if (e.srcvar!=tmp) throw new Error(e.srcvar +" is not equal to "+tmp); diff --git a/Robust/src/Analysis/Pointer/Pointer.java b/Robust/src/Analysis/Pointer/Pointer.java index f52dedec..abc70f9b 100644 --- a/Robust/src/Analysis/Pointer/Pointer.java +++ b/Robust/src/Analysis/Pointer/Pointer.java @@ -84,19 +84,19 @@ public class Pointer { if (ppoint.getIndex()==-1) { //Build base graph for entrance to this basic block - System.out.println("Processing "+bblock.nodes.get(0).toString().replace(' ','_')); - delta.print(); + //System.out.println("Processing "+bblock.nodes.get(0).toString().replace(' ','_')); + //delta.print(); delta=applyInitDelta(delta, bblock); - System.out.println("Generating:"); - delta.print(); + //System.out.println("Generating:"); + //delta.print(); } else { - System.out.println("Processing Call "+bblock.nodes.get(ppoint.getIndex()).toString().replace(' ','_')); - delta.print(); + //System.out.println("Processing Call "+bblock.nodes.get(ppoint.getIndex()).toString().replace(' ','_')); + //delta.print(); startindex=ppoint.getIndex()+1; delta=applyCallDelta(delta, bblock); - System.out.println("Generating:"); - delta.print(); + //System.out.println("Generating:"); + //delta.print(); } Graph graph=bbgraphMap.get(bblock); Graph nodeGraph=null; @@ -107,14 +107,24 @@ public class Pointer { //Compute delta at exit of each node for(int i=startindex; i e:graphMap.entrySet()) { FlatNode fn=e.getKey(); Graph g=e.getValue(); @@ -292,8 +302,8 @@ public class Pointer { boolean first=true; for(PPoint caller:returnMap.get(bblock)) { - System.out.println("Sending Return BBlock to "+caller.getBBlock().nodes.get(caller.getIndex()).toString().replace(' ','_')); - newDelta.print(); + //System.out.println("Sending Return BBlock to "+caller.getBBlock().nodes.get(caller.getIndex()).toString().replace(' ','_')); + //newDelta.print(); if (first) { newDelta.setBlock(caller); toprocess.add(newDelta); @@ -307,8 +317,8 @@ public class Pointer { //normal block Vector blockvector=bblock.next(); for(int i=0;i srcNodes=GraphManip.getNodes(graph, delta, src); HashSet dstNodes=GraphManip.getNodes(graph, delta, dst); @@ -1172,6 +1208,9 @@ public class Pointer { fd=ffn.getField(); dst=ffn.getDst(); } + //Do nothing for non pointers + if (!dst.getType().isPtr()) + return delta; if (delta.getInit()) { HashSet srcnodes=GraphManip.getNodes(graph, delta, src); HashSet fdnodes=GraphManip.getNodes(graph, delta, srcnodes, fd); -- 2.34.1