| 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 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 | 2035 |
| 2036 class HEquals extends HRelational { | 2036 class HEquals extends HRelational { |
| 2037 HEquals(HStatic target, HInstruction left, HInstruction right) | 2037 HEquals(HStatic target, HInstruction left, HInstruction right) |
| 2038 : super(target, left, right); | 2038 : super(target, left, right); |
| 2039 accept(HVisitor visitor) => visitor.visitEquals(this); | 2039 accept(HVisitor visitor) => visitor.visitEquals(this); |
| 2040 | 2040 |
| 2041 bool get builtin() { | 2041 bool get builtin() { |
| 2042 // All primitive types have === semantics. | 2042 // All primitive types have === semantics. |
| 2043 // Note that this includes all constants except the user-constructed | 2043 // Note that this includes all constants except the user-constructed |
| 2044 // objects. | 2044 // objects. |
| 2045 return left.propagatedType.isPrimitive() || | 2045 return left.isConstantNull() || left.propagatedType.isPrimitive(); |
| 2046 left.isConstantNull() || | |
| 2047 right.isConstantNull(); | |
| 2048 } | 2046 } |
| 2049 | 2047 |
| 2050 HType computeTypeFromInputTypes() { | 2048 HType computeTypeFromInputTypes() { |
| 2051 if (builtin || usesBoolifiedInterceptor) return HType.BOOLEAN; | 2049 if (builtin || usesBoolifiedInterceptor) return HType.BOOLEAN; |
| 2052 return HType.UNKNOWN; | 2050 return HType.UNKNOWN; |
| 2053 } | 2051 } |
| 2054 | 2052 |
| 2055 HType computeDesiredTypeForNonTargetInput(HInstruction input) { | 2053 HType computeDesiredTypeForNonTargetInput(HInstruction input) { |
| 2056 if (input == left && right.propagatedType.isUseful()) { | 2054 if (input == left && right.propagatedType.isUseful()) { |
| 2057 // All our useful types have === semantics. But we don't want to | 2055 // All our useful types have === semantics. But we don't want to |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2661 HBasicBlock get start() => expression.start; | 2659 HBasicBlock get start() => expression.start; |
| 2662 HBasicBlock get end() { | 2660 HBasicBlock get end() { |
| 2663 // We don't create a switch block if there are no cases. | 2661 // We don't create a switch block if there are no cases. |
| 2664 assert(!statements.isEmpty()); | 2662 assert(!statements.isEmpty()); |
| 2665 return statements.last().end; | 2663 return statements.last().end; |
| 2666 } | 2664 } |
| 2667 | 2665 |
| 2668 bool accept(HStatementInformationVisitor visitor) => | 2666 bool accept(HStatementInformationVisitor visitor) => |
| 2669 visitor.visitSwitchInfo(this); | 2667 visitor.visitSwitchInfo(this); |
| 2670 } | 2668 } |
| OLD | NEW |