From: megacz Date: Sun, 15 Mar 2009 01:19:45 +0000 (-0700) Subject: refactoring in dataflow X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ae51f2527228add7cc93f0e96ac26ed2acba4893;p=fleet.git refactoring in dataflow --- diff --git a/src/edu/berkeley/fleet/dataflow/DataFlowGraph.java b/src/edu/berkeley/fleet/dataflow/DataFlowGraph.java index 6d4a5fd..1510a7b 100644 --- a/src/edu/berkeley/fleet/dataflow/DataFlowGraph.java +++ b/src/edu/berkeley/fleet/dataflow/DataFlowGraph.java @@ -25,6 +25,10 @@ public class DataFlowGraph { public final Fleet fleet; public final ShipPool pool; + private HashSet nodes = new HashSet(); + + public static int reset_count = 0; + public static HashSet torpedoes = new HashSet(); public DataFlowGraph(Fleet fleet) { this(fleet, new ShipPool(fleet)); @@ -34,14 +38,7 @@ public class DataFlowGraph { this.pool = pool; } - public void addNode(Node node) { - this.nodes.add(node); - } - - public static int reset_count = 0; - public static HashSet torpedoes = new HashSet(); - - private HashSet nodes = new HashSet(); + public void addNode(Node node) { this.nodes.add(node); } public void build(Context ctx) { for(Node mod : nodes) @@ -53,76 +50,6 @@ public class DataFlowGraph { for(Node mod : nodes) mod.reset(ctx, phase, ackDestination); } - - BitVector bv(long l) { return new BitVector(fleet.getWordWidth()).set(l); } - BitVector[] bv(long[] l) { - BitVector[] ret = new BitVector[l.length]; - for(int i=0; i