# HG changeset patch # User Doug Simon # Date 1433516907 -7200 # Node ID 9b7e1235fefcee5ce7f5c405896bed61848f30f0 # Parent 372fd062bb85108321887a7673cc4e3561a0f8b6 added SnippetCounter.add() method diff -r 372fd062bb85 -r 9b7e1235fefc graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounter.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounter.java Fri Jun 05 17:07:45 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounter.java Fri Jun 05 17:08:27 2015 +0200 @@ -115,8 +115,8 @@ } /** - * Increments the value of this counter. This method can be safely used in a snippet if it is - * invoked on a compile-time constant {@link SnippetCounter} object. + * Increments the value of this counter. This method can only be used in a snippet on a + * compile-time constant {@link SnippetCounter} object. */ public void inc() { if (group != null) { @@ -125,6 +125,16 @@ } /** + * Increments the value of this counter. This method can only be used in a snippet on a + * compile-time constant {@link SnippetCounter} object. + */ + public void add(int increment) { + if (group != null) { + SnippetCounterNode.add(this, increment); + } + } + + /** * Gets the value of this counter. */ public long value() {