Chromium Code Reviews| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 abstract class ClassWorld { | 7 abstract class ClassWorld { |
| 8 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. | 8 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. |
| 9 Backend get backend; | 9 Backend get backend; |
| 10 | 10 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 void populate() { | 358 void populate() { |
| 359 void addSubtypes(ClassElement cls) { | 359 void addSubtypes(ClassElement cls) { |
| 360 if (compiler.hasIncrementalSupport && !alreadyPopulated.add(cls)) { | 360 if (compiler.hasIncrementalSupport && !alreadyPopulated.add(cls)) { |
| 361 return; | 361 return; |
| 362 } | 362 } |
| 363 assert(cls.isDeclaration); | 363 assert(cls.isDeclaration); |
| 364 if (!cls.isResolved) { | 364 if (!cls.isResolved) { |
| 365 compiler.internalError(cls, 'Class "${cls.name}" is not resolved.'); | 365 compiler.internalError(cls, 'Class "${cls.name}" is not resolved.'); |
| 366 } | 366 } |
| 367 | 367 |
| 368 // TODO(sigmund): split into separate CL. See dartbug.com/23664 | |
|
Johnni Winther
2015/07/13 19:21:44
Ahh, yes, the bug and its fix.
Siggi Cherem (dart-lang)
2015/09/29 01:39:34
:)
| |
| 369 _subtypes.putIfAbsent(cls, () => new Set<ClassElement>()).add(cls); | |
| 370 _subclasses.putIfAbsent(cls, () => new Set<ClassElement>()).add(cls); | |
| 368 for (DartType type in cls.allSupertypes) { | 371 for (DartType type in cls.allSupertypes) { |
| 369 Set<Element> subtypesOfSupertype = | 372 Set<Element> subtypesOfSupertype = |
| 370 _subtypes.putIfAbsent(type.element, () => new Set<ClassElement>()); | 373 _subtypes.putIfAbsent(type.element, () => new Set<ClassElement>()); |
| 371 subtypesOfSupertype.add(cls); | 374 subtypesOfSupertype.add(cls); |
| 372 } | 375 } |
| 373 | 376 |
| 374 // Walk through the superclasses, and record the types | 377 // Walk through the superclasses, and record the types |
| 375 // implemented by that type on the superclasses. | 378 // implemented by that type on the superclasses. |
| 376 ClassElement superclass = cls.superclass; | 379 ClassElement superclass = cls.superclass; |
| 377 while (superclass != null) { | 380 while (superclass != null) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 // function expressions's element. | 539 // function expressions's element. |
| 537 // TODO(herhut): Generate classes for function expressions earlier. | 540 // TODO(herhut): Generate classes for function expressions earlier. |
| 538 if (element is closureMapping.SynthesizedCallMethodElementX) { | 541 if (element is closureMapping.SynthesizedCallMethodElementX) { |
| 539 return getMightBePassedToApply(element.expression); | 542 return getMightBePassedToApply(element.expression); |
| 540 } | 543 } |
| 541 return functionsThatMightBePassedToApply.contains(element); | 544 return functionsThatMightBePassedToApply.contains(element); |
| 542 } | 545 } |
| 543 | 546 |
| 544 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; | 547 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; |
| 545 } | 548 } |
| OLD | NEW |