# HG changeset patch # User Lukas Stadler # Date 1363869345 -3600 # Node ID f94baf373bcf18d5133fa2fd54c836379a2c7ddf # Parent e5da6c59d7c939d4d982660ffa3c4ce48373d2e1 add increment size to DynamicCounterNode diff -r e5da6c59d7c9 -r f94baf373bcf graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java Wed Mar 27 14:58:29 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java Thu Mar 21 13:35:45 2013 +0100 @@ -46,11 +46,13 @@ private static final long[] COUNTERS = new long[MAX_COUNTERS]; private static final HashMap INDEXES = new HashMap<>(); private final String name; + private final long increment; private final boolean addContext; - public DynamicCounterNode(String name, boolean addContext) { + public DynamicCounterNode(String name, long increment, boolean addContext) { super(StampFactory.forVoid()); this.name = name; + this.increment = increment; this.addContext = addContext; } @@ -104,7 +106,7 @@ ConstantNode arrayConstant = ConstantNode.forObject(COUNTERS, tool.getRuntime(), graph); ConstantNode indexConstant = ConstantNode.forInt(index, graph); LoadIndexedNode load = graph.add(new LoadIndexedNode(arrayConstant, indexConstant, Kind.Long)); - IntegerAddNode add = graph.add(new IntegerAddNode(Kind.Long, load, ConstantNode.forLong(1, graph))); + IntegerAddNode add = graph.add(new IntegerAddNode(Kind.Long, load, ConstantNode.forLong(increment, graph))); StoreIndexedNode store = graph.add(new StoreIndexedNode(arrayConstant, indexConstant, Kind.Long, add)); graph.addBeforeFixed(this, load); @@ -112,9 +114,9 @@ graph.removeFixed(this); } - public static void createCounter(String name, FixedNode before, boolean addContext) { + public static void createCounter(String name, FixedNode before, long increment, boolean addContext) { StructuredGraph graph = (StructuredGraph) before.graph(); - DynamicCounterNode counter = graph.add(new DynamicCounterNode(name, addContext)); + DynamicCounterNode counter = graph.add(new DynamicCounterNode(name, increment, addContext)); graph.addBeforeFixed(before, counter); } }