keep track of which reduction created each result (if any)
[sbp.git] / src / edu / berkeley / sbp / Node.java
index ccc2516..740d8a6 100644 (file)
@@ -74,7 +74,7 @@ final class Node
         if (r.numPops()!=0)  reduce(r, r.numPops()-1, phase(), only);
         else {
             Input.Region region = phase().getLocation().createRegion(phase().getLocation());
-            new Result(r.rewrite(region), this, r, phase());
+            Result.newResult(r.rewrite(region), this, r, phase());
         }
     }
 
@@ -95,13 +95,13 @@ final class Node
         holder[pos] = old;
     }
 
-    Node(GSS.Phase phase, Result result, State state, boolean fromEmptyReduction) {
+    Node(GSS.Phase phase, Result pred, State state, boolean fromEmptyReduction) {
         this.phase = phase;
         this.state = state;
         this.fromEmptyReduction = fromEmptyReduction;
-        if (phase.hash.get(state, result.phase()) != null) throw new Error("severe problem!");
-        phase.hash.put(state, result.phase(), this);
-        addResult(result);
+        if (phase.hash.get(state, pred.phase()) != null) throw new Error("severe problem!");
+        phase.hash.put(state, pred.phase(), this);
+        addResult(pred);
         state.invokeEpsilonReductions(phase().token, this);
     }