Chromium Code Reviews| 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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1517 bool dataEquals(HInstruction other) => true; | 1517 bool dataEquals(HInstruction other) => true; |
| 1518 } | 1518 } |
| 1519 | 1519 |
| 1520 | 1520 |
| 1521 // TODO(floitsch): Should HBinaryArithmetic really be the super class of | 1521 // TODO(floitsch): Should HBinaryArithmetic really be the super class of |
| 1522 // HBinaryBitOp? | 1522 // HBinaryBitOp? |
| 1523 class HBinaryBitOp extends HBinaryArithmetic { | 1523 class HBinaryBitOp extends HBinaryArithmetic { |
| 1524 HBinaryBitOp(HStatic target, HInstruction left, HInstruction right) | 1524 HBinaryBitOp(HStatic target, HInstruction left, HInstruction right) |
| 1525 : super(target, left, right); | 1525 : super(target, left, right); |
| 1526 | 1526 |
| 1527 bool get builtin() => left.isInteger() && right.isInteger(); | 1527 bool get builtin() => left.isNumber() && right.isNumber(); |
|
kasperl
2012/06/21 08:58:29
Can we just remove the method and use the one in H
Mads Ager (google)
2012/06/21 10:25:31
Of course. Thanks!
| |
| 1528 | 1528 |
| 1529 HType computeTypeFromInputTypes() { | 1529 HType computeTypeFromInputTypes() { |
| 1530 // All bitwise operations on primitive types either produce an | 1530 // All bitwise operations on primitive types either produce an |
| 1531 // integer or throw an error. | 1531 // integer or throw an error. |
| 1532 if (left.isPrimitive()) return HType.INTEGER; | 1532 if (left.isPrimitive()) return HType.INTEGER; |
| 1533 return HType.UNKNOWN; | 1533 return HType.UNKNOWN; |
| 1534 } | 1534 } |
| 1535 | 1535 |
| 1536 HType computeDesiredTypeForNonTargetInput(HInstruction input) { | 1536 HType computeDesiredTypeForNonTargetInput(HInstruction input) { |
| 1537 // If the outgoing type should be a number we can get that only if both | 1537 // If the outgoing type should be a number we can get that only if both |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2622 HBasicBlock get start() => expression.start; | 2622 HBasicBlock get start() => expression.start; |
| 2623 HBasicBlock get end() { | 2623 HBasicBlock get end() { |
| 2624 // We don't create a switch block if there are no cases. | 2624 // We don't create a switch block if there are no cases. |
| 2625 assert(!statements.isEmpty()); | 2625 assert(!statements.isEmpty()); |
| 2626 return statements.last().end; | 2626 return statements.last().end; |
| 2627 } | 2627 } |
| 2628 | 2628 |
| 2629 bool accept(HStatementInformationVisitor visitor) => | 2629 bool accept(HStatementInformationVisitor visitor) => |
| 2630 visitor.visitSwitchInfo(this); | 2630 visitor.visitSwitchInfo(this); |
| 2631 } | 2631 } |
| OLD | NEW |