OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.type_mask_system; | 5 library dart2js.type_mask_system; |
6 | 6 |
7 import '../closure.dart' show ClosureClassElement, Identifiers; | 7 import '../closure.dart' show ClosureClassElement, Identifiers; |
8 import '../common/names.dart' show Selectors, Identifiers; | 8 import '../common/names.dart' show Selectors, Identifiers; |
9 import '../compiler.dart' as dart2js show Compiler; | 9 import '../compiler.dart' as dart2js show Compiler; |
10 import '../constants/constant_system.dart'; | 10 import '../constants/constant_system.dart'; |
11 import '../constants/values.dart'; | 11 import '../constants/values.dart'; |
12 import '../dart_types.dart' as types; | 12 import '../dart_types.dart' as types; |
13 import '../elements/elements.dart'; | 13 import '../elements/elements.dart'; |
14 import '../io/source_information.dart' show SourceInformation; | 14 import '../io/source_information.dart' show SourceInformation; |
15 import '../js_backend/js_backend.dart' show JavaScriptBackend; | 15 import '../js_backend/js_backend.dart' show JavaScriptBackend; |
16 import '../types/types.dart'; | 16 import '../types/types.dart'; |
17 import '../types/constants.dart' show computeTypeMask; | 17 import '../types/constants.dart' show computeTypeMask; |
18 import '../universe/universe.dart'; | 18 import '../universe/selector.dart' show Selector; |
19 import '../world.dart' show World; | 19 import '../world.dart' show World; |
20 | 20 |
21 enum AbstractBool { | 21 enum AbstractBool { |
22 True, False, Maybe, Nothing | 22 True, False, Maybe, Nothing |
23 } | 23 } |
24 | 24 |
25 class TypeMaskSystem { | 25 class TypeMaskSystem { |
26 final TypesTask inferrer; | 26 final TypesTask inferrer; |
27 final World classWorld; | 27 final World classWorld; |
28 final JavaScriptBackend backend; | 28 final JavaScriptBackend backend; |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 } | 289 } |
290 return dynamicType; | 290 return dynamicType; |
291 } | 291 } |
292 | 292 |
293 /// Returns a subset of [mask] containing at least the types | 293 /// Returns a subset of [mask] containing at least the types |
294 /// that can respond to [selector] without throwing. | 294 /// that can respond to [selector] without throwing. |
295 TypeMask receiverTypeFor(Selector selector, TypeMask mask) { | 295 TypeMask receiverTypeFor(Selector selector, TypeMask mask) { |
296 return classWorld.allFunctions.receiverType(selector, mask); | 296 return classWorld.allFunctions.receiverType(selector, mask); |
297 } | 297 } |
298 } | 298 } |
OLD | NEW |