# HG changeset patch # User Tom Rodriguez # Date 1393350587 28800 # Node ID 5558674018506132145ef6eda6885d11ea0f27f6 # Parent 0354f629431a09ae8d6b211901fc179bc9cd37c6 Make Debug.metric objects static diff -r 0354f629431a -r 555867401850 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Tue Feb 25 13:36:18 2014 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Tue Feb 25 09:49:47 2014 -0800 @@ -165,6 +165,11 @@ return toValue(state.lockAt(i)); } + private static final DebugMetric STATE_VIRTUAL_OBJECTS = Debug.metric("StateVirtualObjects"); + private static final DebugMetric STATE_ILLEGALS = Debug.metric("StateIllegals"); + private static final DebugMetric STATE_VARIABLES = Debug.metric("StateVariables"); + private static final DebugMetric STATE_CONSTANTS = Debug.metric("StateConstants"); + protected Value toValue(ValueNode value) { if (value instanceof VirtualObjectNode) { VirtualObjectNode obj = (VirtualObjectNode) value; @@ -182,22 +187,22 @@ vobject = VirtualObject.get(obj.type(), null, virtualObjects.size()); virtualObjects.put(obj, vobject); } - Debug.metric("StateVirtualObjects").increment(); + STATE_VIRTUAL_OBJECTS.increment(); return vobject; } } else if (value instanceof ConstantNode) { - Debug.metric("StateConstants").increment(); + STATE_CONSTANTS.increment(); return ((ConstantNode) value).getValue(); } else if (value != null) { - Debug.metric("StateVariables").increment(); + STATE_VARIABLES.increment(); Value operand = nodeOperands.get(value); assert operand != null && (operand instanceof Variable || operand instanceof Constant) : operand + " for " + value; return operand; } else { // return a dummy value because real value not needed - Debug.metric("StateIllegals").increment(); + STATE_ILLEGALS.increment(); return Value.ILLEGAL; } } diff -r 0354f629431a -r 555867401850 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Tue Feb 25 13:36:18 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Tue Feb 25 09:49:47 2014 -0800 @@ -52,6 +52,8 @@ public class CompilationTask implements Runnable, Comparable { + private static final DebugMetric BAILOUTS = Debug.metric("Bailouts"); + public static final ThreadLocal withinEnqueue = new ThreadLocal() { @Override @@ -254,7 +256,7 @@ } stats.finish(method); } catch (BailoutException bailout) { - Debug.metric("Bailouts").increment(); + BAILOUTS.increment(); if (ExitVMOnBailout.getValue()) { TTY.cachedOut.println(MetaUtil.format("Bailout in %H.%n(%p)", method)); bailout.printStackTrace(TTY.cachedOut); diff -r 0354f629431a -r 555867401850 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue Feb 25 13:36:18 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue Feb 25 09:49:47 2014 -0800 @@ -1049,6 +1049,8 @@ } } + private static final DebugMetric EXPLICIT_EXCEPTIONS = Debug.metric("ExplicitExceptions"); + protected void emitExplicitExceptions(ValueNode receiver, ValueNode outOfBoundsIndex) { assert receiver != null; if (graphBuilderConfig.omitAllExceptionEdges() || (optimisticOpts.useExceptionProbabilityForOperations() && profilingInfo.getExceptionSeen(bci()) == TriState.FALSE)) { @@ -1060,7 +1062,7 @@ ValueNode length = append(new ArrayLengthNode(receiver)); emitBoundsCheck(outOfBoundsIndex, length); } - Debug.metric("ExplicitExceptions").increment(); + EXPLICIT_EXCEPTIONS.increment(); } private void genPutField(JavaField field) { diff -r 0354f629431a -r 555867401850 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Tue Feb 25 13:36:18 2014 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Tue Feb 25 09:49:47 2014 -0800 @@ -45,6 +45,8 @@ private ControlFlowOptimizer() { } + private static final DebugMetric BLOCKS_DELETED = Debug.metric("BlocksDeleted"); + /** * Checks whether a block can be deleted. Only blocks with exactly one successor and an * unconditional branch to this successor are eligable. @@ -102,7 +104,7 @@ alignBlock(lir, other); } - Debug.metric("BlocksDeleted").increment(); + BLOCKS_DELETED.increment(); iterator.remove(); } }