| 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 SynthesizedCallMethodElementX; | 7 import 'closure.dart' show SynthesizedCallMethodElementX; |
| 8 import 'common/backend_api.dart' show Backend; | 8 import 'common/backend_api.dart' show Backend; |
| 9 import 'common.dart'; | 9 import 'common.dart'; |
| 10 import 'compiler.dart' show Compiler; | 10 import 'compiler.dart' show Compiler; |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 ClassElement otherClass = iterator.current; | 418 ClassElement otherClass = iterator.current; |
| 419 assert(checkInvariants(otherClass)); | 419 assert(checkInvariants(otherClass)); |
| 420 OrderedTypeSet otherTypeSet = otherClass.allSupertypesAndSelf; | 420 OrderedTypeSet otherTypeSet = otherClass.allSupertypesAndSelf; |
| 421 otherTypeSets = otherTypeSets.prepend(otherTypeSet); | 421 otherTypeSets = otherTypeSets.prepend(otherTypeSet); |
| 422 if (otherTypeSet.maxDepth < depth) { | 422 if (otherTypeSet.maxDepth < depth) { |
| 423 depth = otherTypeSet.maxDepth; | 423 depth = otherTypeSet.maxDepth; |
| 424 } | 424 } |
| 425 } while (iterator.moveNext()); | 425 } while (iterator.moveNext()); |
| 426 | 426 |
| 427 List<ClassElement> commonSupertypes = <ClassElement>[]; | 427 List<ClassElement> commonSupertypes = <ClassElement>[]; |
| 428 OUTER: for (Link<DartType> link = typeSet[depth]; | 428 OUTER: |
| 429 for (Link<DartType> link = typeSet[depth]; |
| 429 link.head.element != objectClass; | 430 link.head.element != objectClass; |
| 430 link = link.tail) { | 431 link = link.tail) { |
| 431 ClassElement cls = link.head.element; | 432 ClassElement cls = link.head.element; |
| 432 for (Link<OrderedTypeSet> link = otherTypeSets; | 433 for (Link<OrderedTypeSet> link = otherTypeSets; |
| 433 !link.isEmpty; | 434 !link.isEmpty; |
| 434 link = link.tail) { | 435 link = link.tail) { |
| 435 if (link.head.asInstanceOf(cls) == null) { | 436 if (link.head.asInstanceOf(cls) == null) { |
| 436 continue OUTER; | 437 continue OUTER; |
| 437 } | 438 } |
| 438 } | 439 } |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 // function expressions's element. | 827 // function expressions's element. |
| 827 // TODO(herhut): Generate classes for function expressions earlier. | 828 // TODO(herhut): Generate classes for function expressions earlier. |
| 828 if (element is SynthesizedCallMethodElementX) { | 829 if (element is SynthesizedCallMethodElementX) { |
| 829 return getMightBePassedToApply(element.expression); | 830 return getMightBePassedToApply(element.expression); |
| 830 } | 831 } |
| 831 return functionsThatMightBePassedToApply.contains(element); | 832 return functionsThatMightBePassedToApply.contains(element); |
| 832 } | 833 } |
| 833 | 834 |
| 834 bool get hasClosedWorldAssumption => !compiler.options.hasIncrementalSupport; | 835 bool get hasClosedWorldAssumption => !compiler.options.hasIncrementalSupport; |
| 835 } | 836 } |
| OLD | NEW |