| 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 universe; | 5 library universe; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
| 10 Identifiers, | 10 Identifiers, |
| 11 Names, | 11 Names, |
| 12 Selectors; | 12 Selectors; |
| 13 import '../compiler.dart' show | 13 import '../compiler.dart' show |
| 14 Compiler; | 14 Compiler; |
| 15 import '../diagnostics/invariant.dart' show | 15 import '../diagnostics/invariant.dart' show |
| 16 invariant; | 16 invariant; |
| 17 import '../diagnostics/spannable.dart' show | 17 import '../diagnostics/spannable.dart' show |
| 18 SpannableAssertionFailure; | 18 SpannableAssertionFailure; |
| 19 import '../elements/elements.dart'; | 19 import '../elements/elements.dart'; |
| 20 import '../dart_types.dart'; | 20 import '../dart_types.dart'; |
| 21 import '../tree/tree.dart'; | 21 import '../tree/tree.dart'; |
| 22 import '../types/types.dart'; | 22 import '../types/types.dart'; |
| 23 import '../util/util.dart'; | 23 import '../util/util.dart'; |
| 24 import '../world.dart' show | 24 import '../world.dart' show |
| 25 ClassWorld, | 25 ClassWorld, |
| 26 World; | 26 World; |
| 27 | 27 |
| 28 part 'call_structure.dart'; | 28 import 'call_structure.dart'; |
| 29 part 'function_set.dart'; | 29 import 'selector.dart' show |
| 30 part 'selector.dart'; | 30 Selector; |
| 31 part 'side_effects.dart'; | 31 import 'function_set.dart'; |
| 32 import 'side_effects.dart'; |
| 32 | 33 |
| 33 class UniverseSelector { | 34 class UniverseSelector { |
| 34 final Selector selector; | 35 final Selector selector; |
| 35 final ReceiverMask mask; | 36 final ReceiverMask mask; |
| 36 | 37 |
| 37 UniverseSelector(this.selector, this.mask); | 38 UniverseSelector(this.selector, this.mask); |
| 38 | 39 |
| 39 bool appliesUnnamed(Element element, ClassWorld world) { | 40 bool appliesUnnamed(Element element, ClassWorld world) { |
| 40 return selector.appliesUnnamed(element, world) && | 41 return selector.appliesUnnamed(element, world) && |
| 41 (mask == null || mask.canHit(element, selector, world)); | 42 (mask == null || mask.canHit(element, selector, world)); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // TODO(ahe): Replace this method with something that is O(1), for example, | 367 // TODO(ahe): Replace this method with something that is O(1), for example, |
| 367 // by using a map. | 368 // by using a map. |
| 368 List<LocalFunctionElement> slowDirectlyNestedClosures(Element element) { | 369 List<LocalFunctionElement> slowDirectlyNestedClosures(Element element) { |
| 369 // Return new list to guard against concurrent modifications. | 370 // Return new list to guard against concurrent modifications. |
| 370 return new List<LocalFunctionElement>.from( | 371 return new List<LocalFunctionElement>.from( |
| 371 allClosures.where((LocalFunctionElement closure) { | 372 allClosures.where((LocalFunctionElement closure) { |
| 372 return closure.executableContext == element; | 373 return closure.executableContext == element; |
| 373 })); | 374 })); |
| 374 } | 375 } |
| 375 } | 376 } |
| OLD | NEW |