Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.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 | afd6fa5e8229 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.java Thu Jan 30 17:52:24 2014 -0800 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.java Thu Jan 30 17:53:27 2014 -0800 @@ -26,10 +26,21 @@ import com.oracle.truffle.api.frame.*; import com.oracle.truffle.sl.nodes.*; +/** + * Node to read a local variable from a function's {@link VirtualFrame frame}. The Truffle frame API + * allows to store primitive values of all Java primitive types, and Object values. This means that + * all SL types that are objects are handled by the {@link #readObject} method. When a local + * variable changes its type, the frame access method throws an {@link FrameSlotTypeException}, + * which causes not rewriting. The rewriting code is generated by the Truffle DSL. + */ @PolymorphicLimit(1) @NodeField(name = "slot", type = FrameSlot.class) public abstract class SLReadLocalVariableNode extends SLExpressionNode { + /** + * Returns the descriptor of the accessed local variable. The implementation of this method is + * created by the Truffle DSL based on the {@link NodeField} annotation on the class. + */ protected abstract FrameSlot getSlot(); @Specialization(rewriteOn = {FrameSlotTypeException.class})