| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 /// Returns `true` if [mask] represents only types that have a length that | 135 /// Returns `true` if [mask] represents only types that have a length that |
| 136 /// cannot change. The current implementation is conservative for the purpose | 136 /// cannot change. The current implementation is conservative for the purpose |
| 137 /// of identifying gvn-able lengths and mis-identifies some unions of fixed | 137 /// of identifying gvn-able lengths and mis-identifies some unions of fixed |
| 138 /// length indexables (see TODO) as not fixed length. | 138 /// length indexables (see TODO) as not fixed length. |
| 139 bool isFixedLength(mask, ClosedWorld closedWorld) { | 139 bool isFixedLength(mask, ClosedWorld closedWorld) { |
| 140 if (mask.isContainer && mask.length != null) { | 140 if (mask.isContainer && mask.length != null) { |
| 141 // A container on which we have inferred the length. | 141 // A container on which we have inferred the length. |
| 142 return true; | 142 return true; |
| 143 } | 143 } |
| 144 // TODO(sra): Recognize any combination of fixed length indexables. | 144 // TODO(sra): Recognize any combination of fixed length indexables. |
| 145 if (mask.containsOnly(closedWorld.backendClasses.fixedListImplementation) || | 145 if (mask.containsOnly(closedWorld.backendClasses.fixedListClass) || |
| 146 mask.containsOnly(closedWorld.backendClasses.constListImplementation) || | 146 mask.containsOnly(closedWorld.backendClasses.constListClass) || |
| 147 mask.containsOnlyString(closedWorld) || | 147 mask.containsOnlyString(closedWorld) || |
| 148 closedWorld.commonMasks.isTypedArray(mask)) { | 148 closedWorld.commonMasks.isTypedArray(mask)) { |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * If both inputs to known operations are available execute the operation at | 155 * If both inputs to known operations are available execute the operation at |
| 156 * compile-time. | 156 * compile-time. |
| (...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2760 | 2760 |
| 2761 keyedValues.forEach((receiver, values) { | 2761 keyedValues.forEach((receiver, values) { |
| 2762 result.keyedValues[receiver] = | 2762 result.keyedValues[receiver] = |
| 2763 new Map<HInstruction, HInstruction>.from(values); | 2763 new Map<HInstruction, HInstruction>.from(values); |
| 2764 }); | 2764 }); |
| 2765 | 2765 |
| 2766 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2766 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 2767 return result; | 2767 return result; |
| 2768 } | 2768 } |
| 2769 } | 2769 } |
| OLD | NEW |