diff graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Transition.java @ 18625:073e7f314516

OM: add Transition#isDirect()
author Andreas Woess <andreas.woess@jku.at>
date Thu, 04 Dec 2014 19:24:14 +0100
parents b3b241bbbbdb
children ce46f909c176
line wrap: on
line diff
--- a/graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Transition.java	Thu Dec 04 14:42:33 2014 +0100
+++ b/graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Transition.java	Thu Dec 04 19:24:14 2014 +0100
@@ -47,6 +47,8 @@
         return true;
     }
 
+    public abstract boolean isDirect();
+
     public abstract static class PropertyTransition extends Transition {
         private final Property property;
 
@@ -83,12 +85,22 @@
         public AddPropertyTransition(Property property) {
             super(property);
         }
+
+        @Override
+        public boolean isDirect() {
+            return true;
+        }
     }
 
     public static final class RemovePropertyTransition extends PropertyTransition {
         public RemovePropertyTransition(Property property) {
             super(property);
         }
+
+        @Override
+        public boolean isDirect() {
+            return false;
+        }
     }
 
     public static final class ObjectTypeTransition extends Transition {
@@ -114,6 +126,11 @@
             result = prime * result + ((objectType == null) ? 0 : objectType.hashCode());
             return result;
         }
+
+        @Override
+        public boolean isDirect() {
+            return true;
+        }
     }
 
     public static final class PropertyTypeTransition extends PropertyTransition {
@@ -131,11 +148,21 @@
         public Property getPropertyAfter() {
             return after;
         }
+
+        @Override
+        public boolean isDirect() {
+            return false;
+        }
     }
 
     public static final class ReservePrimitiveArrayTransition extends Transition {
         public ReservePrimitiveArrayTransition() {
         }
+
+        @Override
+        public boolean isDirect() {
+            return true;
+        }
     }
 
     public String getShortName() {