Mercurial > hg > graal-jvmci-8
changeset 21747:9b7e1235fefc
added SnippetCounter.add() method
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 05 Jun 2015 17:08:27 +0200 |
parents | 372fd062bb85 |
children | 7e1f73635264 |
files | graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounter.java |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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() {