| 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.dart'; | 9 import '../common.dart'; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| 11 import '../dart_types.dart'; |
| 11 import '../elements/elements.dart'; | 12 import '../elements/elements.dart'; |
| 12 import '../dart_types.dart'; | |
| 13 import '../util/util.dart'; | 13 import '../util/util.dart'; |
| 14 import '../world.dart' show ClassWorld, World; | 14 import '../world.dart' show ClassWorld, World; |
| 15 | |
| 16 import 'selector.dart' show Selector; | 15 import 'selector.dart' show Selector; |
| 17 import 'use.dart' show DynamicUse, DynamicUseKind, StaticUse, StaticUseKind; | 16 import 'use.dart' show DynamicUse, DynamicUseKind, StaticUse, StaticUseKind; |
| 18 | 17 |
| 19 /// The known constraint on receiver for a dynamic call site. | 18 /// The known constraint on receiver for a dynamic call site. |
| 20 /// | 19 /// |
| 21 /// This can for instance be used to constrain this dynamic call to `foo` to | 20 /// This can for instance be used to constrain this dynamic call to `foo` to |
| 22 /// 'receivers of the exact instance `Bar`': | 21 /// 'receivers of the exact instance `Bar`': |
| 23 /// | 22 /// |
| 24 /// class Bar { | 23 /// class Bar { |
| 25 /// void foo() {} | 24 /// void foo() {} |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 // TODO(ahe): Replace this method with something that is O(1), for example, | 389 // TODO(ahe): Replace this method with something that is O(1), for example, |
| 391 // by using a map. | 390 // by using a map. |
| 392 List<LocalFunctionElement> slowDirectlyNestedClosures(Element element) { | 391 List<LocalFunctionElement> slowDirectlyNestedClosures(Element element) { |
| 393 // Return new list to guard against concurrent modifications. | 392 // Return new list to guard against concurrent modifications. |
| 394 return new List<LocalFunctionElement>.from( | 393 return new List<LocalFunctionElement>.from( |
| 395 allClosures.where((LocalFunctionElement closure) { | 394 allClosures.where((LocalFunctionElement closure) { |
| 396 return closure.executableContext == element; | 395 return closure.executableContext == element; |
| 397 })); | 396 })); |
| 398 } | 397 } |
| 399 } | 398 } |
| OLD | NEW |