| 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 import '../compiler.dart' show Compiler; | 5 import '../compiler.dart' show Compiler; |
| 6 import '../constants/values.dart'; | 6 import '../constants/values.dart'; |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../js_backend/js_backend.dart'; | 8 import '../js_backend/js_backend.dart'; |
| 9 import '../types/types.dart'; | 9 import '../types/types.dart'; |
| 10 import '../universe/selector.dart' show Selector; | 10 import '../universe/selector.dart' show Selector; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // t1 = x.f; t2 = t1 op y; x.f = t2; use(t2) --> x.f op= y | 161 // t1 = x.f; t2 = t1 op y; x.f = t2; use(t2) --> x.f op= y |
| 162 // t1 = x.f; t2 = t1 + 1; x.f = t2; use(t1) --> x.f++ | 162 // t1 = x.f; t2 = t1 + 1; x.f = t2; use(t1) --> x.f++ |
| 163 HBasicBlock block = setter.block; | 163 HBasicBlock block = setter.block; |
| 164 HInstruction op = setter.value; | 164 HInstruction op = setter.value; |
| 165 HInstruction receiver = setter.receiver; | 165 HInstruction receiver = setter.receiver; |
| 166 | 166 |
| 167 bool isMatchingRead(HInstruction candidate) { | 167 bool isMatchingRead(HInstruction candidate) { |
| 168 if (candidate is HFieldGet) { | 168 if (candidate is HFieldGet) { |
| 169 if (candidate.element != setter.element) return false; | 169 if (candidate.element != setter.element) return false; |
| 170 if (candidate.receiver != setter.receiver) return false; | 170 if (candidate.receiver != setter.receiver) return false; |
| 171 // Recognize only three instructions in sequence in the same block. Thi
s | 171 // Recognize only three instructions in sequence in the same block. This |
| 172 // could be broadened to allow non-interfering interleaved instructions. | 172 // could be broadened to allow non-interfering interleaved instructions. |
| 173 if (op.block != block) return false; | 173 if (op.block != block) return false; |
| 174 if (candidate.block != block) return false; | 174 if (candidate.block != block) return false; |
| 175 if (setter.previous != op) return false; | 175 if (setter.previous != op) return false; |
| 176 if (op.previous != candidate) return false; | 176 if (op.previous != candidate) return false; |
| 177 return true; | 177 return true; |
| 178 } | 178 } |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 | 181 |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 } | 797 } |
| 798 | 798 |
| 799 // If [thenInput] is defined in the first predecessor, then it is only used | 799 // If [thenInput] is defined in the first predecessor, then it is only used |
| 800 // by [phi] and can be generated at use site. | 800 // by [phi] and can be generated at use site. |
| 801 if (identical(thenInput.block, end.predecessors[0])) { | 801 if (identical(thenInput.block, end.predecessors[0])) { |
| 802 assert(thenInput.usedBy.length == 1); | 802 assert(thenInput.usedBy.length == 1); |
| 803 markAsGenerateAtUseSite(thenInput); | 803 markAsGenerateAtUseSite(thenInput); |
| 804 } | 804 } |
| 805 } | 805 } |
| 806 } | 806 } |
| OLD | NEW |