| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 interface HVisitor<R> { | 5 interface HVisitor<R> { |
| 6 R visitAdd(HAdd node); | 6 R visitAdd(HAdd node); |
| 7 R visitBitAnd(HBitAnd node); | 7 R visitBitAnd(HBitAnd node); |
| 8 R visitBitNot(HBitNot node); | 8 R visitBitNot(HBitNot node); |
| 9 R visitBitOr(HBitOr node); | 9 R visitBitOr(HBitOr node); |
| 10 R visitBitXor(HBitXor node); | 10 R visitBitXor(HBitXor node); |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 bool typeEquals(other) => other is HInvokeInterceptor; | 1252 bool typeEquals(other) => other is HInvokeInterceptor; |
| 1253 bool dataEquals(HInvokeInterceptor other) { | 1253 bool dataEquals(HInvokeInterceptor other) { |
| 1254 return getter == other.getter && name == other.name; | 1254 return getter == other.getter && name == other.name; |
| 1255 } | 1255 } |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 abstract class HFieldAccess extends HInstruction { | 1258 abstract class HFieldAccess extends HInstruction { |
| 1259 final Element element; | 1259 final Element element; |
| 1260 | 1260 |
| 1261 HFieldAccess(this.element, List<HInstruction> inputs) : super(inputs); | 1261 HFieldAccess(this.element, List<HInstruction> inputs) : super(inputs); |
| 1262 | |
| 1263 bool isFromActivation() => element === null; | |
| 1264 } | 1262 } |
| 1265 | 1263 |
| 1266 class HFieldGet extends HFieldAccess { | 1264 class HFieldGet extends HFieldAccess { |
| 1267 final bool isFinalOrConst; | 1265 final bool isFinalOrConst; |
| 1268 | 1266 |
| 1269 HFieldGet(Element element, HInstruction receiver, | 1267 HFieldGet(Element element, HInstruction receiver, |
| 1270 [this.isFinalOrConst = false]) | 1268 [this.isFinalOrConst = false]) |
| 1271 : super(element, <HInstruction>[receiver]); | 1269 : super(element, <HInstruction>[receiver]); |
| 1272 HFieldGet.fromActivation(receiver) : this(null, receiver); | |
| 1273 | 1270 |
| 1274 HInstruction get receiver() => inputs[0]; | 1271 HInstruction get receiver() => inputs[0]; |
| 1275 | 1272 |
| 1276 accept(HVisitor visitor) => visitor.visitFieldGet(this); | 1273 accept(HVisitor visitor) => visitor.visitFieldGet(this); |
| 1277 | 1274 |
| 1278 void prepareGvn() { | 1275 void prepareGvn() { |
| 1279 setUseGvn(); | 1276 setUseGvn(); |
| 1280 if (!isFinalOrConst) setDependsOnSomething(); | 1277 if (!isFinalOrConst) setDependsOnSomething(); |
| 1281 } | 1278 } |
| 1282 | 1279 |
| 1283 int typeCode() => 27; | 1280 int typeCode() => 27; |
| 1284 bool typeEquals(other) => other is HFieldGet; | 1281 bool typeEquals(other) => other is HFieldGet; |
| 1285 bool dataEquals(HFieldGet other) => element == other.element; | 1282 bool dataEquals(HFieldGet other) => element == other.element; |
| 1286 } | 1283 } |
| 1287 | 1284 |
| 1288 class HFieldSet extends HFieldAccess { | 1285 class HFieldSet extends HFieldAccess { |
| 1289 HFieldSet(Element element, HInstruction receiver, HInstruction value) | 1286 HFieldSet(Element element, HInstruction receiver, HInstruction value) |
| 1290 : super(element, <HInstruction>[receiver, value]); | 1287 : super(element, <HInstruction>[receiver, value]); |
| 1291 HFieldSet.fromActivation(receiver, value) | |
| 1292 : this(null, receiver, value); | |
| 1293 | 1288 |
| 1294 HInstruction get receiver() => inputs[0]; | 1289 HInstruction get receiver() => inputs[0]; |
| 1295 HInstruction get value() => inputs[1]; | 1290 HInstruction get value() => inputs[1]; |
| 1296 accept(HVisitor visitor) => visitor.visitFieldSet(this); | 1291 accept(HVisitor visitor) => visitor.visitFieldSet(this); |
| 1297 | 1292 |
| 1298 void prepareGvn() { | 1293 void prepareGvn() { |
| 1299 // TODO(ngeoffray): implement more fine grained side effects. | 1294 // TODO(ngeoffray): implement more fine grained side effects. |
| 1300 setAllSideEffects(); | 1295 setAllSideEffects(); |
| 1301 } | 1296 } |
| 1302 | 1297 |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 HBasicBlock get start() => expression.start; | 2625 HBasicBlock get start() => expression.start; |
| 2631 HBasicBlock get end() { | 2626 HBasicBlock get end() { |
| 2632 // We don't create a switch block if there are no cases. | 2627 // We don't create a switch block if there are no cases. |
| 2633 assert(!statements.isEmpty()); | 2628 assert(!statements.isEmpty()); |
| 2634 return statements.last().end; | 2629 return statements.last().end; |
| 2635 } | 2630 } |
| 2636 | 2631 |
| 2637 bool accept(HStatementInformationVisitor visitor) => | 2632 bool accept(HStatementInformationVisitor visitor) => |
| 2638 visitor.visitSwitchInfo(this); | 2633 visitor.visitSwitchInfo(this); |
| 2639 } | 2634 } |
| OLD | NEW |