| 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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 | 1392 |
| 1393 // TODO(1603): The class should be marked as abstract. | 1393 // TODO(1603): The class should be marked as abstract. |
| 1394 abstract BinaryOperation get operation(); | 1394 abstract BinaryOperation get operation(); |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 class HAdd extends HBinaryArithmetic { | 1397 class HAdd extends HBinaryArithmetic { |
| 1398 HAdd(HStatic target, HInstruction left, HInstruction right) | 1398 HAdd(HStatic target, HInstruction left, HInstruction right) |
| 1399 : super(target, left, right); | 1399 : super(target, left, right); |
| 1400 accept(HVisitor visitor) => visitor.visitAdd(this); | 1400 accept(HVisitor visitor) => visitor.visitAdd(this); |
| 1401 | 1401 |
| 1402 bool get builtin() => left.isNumber() && right.isNumber(); | |
| 1403 | |
| 1404 HType computeTypeFromInputTypes() { | 1402 HType computeTypeFromInputTypes() { |
| 1405 if (left.isInteger() && right.isInteger()) return left.propagatedType; | 1403 if (left.isInteger() && right.isInteger()) return left.propagatedType; |
| 1406 if (left.isNumber()) { | 1404 if (left.isNumber()) { |
| 1407 if (left.isDouble() || right.isDouble()) return HType.DOUBLE; | 1405 if (left.isDouble() || right.isDouble()) return HType.DOUBLE; |
| 1408 return HType.NUMBER; | 1406 return HType.NUMBER; |
| 1409 } | 1407 } |
| 1410 return HType.UNKNOWN; | 1408 return HType.UNKNOWN; |
| 1411 } | 1409 } |
| 1412 | 1410 |
| 1413 HType computeDesiredTypeForNonTargetInput(HInstruction input) { | 1411 HType computeDesiredTypeForNonTargetInput(HInstruction input) { |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 HBasicBlock get start() => expression.start; | 2582 HBasicBlock get start() => expression.start; |
| 2585 HBasicBlock get end() { | 2583 HBasicBlock get end() { |
| 2586 // We don't create a switch block if there are no cases. | 2584 // We don't create a switch block if there are no cases. |
| 2587 assert(!statements.isEmpty()); | 2585 assert(!statements.isEmpty()); |
| 2588 return statements.last().end; | 2586 return statements.last().end; |
| 2589 } | 2587 } |
| 2590 | 2588 |
| 2591 bool accept(HStatementInformationVisitor visitor) => | 2589 bool accept(HStatementInformationVisitor visitor) => |
| 2592 visitor.visitSwitchInfo(this); | 2590 visitor.visitSwitchInfo(this); |
| 2593 } | 2591 } |
| OLD | NEW |