# HG changeset patch # User Christian Humer # Date 1408815086 -7200 # Node ID ee4fde70df193187fe566440aa07f28c19d6e430 # Parent c9437b07c26a69f1305924c838a8e6f9a81ac155 SL: local variable nodes should use contains to avoid polymorphism. diff -r c9437b07c26a -r ee4fde70df19 graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.java Sat Aug 23 19:31:22 2014 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.java Sat Aug 23 19:31:26 2014 +0200 @@ -57,7 +57,7 @@ return frame.getBoolean(getSlot()); } - @Specialization(order = 1, rewriteOn = FrameSlotTypeException.class) + @Specialization(rewriteOn = FrameSlotTypeException.class) protected Object readObject(VirtualFrame frame) throws FrameSlotTypeException { return frame.getObject(getSlot()); } @@ -66,7 +66,7 @@ * This is the generic case that always succeeds. Since we already have another specialization * with the same signature above, we need to order them explicitly with the order attribute. */ - @Specialization(order = 2) + @Specialization(contains = {"readLong", "readBoolean", "readObject"}) protected Object read(VirtualFrame frame) { return frame.getValue(getSlot()); } diff -r c9437b07c26a -r ee4fde70df19 graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLWriteLocalVariableNode.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLWriteLocalVariableNode.java Sat Aug 23 19:31:22 2014 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLWriteLocalVariableNode.java Sat Aug 23 19:31:26 2014 +0200 @@ -52,13 +52,13 @@ * {@link #isLongKind() custom guard} is specified. */ @Specialization(guards = "isLongKind") - protected long write(VirtualFrame frame, long value) { + protected long writeLong(VirtualFrame frame, long value) { frame.setLong(getSlot(), value); return value; } @Specialization(guards = "isBooleanKind") - protected boolean write(VirtualFrame frame, boolean value) { + protected boolean writeBoolean(VirtualFrame frame, boolean value) { frame.setBoolean(getSlot(), value); return value; } @@ -73,7 +73,7 @@ * {@link Object}, it is guaranteed to never fail, i.e., once we are in this specialization the * node will never be re-specialized. */ - @Specialization + @Specialization(contains = {"writeLong", "writeBoolean"}) protected Object write(VirtualFrame frame, Object value) { if (getSlot().getKind() != FrameSlotKind.Object) { /*