changeset 16911:ee4fde70df19

SL: local variable nodes should use contains to avoid polymorphism.
author Christian Humer <christian.humer@gmail.com>
date Sat, 23 Aug 2014 19:31:26 +0200
parents c9437b07c26a
children f8998c828bed
files graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLReadLocalVariableNode.java graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/local/SLWriteLocalVariableNode.java
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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());
     }
--- 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) {
             /*