Mercurial > hg > truffle
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBreakException.java @ 13836:64c77f0577bb
More documentation and improvements of Simple Language
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Thu, 30 Jan 2014 17:53:27 -0800 |
parents | b16ec83edc73 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBreakException.java Thu Jan 30 17:52:24 2014 -0800 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBreakException.java Thu Jan 30 17:53:27 2014 -0800 @@ -24,12 +24,18 @@ import com.oracle.truffle.api.nodes.*; +/** + * Exception thrown by the {@link SLBreakNode break statement} and caught by the {@link SLWhileNode + * loop statement}. Since the exception is stateless, i.e., has no instance fields, we can use a + * {@link #SINGLETON} to avoid memory allocation during interpretation. + */ public final class SLBreakException extends ControlFlowException { public static final SLBreakException SINGLETON = new SLBreakException(); private static final long serialVersionUID = -91013036379258890L; + /* Prevent instantiation from outside. */ private SLBreakException() { } }