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 '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 5 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
6 import '../common/names.dart' show Selectors; | 6 import '../common/names.dart' show Selectors; |
7 import '../common/tasks.dart' show CompilerTask; | 7 import '../common/tasks.dart' show CompilerTask; |
8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
9 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 /// Returns `true` if [mask] represents only types that have a length that | 161 /// Returns `true` if [mask] represents only types that have a length that |
162 /// cannot change. The current implementation is conservative for the purpose | 162 /// cannot change. The current implementation is conservative for the purpose |
163 /// of identifying gvn-able lengths and mis-identifies some unions of fixed | 163 /// of identifying gvn-able lengths and mis-identifies some unions of fixed |
164 /// length indexables (see TODO) as not fixed length. | 164 /// length indexables (see TODO) as not fixed length. |
165 bool isFixedLength(mask, ClosedWorld closedWorld) { | 165 bool isFixedLength(mask, ClosedWorld closedWorld) { |
166 if (mask.isContainer && mask.length != null) { | 166 if (mask.isContainer && mask.length != null) { |
167 // A container on which we have inferred the length. | 167 // A container on which we have inferred the length. |
168 return true; | 168 return true; |
169 } | 169 } |
170 // TODO(sra): Recognize any combination of fixed length indexables. | 170 // TODO(sra): Recognize any combination of fixed length indexables. |
171 if (mask.containsOnly(closedWorld.backendClasses.fixedListClass) || | 171 if (mask.containsOnly(closedWorld.commonElements.jsFixedArrayClass) || |
172 mask.containsOnly(closedWorld.backendClasses.constListClass) || | 172 mask.containsOnly(closedWorld.commonElements.jsUnmodifiableArrayClass) || |
173 mask.containsOnlyString(closedWorld) || | 173 mask.containsOnlyString(closedWorld) || |
174 closedWorld.commonMasks.isTypedArray(mask)) { | 174 closedWorld.commonMasks.isTypedArray(mask)) { |
175 return true; | 175 return true; |
176 } | 176 } |
177 return false; | 177 return false; |
178 } | 178 } |
179 | 179 |
180 /** | 180 /** |
181 * If both inputs to known operations are available execute the operation at | 181 * If both inputs to known operations are available execute the operation at |
182 * compile-time. | 182 * compile-time. |
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2861 | 2861 |
2862 keyedValues.forEach((receiver, values) { | 2862 keyedValues.forEach((receiver, values) { |
2863 result.keyedValues[receiver] = | 2863 result.keyedValues[receiver] = |
2864 new Map<HInstruction, HInstruction>.from(values); | 2864 new Map<HInstruction, HInstruction>.from(values); |
2865 }); | 2865 }); |
2866 | 2866 |
2867 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2867 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
2868 return result; | 2868 return result; |
2869 } | 2869 } |
2870 } | 2870 } |
OLD | NEW |