| 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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 class HShiftLeft extends HBinaryBitOp { | 1569 class HShiftLeft extends HBinaryBitOp { |
| 1570 HShiftLeft(HStatic target, HInstruction left, HInstruction right) | 1570 HShiftLeft(HStatic target, HInstruction left, HInstruction right) |
| 1571 : super(target, left, right); | 1571 : super(target, left, right); |
| 1572 accept(HVisitor visitor) => visitor.visitShiftLeft(this); | 1572 accept(HVisitor visitor) => visitor.visitShiftLeft(this); |
| 1573 | 1573 |
| 1574 // Shift left cannot be mapped to the native operator unless the | 1574 // Shift left cannot be mapped to the native operator unless the |
| 1575 // shift count is guaranteed to be an integer in the [0,31] range. | 1575 // shift count is guaranteed to be an integer in the [0,31] range. |
| 1576 bool get builtin() { | 1576 bool get builtin() { |
| 1577 if (!left.isInteger() || !right.isConstantInteger()) return false; | 1577 if (!left.isInteger() || !right.isConstantInteger()) return false; |
| 1578 HConstant rightConstant = right; | 1578 HConstant rightConstant = right; |
| 1579 int count = rightConstant.constant.value; | 1579 IntConstant intConstant = rightConstant.constant; |
| 1580 int count = intConstant.value; |
| 1580 return count >= 0 && count <= 31; | 1581 return count >= 0 && count <= 31; |
| 1581 } | 1582 } |
| 1582 | 1583 |
| 1583 ShiftLeftOperation get operation() => const ShiftLeftOperation(); | 1584 ShiftLeftOperation get operation() => const ShiftLeftOperation(); |
| 1584 int typeCode() => 11; | 1585 int typeCode() => 11; |
| 1585 bool typeEquals(other) => other is HShiftLeft; | 1586 bool typeEquals(other) => other is HShiftLeft; |
| 1586 bool dataEquals(HInstruction other) => true; | 1587 bool dataEquals(HInstruction other) => true; |
| 1587 } | 1588 } |
| 1588 | 1589 |
| 1589 class HShiftRight extends HBinaryBitOp { | 1590 class HShiftRight extends HBinaryBitOp { |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 HBasicBlock get start() => expression.start; | 2631 HBasicBlock get start() => expression.start; |
| 2631 HBasicBlock get end() { | 2632 HBasicBlock get end() { |
| 2632 // We don't create a switch block if there are no cases. | 2633 // We don't create a switch block if there are no cases. |
| 2633 assert(!statements.isEmpty()); | 2634 assert(!statements.isEmpty()); |
| 2634 return statements.last().end; | 2635 return statements.last().end; |
| 2635 } | 2636 } |
| 2636 | 2637 |
| 2637 bool accept(HStatementInformationVisitor visitor) => | 2638 bool accept(HStatementInformationVisitor visitor) => |
| 2638 visitor.visitSwitchInfo(this); | 2639 visitor.visitSwitchInfo(this); |
| 2639 } | 2640 } |
| OLD | NEW |