comparison graal/com.oracle.truffle.object/src/com/oracle/truffle/object/Locations.java @ 18795:e9cbe1618733

Truffle: refactor size calculation in location allocator to visitor pattern
author Andreas Woess <andreas.woess@jku.at>
date Wed, 07 Jan 2015 15:11:38 +0100
parents 2c3666f44855
children
comparison
equal deleted inserted replaced
18794:e688e42b41e3 18795:e9cbe1618733
95 } 95 }
96 96
97 @Override 97 @Override
98 public String toString() { 98 public String toString() {
99 return "=" + String.valueOf(value); 99 return "=" + String.valueOf(value);
100 }
101
102 @Override
103 public final void accept(LocationVisitor locationVisitor) {
100 } 104 }
101 } 105 }
102 106
103 public static final class ConstantLocation extends ValueLocation { 107 public static final class ConstantLocation extends ValueLocation {
104 108
202 public int objectArrayCount() { 206 public int objectArrayCount() {
203 return ((LocationImpl) objectLocation).objectArrayCount(); 207 return ((LocationImpl) objectLocation).objectArrayCount();
204 } 208 }
205 209
206 @Override 210 @Override
211 public final void accept(LocationVisitor locationVisitor) {
212 ((LocationImpl) primitiveLocation).accept(locationVisitor);
213 ((LocationImpl) objectLocation).accept(locationVisitor);
214 }
215
216 @Override
207 public String toString() { 217 public String toString() {
208 return objectLocation.toString() + "," + primitiveLocation.toString() + "," + type; 218 return objectLocation.toString() + "," + primitiveLocation.toString() + "," + type;
209 } 219 }
210 220
211 @Override 221 @Override