Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java @ 17207:5a7b82c1514e
[SPARC] Add functionality to be able to do assembly in two passes (knowing offsets of forward branches)
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Wed, 24 Sep 2014 16:13:34 -0700 |
parents | 36d7c19ff005 |
children | 27943aac2e3c |
line wrap: on
line diff
--- a/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java Tue Sep 23 12:12:26 2014 -0700 +++ b/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Label.java Wed Sep 24 16:13:34 2014 -0700 @@ -40,7 +40,7 @@ /** * Returns the position of this label in the code buffer. - * + * * @return the position */ public int position() { @@ -61,7 +61,7 @@ /** * Binds the label to the specified position. - * + * * @param pos the position */ protected void bind(int pos) { @@ -92,6 +92,13 @@ } } + public void reset() { + if (this.patchPositions != null) { + this.patchPositions.clear(); + } + this.position = -1; + } + @Override public String toString() { return isBound() ? String.valueOf(position()) : "?";