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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 /// Returns `true` if any live class that mixes in [cls] implements [type]. | 89 /// Returns `true` if any live class that mixes in [cls] implements [type]. |
| 90 bool hasAnySubclassOfMixinUseThatImplements(ClassElement cls, | 90 bool hasAnySubclassOfMixinUseThatImplements(ClassElement cls, |
| 91 ClassElement type); | 91 ClassElement type); |
| 92 | 92 |
| 93 /// Returns `true` if any live class that mixes in [mixin] is also a subclass | 93 /// Returns `true` if any live class that mixes in [mixin] is also a subclass |
| 94 /// of [superclass]. | 94 /// of [superclass]. |
| 95 bool hasAnySubclassThatMixes(ClassElement superclass, ClassElement mixin); | 95 bool hasAnySubclassThatMixes(ClassElement superclass, ClassElement mixin); |
| 96 | 96 |
| 97 /// Returns `true` if any subclass of [superclass] implements [type]. | 97 /// Returns `true` if any subclass of [superclass] implements [type]. |
| 98 bool hasAnySubclassThatImplements(ClassElement superclass, ClassElement type); | 98 bool hasAnySubclassThatImplements(ClassElement superclass, ClassElement type); |
| 99 | |
| 100 bool get hasClosedWorldAssumption; | |
|
Johnni Winther
2014/11/14 10:20:53
Document what this implies.
As I read the use it
ahe
2014/11/14 14:40:05
I got this wrong. The return value should have bee
| |
| 99 } | 101 } |
| 100 | 102 |
| 101 class World implements ClassWorld { | 103 class World implements ClassWorld { |
| 102 ClassElement get objectClass => compiler.objectClass; | 104 ClassElement get objectClass => compiler.objectClass; |
| 103 ClassElement get functionClass => compiler.functionClass; | 105 ClassElement get functionClass => compiler.functionClass; |
| 104 ClassElement get boolClass => compiler.boolClass; | 106 ClassElement get boolClass => compiler.boolClass; |
| 105 ClassElement get numClass => compiler.numClass; | 107 ClassElement get numClass => compiler.numClass; |
| 106 ClassElement get intClass => compiler.intClass; | 108 ClassElement get intClass => compiler.intClass; |
| 107 ClassElement get doubleClass => compiler.doubleClass; | 109 ClassElement get doubleClass => compiler.doubleClass; |
| 108 ClassElement get stringClass => compiler.stringClass; | 110 ClassElement get stringClass => compiler.stringClass; |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 // type inference ran. This is currently only the case for the call | 516 // type inference ran. This is currently only the case for the call |
| 515 // method of function classes that were generated for function | 517 // method of function classes that were generated for function |
| 516 // expressions. In such a case, we have to look at the original | 518 // expressions. In such a case, we have to look at the original |
| 517 // function expressions's element. | 519 // function expressions's element. |
| 518 // TODO(herhut): Generate classes for function expressions earlier. | 520 // TODO(herhut): Generate classes for function expressions earlier. |
| 519 if (element is closureMapping.SynthesizedCallMethodElementX) { | 521 if (element is closureMapping.SynthesizedCallMethodElementX) { |
| 520 return getMightBePassedToApply(element.expression); | 522 return getMightBePassedToApply(element.expression); |
| 521 } | 523 } |
| 522 return functionsThatMightBePassedToApply.contains(element); | 524 return functionsThatMightBePassedToApply.contains(element); |
| 523 } | 525 } |
| 526 | |
| 527 bool get hasClosedWorldAssumption => compiler.hasIncrementalSupport; | |
| 524 } | 528 } |
| OLD | NEW |