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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 } | 1023 } |
1024 | 1024 |
1025 HInstruction receiver = node.getDartReceiver(_closedWorld); | 1025 HInstruction receiver = node.getDartReceiver(_closedWorld); |
1026 FieldEntity field = | 1026 FieldEntity field = |
1027 findConcreteFieldForDynamicAccess(receiver, node.selector); | 1027 findConcreteFieldForDynamicAccess(receiver, node.selector); |
1028 if (field == null || !field.isAssignable) return node; | 1028 if (field == null || !field.isAssignable) return node; |
1029 // Use `node.inputs.last` in case the call follows the interceptor calling | 1029 // Use `node.inputs.last` in case the call follows the interceptor calling |
1030 // convention, but is not a call on an interceptor. | 1030 // convention, but is not a call on an interceptor. |
1031 HInstruction value = node.inputs.last; | 1031 HInstruction value = node.inputs.last; |
1032 if (_options.enableTypeAssertions) { | 1032 if (_options.enableTypeAssertions) { |
1033 // TODO(johnniwinther): Support field entities. | 1033 // TODO(redemption): Support field entities. |
1034 FieldElement element = field; | 1034 FieldElement element = field; |
1035 DartType type = element.type; | 1035 DartType type = element.type; |
1036 if (!type.treatAsRaw || | 1036 if (!type.treatAsRaw || |
1037 type.isTypeVariable || | 1037 type.isTypeVariable || |
1038 type.unaliased.isFunctionType) { | 1038 type.unaliased.isFunctionType) { |
1039 // We cannot generate the correct type representation here, so don't | 1039 // We cannot generate the correct type representation here, so don't |
1040 // inline this access. | 1040 // inline this access. |
1041 // TODO(sra): If the input is such that we don't need a type check, we | 1041 // TODO(sra): If the input is such that we don't need a type check, we |
1042 // can skip the test an generate the HFieldSet. | 1042 // can skip the test an generate the HFieldSet. |
1043 return node; | 1043 return node; |
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 | 2988 |
2989 keyedValues.forEach((receiver, values) { | 2989 keyedValues.forEach((receiver, values) { |
2990 result.keyedValues[receiver] = | 2990 result.keyedValues[receiver] = |
2991 new Map<HInstruction, HInstruction>.from(values); | 2991 new Map<HInstruction, HInstruction>.from(values); |
2992 }); | 2992 }); |
2993 | 2993 |
2994 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2994 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
2995 return result; | 2995 return result; |
2996 } | 2996 } |
2997 } | 2997 } |
OLD | NEW |