| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 visitBailoutTarget(HBailoutTarget node); | 7 R visitBailoutTarget(HBailoutTarget node); |
| 8 R visitBitAnd(HBitAnd node); | 8 R visitBitAnd(HBitAnd node); |
| 9 R visitBitNot(HBitNot node); | 9 R visitBitNot(HBitNot node); |
| 10 R visitBitOr(HBitOr node); | 10 R visitBitOr(HBitOr node); |
| (...skipping 2038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 return value.type; | 2049 return value.type; |
| 2050 } | 2050 } |
| 2051 | 2051 |
| 2052 HType computeDesiredInputType(HInstruction input) { | 2052 HType computeDesiredInputType(HInstruction input) { |
| 2053 // TODO(floitsch): we want the target to be a function. | 2053 // TODO(floitsch): we want the target to be a function. |
| 2054 if (input == target) return HType.UNKNOWN; | 2054 if (input == target) return HType.UNKNOWN; |
| 2055 if (input == receiver) return HType.ARRAY; | 2055 if (input == receiver) return HType.ARRAY; |
| 2056 return HType.UNKNOWN; | 2056 return HType.UNKNOWN; |
| 2057 } | 2057 } |
| 2058 | 2058 |
| 2059 bool hasExpectedType() => value.hasExpectedType(); | 2059 // This instruction does not yield a new value, so it always |
| 2060 // has the expected type (void). |
| 2061 bool hasExpectedType() => true; |
| 2060 } | 2062 } |
| 2061 | 2063 |
| 2062 class HNonSsaInstruction extends HInstruction { | 2064 class HNonSsaInstruction extends HInstruction { |
| 2063 HNonSsaInstruction(inputs) : super(inputs); | 2065 HNonSsaInstruction(inputs) : super(inputs); |
| 2064 // Non-SSA instructions cannot take part in GVN. | 2066 // Non-SSA instructions cannot take part in GVN. |
| 2065 void prepareGvn() { unreachable(); } | 2067 void prepareGvn() { unreachable(); } |
| 2066 bool useGvn() { unreachable(); } | 2068 bool useGvn() { unreachable(); } |
| 2067 void setUseGvn() { unreachable(); } | 2069 void setUseGvn() { unreachable(); } |
| 2068 | 2070 |
| 2069 // TODO(floitsch): make class abstract instead of adding an abstract method. | 2071 // TODO(floitsch): make class abstract instead of adding an abstract method. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2131 class HIfBlockInformation { | 2133 class HIfBlockInformation { |
| 2132 final HIf branch; | 2134 final HIf branch; |
| 2133 final SubGraph thenGraph; | 2135 final SubGraph thenGraph; |
| 2134 final SubGraph elseGraph; | 2136 final SubGraph elseGraph; |
| 2135 final HBasicBlock joinBlock; | 2137 final HBasicBlock joinBlock; |
| 2136 HIfBlockInformation(this.branch, | 2138 HIfBlockInformation(this.branch, |
| 2137 this.thenGraph, | 2139 this.thenGraph, |
| 2138 this.elseGraph, | 2140 this.elseGraph, |
| 2139 this.joinBlock); | 2141 this.joinBlock); |
| 2140 } | 2142 } |
| OLD | NEW |