Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: dart/pkg/compiler/lib/src/world.dart

Issue 719443002: Incremental compilation: set up inheritance. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Negate and document ClassWorld.hasClosedWorldAssumption. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 /// Returns `true` if closed-world assumptions can be made, that is,
101 /// incremental compilation isn't enabled.
102 bool get hasClosedWorldAssumption;
99 } 103 }
100 104
101 class World implements ClassWorld { 105 class World implements ClassWorld {
102 ClassElement get objectClass => compiler.objectClass; 106 ClassElement get objectClass => compiler.objectClass;
103 ClassElement get functionClass => compiler.functionClass; 107 ClassElement get functionClass => compiler.functionClass;
104 ClassElement get boolClass => compiler.boolClass; 108 ClassElement get boolClass => compiler.boolClass;
105 ClassElement get numClass => compiler.numClass; 109 ClassElement get numClass => compiler.numClass;
106 ClassElement get intClass => compiler.intClass; 110 ClassElement get intClass => compiler.intClass;
107 ClassElement get doubleClass => compiler.doubleClass; 111 ClassElement get doubleClass => compiler.doubleClass;
108 ClassElement get stringClass => compiler.stringClass; 112 ClassElement get stringClass => compiler.stringClass;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // type inference ran. This is currently only the case for the call 518 // type inference ran. This is currently only the case for the call
515 // method of function classes that were generated for function 519 // method of function classes that were generated for function
516 // expressions. In such a case, we have to look at the original 520 // expressions. In such a case, we have to look at the original
517 // function expressions's element. 521 // function expressions's element.
518 // TODO(herhut): Generate classes for function expressions earlier. 522 // TODO(herhut): Generate classes for function expressions earlier.
519 if (element is closureMapping.SynthesizedCallMethodElementX) { 523 if (element is closureMapping.SynthesizedCallMethodElementX) {
520 return getMightBePassedToApply(element.expression); 524 return getMightBePassedToApply(element.expression);
521 } 525 }
522 return functionsThatMightBePassedToApply.contains(element); 526 return functionsThatMightBePassedToApply.contains(element);
523 } 527 }
528
529 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport;
524 } 530 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698