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 library dart2js.world; | 5 library dart2js.world; |
6 | 6 |
7 import 'closure.dart' show ClosureClassElement; | 7 import 'closure.dart' show ClosureClassElement; |
8 import 'common.dart'; | 8 import 'common.dart'; |
9 import 'constants/constant_system.dart'; | 9 import 'constants/constant_system.dart'; |
10 import 'common_elements.dart' show CommonElements, ElementEnvironment; | 10 import 'common_elements.dart' show CommonElements, ElementEnvironment; |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 /// methods defined in [ClosedWorld]. | 1005 /// methods defined in [ClosedWorld]. |
1006 ClassSet getClassSet(ClassEntity cls) { | 1006 ClassSet getClassSet(ClassEntity cls) { |
1007 assert(checkClass(cls)); | 1007 assert(checkClass(cls)); |
1008 return _classSets[cls]; | 1008 return _classSets[cls]; |
1009 } | 1009 } |
1010 | 1010 |
1011 Iterable<TypedefElement> get allTypedefs => _allTypedefs; | 1011 Iterable<TypedefElement> get allTypedefs => _allTypedefs; |
1012 | 1012 |
1013 void _ensureFunctionSet() { | 1013 void _ensureFunctionSet() { |
1014 if (_allFunctions == null) { | 1014 if (_allFunctions == null) { |
| 1015 // [FunctionSet] is created lazily because it is not used when we switch |
| 1016 // from a frontend to a backend model before inference. |
1015 _allFunctions = new FunctionSet(liveInstanceMembers); | 1017 _allFunctions = new FunctionSet(liveInstanceMembers); |
1016 } | 1018 } |
1017 } | 1019 } |
1018 | 1020 |
1019 TypeMask computeReceiverType(Selector selector, TypeMask mask) { | 1021 TypeMask computeReceiverType(Selector selector, TypeMask mask) { |
1020 _ensureFunctionSet(); | 1022 _ensureFunctionSet(); |
1021 return _allFunctions.receiverType(selector, mask, this); | 1023 return _allFunctions.receiverType(selector, mask, this); |
1022 } | 1024 } |
1023 | 1025 |
1024 Iterable<MemberEntity> locateMembers(Selector selector, TypeMask mask) { | 1026 Iterable<MemberEntity> locateMembers(Selector selector, TypeMask mask) { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 // does not see generative constructor bodies because they are | 1314 // does not see generative constructor bodies because they are |
1313 // created by the backend. Also, it does not make any distinction | 1315 // created by the backend. Also, it does not make any distinction |
1314 // between a constructor and its body for side effects. This | 1316 // between a constructor and its body for side effects. This |
1315 // implies that currently, the side effects of a constructor body | 1317 // implies that currently, the side effects of a constructor body |
1316 // contain the side effects of the initializers. | 1318 // contain the side effects of the initializers. |
1317 assert(!element.isGenerativeConstructorBody); | 1319 assert(!element.isGenerativeConstructorBody); |
1318 assert(!element.isField); | 1320 assert(!element.isField); |
1319 return super.getSideEffectsOfElement(element); | 1321 return super.getSideEffectsOfElement(element); |
1320 } | 1322 } |
1321 } | 1323 } |
OLD | NEW |