| 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'; |
| 11 import '../core_types.dart' show CommonElements; | 11 import '../core_types.dart' show CommonElements; |
| 12 import '../dart_types.dart'; | 12 import '../dart_types.dart'; |
| 13 import '../elements/elements.dart'; | 13 import '../elements/elements.dart'; |
| 14 import '../elements/entities.dart'; |
| 14 import '../js/js.dart' as js; | 15 import '../js/js.dart' as js; |
| 15 import '../js_backend/backend_helpers.dart' show BackendHelpers; | 16 import '../js_backend/backend_helpers.dart' show BackendHelpers; |
| 16 import '../js_backend/js_backend.dart'; | 17 import '../js_backend/js_backend.dart'; |
| 17 import '../native/native.dart' as native; | 18 import '../native/native.dart' as native; |
| 18 import '../tree/dartstring.dart' as ast; | 19 import '../tree/dartstring.dart' as ast; |
| 19 import '../types/types.dart'; | 20 import '../types/types.dart'; |
| 20 import '../universe/selector.dart' show Selector; | 21 import '../universe/selector.dart' show Selector; |
| 21 import '../universe/side_effects.dart' show SideEffects; | 22 import '../universe/side_effects.dart' show SideEffects; |
| 22 import '../util/util.dart'; | 23 import '../util/util.dart'; |
| 23 import '../world.dart' show ClosedWorld; | 24 import '../world.dart' show ClosedWorld; |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 } | 885 } |
| 885 } | 886 } |
| 886 } | 887 } |
| 887 | 888 |
| 888 // HFieldGet of a constructed constant can be replaced with the constant's | 889 // HFieldGet of a constructed constant can be replaced with the constant's |
| 889 // field. | 890 // field. |
| 890 if (receiver is HConstant) { | 891 if (receiver is HConstant) { |
| 891 ConstantValue constant = receiver.constant; | 892 ConstantValue constant = receiver.constant; |
| 892 if (constant.isConstructedObject) { | 893 if (constant.isConstructedObject) { |
| 893 ConstructedConstantValue constructedConstant = constant; | 894 ConstructedConstantValue constructedConstant = constant; |
| 894 Map<Element, ConstantValue> fields = constructedConstant.fields; | 895 Map<FieldEntity, ConstantValue> fields = constructedConstant.fields; |
| 895 ConstantValue value = fields[node.element]; | 896 ConstantValue value = fields[node.element]; |
| 896 if (value != null) { | 897 if (value != null) { |
| 897 return graph.addConstant(value, closedWorld); | 898 return graph.addConstant(value, closedWorld); |
| 898 } | 899 } |
| 899 } | 900 } |
| 900 } | 901 } |
| 901 | 902 |
| 902 return node; | 903 return node; |
| 903 } | 904 } |
| 904 | 905 |
| (...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2742 | 2743 |
| 2743 keyedValues.forEach((receiver, values) { | 2744 keyedValues.forEach((receiver, values) { |
| 2744 result.keyedValues[receiver] = | 2745 result.keyedValues[receiver] = |
| 2745 new Map<HInstruction, HInstruction>.from(values); | 2746 new Map<HInstruction, HInstruction>.from(values); |
| 2746 }); | 2747 }); |
| 2747 | 2748 |
| 2748 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2749 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 2749 return result; | 2750 return result; |
| 2750 } | 2751 } |
| 2751 } | 2752 } |
| OLD | NEW |