From: stephey Date: Sat, 22 Jan 2011 00:58:26 +0000 (+0000) Subject: We fixed the bug of where to find the stallsite reachgraph. \n\n We found an even... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fc96fd7bc0c9f2d9715a1c6218bc649ce9a0a4d9;p=IRC.git We fixed the bug of where to find the stallsite reachgraph. \n\n We found an even BIGGER, SYSTEM-WIDE BUG whereby the Conflict Graph of stallsites were stored with the stallsite's parent's parent. However, since many components rely on this bug, we decided to leave it alone but left giant notes explaining the situation. --- diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index b7866137..d3be8ed0 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -1109,7 +1109,9 @@ public class DisjointAnalysis { FlatSESEExitNode fsexn; //Stores the flatnode's reach graph at enter - fn2rgAtEnter.put(fn, rg); + ReachGraph rgOnEnter = new ReachGraph(); + rgOnEnter.merge( rg ); + fn2rgAtEnter.put(fn, rgOnEnter); // use node type to decide what transfer function // to apply to the reachability graph diff --git a/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java b/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java index b54714b6..46d7464a 100644 --- a/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java +++ b/Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java @@ -1050,6 +1050,17 @@ public class OoOJavaAnalysis { rhs = fen.getSrc(); } + // jjenista - I think the following code is WRONG!!! + // We are looking at some non-task FlatNode fn that is a stall site and + // considering what conflicts it might have with CHILDREN of the CURRENT TASK + // that contains fn. WE SHOULD NOT BE GETTING THE PARENT OF currentSESE + // because in this scenario currentSESE IS the parent in relation to other + // tasks that might conflict with this fn. + // OK, why not fix it? Because code all over the place is built on + // being able to retrieve the correct conflict graph, which is associated + // with the wrong task, but at least consistently, SO LEAVE IT BUT REALIZE + // WHAT IS HAPPENING + Set parentSet = currentSESE.getSESEParent(); for (Iterator iterator = parentSet.iterator(); iterator.hasNext();) { FlatSESEEnterNode parent = (FlatSESEEnterNode) iterator.next(); @@ -1087,6 +1098,17 @@ public class OoOJavaAnalysis { rhs = fsen.getSrc(); } + // jjenista - I think the following code is WRONG!!! + // We are looking at some non-task FlatNode fn that is a stall site and + // considering what conflicts it might have with CHILDREN of the CURRENT TASK + // that contains fn. WE SHOULD NOT BE GETTING THE PARENT OF currentSESE + // because in this scenario currentSESE IS the parent in relation to other + // tasks that might conflict with this fn. + // OK, why not fix it? Because code all over the place is built on + // being able to retrieve the correct conflict graph, which is associated + // with the wrong task, but at least consistently, SO LEAVE IT BUT REALIZE + // WHAT IS HAPPENING + // collects effects of stall site and generates stall site node Set parentSet = currentSESE.getSESEParent(); for (Iterator iterator = parentSet.iterator(); iterator.hasNext();) { @@ -1120,6 +1142,17 @@ public class OoOJavaAnalysis { // collects effects of stall site and generates stall site node Hashtable> taint2Effects = effectsAnalysis.get(fn); + // jjenista - I think the following code is WRONG!!! + // We are looking at some non-task FlatNode fn that is a stall site and + // considering what conflicts it might have with CHILDREN of the CURRENT TASK + // that contains fn. WE SHOULD NOT BE GETTING THE PARENT OF currentSESE + // because in this scenario currentSESE IS the parent in relation to other + // tasks that might conflict with this fn. + // OK, why not fix it? Because code all over the place is built on + // being able to retrieve the correct conflict graph, which is associated + // with the wrong task, but at least consistently, SO LEAVE IT BUT REALIZE + // WHAT IS HAPPENING + Set parentSet = currentSESE.getSESEParent(); for (Iterator iterator = parentSet.iterator(); iterator.hasNext();) { FlatSESEEnterNode parent = (FlatSESEEnterNode) iterator.next(); diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index 8311bff2..6f13a586 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -175,12 +175,20 @@ public class RuntimeConflictResolver { CodePlan cp = oooa.getCodePlan(fn); fsen = cp.getCurrentSESE(); + // jjenista - I think the following code is WRONG!!! (but right... :( ) + // see note in OoOJavaAnalysis.java explaining that conflict graphs are + // correct but stored in a parent's parent by mistake, and then in places + // like this we look to the parent's parent for the correct conflict graph. + // It should be oooa.getConflictGraph(fsen) which is the task enclosing the + // stall site, and who's children might conflict with the stall site. + // DON'T CHANGE IT unless you are willing to find the many, many dependent + // code sections based on this behavior, but understand what is happening. + if( fsen.getSESEParent().size() != 0 && (parentSESE = (FlatSESEEnterNode)fsen.getSESEParent().iterator().next()) != null && (conflictGraph = oooa.getConflictGraph(parentSESE)) != null && (conflicts = conflictGraph.getConflictEffectSet(fn)) != null && - //TODO this still uses the old method of getting reachGraphs. - (rg = disjointAnaylsis.getReachGraph(fsen.getmdEnclosing())) != null ){ + (rg = disjointAnaylsis.getEnterReachGraph(fn)) != null ){ Set seseLockSet = oooa.getLockMappings(conflictGraph); Set waitingElementSet = @@ -858,7 +866,7 @@ public class RuntimeConflictResolver { for (Taint t : taints) { flatnode = (isStallSite) ? t.getStallSite():t.getSESE(); - + if( flatnode != null && flatnode.equals(fn) && t.getVar().equals(var.getTempDescriptor())) {