From: yeom Date: Fri, 8 Apr 2011 03:45:29 +0000 (+0000) Subject: fixes -nostalltr flag: if it is valid to prune heap examiners, turning off both of... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=962045fb482b951ebd554a4ccacc2c873ea50ef8;p=IRC.git fixes -nostalltr flag: if it is valid to prune heap examiners, turning off both of task & stallsite examiners --- diff --git a/Robust/src/Analysis/OoOJava/ConflictNode.java b/Robust/src/Analysis/OoOJava/ConflictNode.java index a83ecbe7..3b6c3019 100644 --- a/Robust/src/Analysis/OoOJava/ConflictNode.java +++ b/Robust/src/Analysis/OoOJava/ConflictNode.java @@ -29,6 +29,15 @@ public class ConflictNode { protected FlatNode stallSite; protected TempDescriptor var; protected FlatSESEEnterNode fsen; + protected boolean toBePruned = false; + + public boolean isTobePruned() { + return toBePruned; + } + + public void setToBePruned(boolean toBePruned) { + this.toBePruned = toBePruned; + } public static final int FINE_READ = 0; public static final int FINE_WRITE = 1; @@ -40,7 +49,7 @@ public class ConflictNode { public static final int INVAR = 0; public static final int STALLSITE = 1; - + public ConflictNode(String id, int nodeType, TempDescriptor var, FlatNode stallSite) { this(id, var, nodeType); this.stallSite = stallSite; @@ -223,7 +232,7 @@ public class ConflictNode { public String toString() { return id; } - + public boolean IsValidToPrune() { for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) { @@ -245,12 +254,9 @@ public class ConflictNode { return false; } } - } - } return true; } - } diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index 7b446681..cd627867 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -1,4 +1,5 @@ package IR.Flat; + import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; @@ -13,6 +14,7 @@ import Analysis.Pointer.*; import Analysis.Pointer.AllocFactory.AllocNode; import IR.State; import IR.TypeDescriptor; +import Analysis.OoOJava.ConflictEdge; import Analysis.OoOJava.ConflictGraph; import Analysis.OoOJava.ConflictNode; import Analysis.OoOJava.OoOJavaAnalysis; @@ -448,6 +450,30 @@ public class RuntimeConflictResolver { ConflictNode node = graph.getId2cn().get(id); isValidToPrune &= node.IsValidToPrune(); } + + if(isValidToPrune){ + // if node is valid to prune examiner, + // also needs to turn off stall site examiners connected to this node + for( FlatSESEEnterNode parentSESE: fsen.getParents() ) { + ConflictGraph graph = oooa.getConflictGraph(parentSESE); + String id = tmp + "_sese" + fsen.getPrettyIdentifier(); + ConflictNode node = graph.getId2cn().get(id); + + for (Iterator iterator = node.getEdgeSet().iterator(); iterator.hasNext();) { + ConflictEdge edge = (ConflictEdge) iterator.next(); + if (edge.getVertexU() == node) { + if (edge.getVertexV().isStallSiteNode()) { + edge.getVertexV().setToBePruned(true); + } + } else { + if (edge.getVertexU().isStallSiteNode()) { + edge.getVertexU().setToBePruned(true); + } + } + } + } + } + if (i!=0) { cFile.println(" if (record->rcrstatus!=0)"); } @@ -469,11 +495,25 @@ public class RuntimeConflictResolver { } for(FlatNode stallsite: processedStallSites.keySet()) { + TempDescriptor var = processedStallSites.get(stallsite); + Set seseSet=oooa.getPossibleExecutingRBlocks(stallsite); + boolean isValidToPrune=true; + for (Iterator iterator = seseSet.iterator(); iterator.hasNext();) { + FlatSESEEnterNode sese = (FlatSESEEnterNode) iterator.next(); + ConflictGraph graph = oooa.getConflictGraph(sese); + String id = var + "_fn" + stallsite.hashCode(); + ConflictNode node = graph.getId2cn().get(id); + isValidToPrune &= node.isTobePruned(); + } cFile.println( " case -" + getTraverserID(var, stallsite)+ ": {"); cFile.println( " SESEstall * rec=(SESEstall*) record;"); - cFile.println( " " + getTraverserInvocation(var, "rec->___obj___, rec", stallsite)+";"); + if(globalState.NOSTALLTR && isValidToPrune){ + cFile.println( " /*" + getTraverserInvocation(var, "rec->___obj___, rec", stallsite)+";*/"); + }else{ + cFile.println( " " + getTraverserInvocation(var, "rec->___obj___, rec", stallsite)+";"); + } cFile.println( " record->rcrstatus=0;"); cFile.println( " }"); cFile.println(" break;");