Mercurial > hg > truffle
changeset 8546:f94baf373bcf
add increment size to DynamicCounterNode
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 21 Mar 2013 13:35:45 +0100 |
parents | e5da6c59d7c9 |
children | ca29d921a53a |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/debug/DynamicCounterNode.java |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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<String, Integer> 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); } }