Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ReadLocalNode.java @ 12752:71991b7a0f14
SL: Enhanced SimpleLanguage with support for if statements, function calls, function caching + inlining and builtins.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 11 Nov 2013 21:34:44 +0100 |
parents | 269e6794e1ec |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ReadLocalNode.java Thu Nov 07 20:55:13 2013 +0100 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ReadLocalNode.java Mon Nov 11 21:34:44 2013 +0100 @@ -25,6 +25,7 @@ import com.oracle.truffle.api.dsl.*; import com.oracle.truffle.api.frame.*; +@PolymorphicLimit(1) public abstract class ReadLocalNode extends FrameSlotNode { public ReadLocalNode(FrameSlot slot) { @@ -45,13 +46,14 @@ return frame.getBoolean(slot); } - @Specialization - public Object doObject(VirtualFrame frame) { - try { - return frame.getObject(slot); - } catch (FrameSlotTypeException e) { - throw new IllegalStateException(); - } + @Specialization(rewriteOn = {FrameSlotTypeException.class}) + public Object doObject(VirtualFrame frame) throws FrameSlotTypeException { + return frame.getObject(slot); + } + + @Generic + public Object doGeneric(VirtualFrame frame) { + return frame.getValue(slot); } }