comparison 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
comparison
equal deleted inserted replaced
18624:a9a14b31f3b3 18625:073e7f314516
45 return false; 45 return false;
46 } 46 }
47 return true; 47 return true;
48 } 48 }
49 49
50 public abstract boolean isDirect();
51
50 public abstract static class PropertyTransition extends Transition { 52 public abstract static class PropertyTransition extends Transition {
51 private final Property property; 53 private final Property property;
52 54
53 public PropertyTransition(Property property) { 55 public PropertyTransition(Property property) {
54 this.property = property; 56 this.property = property;
81 83
82 public static final class AddPropertyTransition extends PropertyTransition { 84 public static final class AddPropertyTransition extends PropertyTransition {
83 public AddPropertyTransition(Property property) { 85 public AddPropertyTransition(Property property) {
84 super(property); 86 super(property);
85 } 87 }
88
89 @Override
90 public boolean isDirect() {
91 return true;
92 }
86 } 93 }
87 94
88 public static final class RemovePropertyTransition extends PropertyTransition { 95 public static final class RemovePropertyTransition extends PropertyTransition {
89 public RemovePropertyTransition(Property property) { 96 public RemovePropertyTransition(Property property) {
90 super(property); 97 super(property);
98 }
99
100 @Override
101 public boolean isDirect() {
102 return false;
91 } 103 }
92 } 104 }
93 105
94 public static final class ObjectTypeTransition extends Transition { 106 public static final class ObjectTypeTransition extends Transition {
95 private final ObjectType objectType; 107 private final ObjectType objectType;
112 final int prime = 31; 124 final int prime = 31;
113 int result = super.hashCode(); 125 int result = super.hashCode();
114 result = prime * result + ((objectType == null) ? 0 : objectType.hashCode()); 126 result = prime * result + ((objectType == null) ? 0 : objectType.hashCode());
115 return result; 127 return result;
116 } 128 }
129
130 @Override
131 public boolean isDirect() {
132 return true;
133 }
117 } 134 }
118 135
119 public static final class PropertyTypeTransition extends PropertyTransition { 136 public static final class PropertyTypeTransition extends PropertyTransition {
120 private final Property after; 137 private final Property after;
121 138
129 } 146 }
130 147
131 public Property getPropertyAfter() { 148 public Property getPropertyAfter() {
132 return after; 149 return after;
133 } 150 }
151
152 @Override
153 public boolean isDirect() {
154 return false;
155 }
134 } 156 }
135 157
136 public static final class ReservePrimitiveArrayTransition extends Transition { 158 public static final class ReservePrimitiveArrayTransition extends Transition {
137 public ReservePrimitiveArrayTransition() { 159 public ReservePrimitiveArrayTransition() {
160 }
161
162 @Override
163 public boolean isDirect() {
164 return true;
138 } 165 }
139 } 166 }
140 167
141 public String getShortName() { 168 public String getShortName() {
142 return this.getClass().getSimpleName().replaceFirst("Transition$", "").toLowerCase(); 169 return this.getClass().getSimpleName().replaceFirst("Transition$", "").toLowerCase();