Mercurial > hg > truffle
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBlockNode.java @ 13882:afd6fa5e8229
SL: Feedback from reviewers
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Wed, 05 Feb 2014 08:02:15 -0800 |
parents | 64c77f0577bb |
children | a08b8694f556 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBlockNode.java Wed Feb 05 15:50:36 2014 +0100 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/controlflow/SLBlockNode.java Wed Feb 05 08:02:15 2014 -0800 @@ -22,6 +22,7 @@ */ package com.oracle.truffle.sl.nodes.controlflow; +import com.oracle.truffle.api.*; import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.sl.nodes.*; @@ -30,7 +31,7 @@ * A statement node that just executes a list of other statements. */ @NodeInfo(shortName = "block") -public class SLBlockNode extends SLStatementNode { +public final class SLBlockNode extends SLStatementNode { /** * The array of child nodes. The annotation {@link com.oracle.truffle.api.nodes.Node.Children @@ -55,6 +56,12 @@ @Override @ExplodeLoop public void executeVoid(VirtualFrame frame) { + /* + * This assertion illustrates that the arryay length is really a constant during + * compilation. + */ + CompilerAsserts.compilationConstant(bodyNodes.length); + for (SLStatementNode statement : bodyNodes) { statement.executeVoid(frame); }