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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 accept(HVisitor visitor) => visitor.visitFieldGet(this); | 1304 accept(HVisitor visitor) => visitor.visitFieldGet(this); |
1305 | 1305 |
1306 void prepareGvn() { | 1306 void prepareGvn() { |
1307 setUseGvn(); | 1307 setUseGvn(); |
1308 if (!isFinalOrConst) setDependsOnSomething(); | 1308 if (!isFinalOrConst) setDependsOnSomething(); |
1309 } | 1309 } |
1310 | 1310 |
1311 int typeCode() => 27; | 1311 int typeCode() => 27; |
1312 bool typeEquals(other) => other is HFieldGet; | 1312 bool typeEquals(other) => other is HFieldGet; |
1313 bool dataEquals(HFieldGet other) => element == other.element; | 1313 bool dataEquals(HFieldGet other) => element == other.element; |
1314 String toString() => "FieldGet $element.name"; | 1314 String toString() => "FieldGet $element"; |
1315 } | 1315 } |
1316 | 1316 |
1317 class HFieldSet extends HFieldAccess { | 1317 class HFieldSet extends HFieldAccess { |
1318 HFieldSet(Element element, HInstruction receiver, HInstruction value) | 1318 HFieldSet(Element element, HInstruction receiver, HInstruction value) |
1319 : super(element, <HInstruction>[receiver, value]); | 1319 : super(element, <HInstruction>[receiver, value]); |
1320 | 1320 |
1321 HInstruction get receiver() => inputs[0]; | 1321 HInstruction get receiver() => inputs[0]; |
1322 HInstruction get value() => inputs[1]; | 1322 HInstruction get value() => inputs[1]; |
1323 accept(HVisitor visitor) => visitor.visitFieldSet(this); | 1323 accept(HVisitor visitor) => visitor.visitFieldSet(this); |
1324 | 1324 |
1325 void prepareGvn() { | 1325 void prepareGvn() { |
1326 // TODO(ngeoffray): implement more fine grained side effects. | 1326 // TODO(ngeoffray): implement more fine grained side effects. |
1327 setAllSideEffects(); | 1327 setAllSideEffects(); |
1328 } | 1328 } |
1329 | 1329 |
1330 final bool isStatement = true; | 1330 final bool isStatement = true; |
1331 String toString() => "FieldSet $element.name"; | 1331 String toString() => "FieldSet $element"; |
1332 } | 1332 } |
1333 | 1333 |
1334 class HLocalGet extends HFieldGet { | 1334 class HLocalGet extends HFieldGet { |
1335 HLocalGet(Element element, HLocalValue local) : super(element, local); | 1335 HLocalGet(Element element, HLocalValue local) : super(element, local); |
1336 | 1336 |
1337 accept(HVisitor visitor) => visitor.visitLocalGet(this); | 1337 accept(HVisitor visitor) => visitor.visitLocalGet(this); |
1338 | 1338 |
1339 HLocalValue get local() => inputs[0]; | 1339 HLocalValue get local() => inputs[0]; |
1340 | 1340 |
1341 void prepareGvn() { | 1341 void prepareGvn() { |
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2660 HBasicBlock get start() => expression.start; | 2660 HBasicBlock get start() => expression.start; |
2661 HBasicBlock get end() { | 2661 HBasicBlock get end() { |
2662 // We don't create a switch block if there are no cases. | 2662 // We don't create a switch block if there are no cases. |
2663 assert(!statements.isEmpty()); | 2663 assert(!statements.isEmpty()); |
2664 return statements.last().end; | 2664 return statements.last().end; |
2665 } | 2665 } |
2666 | 2666 |
2667 bool accept(HStatementInformationVisitor visitor) => | 2667 bool accept(HStatementInformationVisitor visitor) => |
2668 visitor.visitSwitchInfo(this); | 2668 visitor.visitSwitchInfo(this); |
2669 } | 2669 } |
OLD | NEW |