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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/universe/universe.dart

Issue 11557010: Implement subtype checks on type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Kasper's comments. Created 8 years 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 library universe; 5 library universe;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../dart2jslib.dart'; 9 import '../dart2jslib.dart';
10 import '../tree/tree.dart'; 10 import '../tree/tree.dart';
(...skipping 17 matching lines...) Expand all
28 * Invariant: Key elements are declaration elements. 28 * Invariant: Key elements are declaration elements.
29 */ 29 */
30 Map<Element, CodeBuffer> generatedBailoutCode; 30 Map<Element, CodeBuffer> generatedBailoutCode;
31 31
32 /** 32 /**
33 * Documentation wanted -- johnniwinther 33 * Documentation wanted -- johnniwinther
34 * 34 *
35 * Invariant: Elements are declaration elements. 35 * Invariant: Elements are declaration elements.
36 */ 36 */
37 final Set<ClassElement> instantiatedClasses; 37 final Set<ClassElement> instantiatedClasses;
38 final Set<DartType> instantiatedTypes;
ngeoffray 2012/12/13 13:34:58 TODO: merge these sets?
karlklose 2012/12/13 14:37:34 Done.
38 39
39 /** 40 /**
40 * Documentation wanted -- johnniwinther 41 * Documentation wanted -- johnniwinther
41 * 42 *
42 * Invariant: Elements are declaration elements. 43 * Invariant: Elements are declaration elements.
43 */ 44 */
44 final Set<FunctionElement> staticFunctionsNeedingGetter; 45 final Set<FunctionElement> staticFunctionsNeedingGetter;
45 final Map<SourceString, Set<Selector>> invokedNames; 46 final Map<SourceString, Set<Selector>> invokedNames;
46 final Map<SourceString, Set<Selector>> invokedGetters; 47 final Map<SourceString, Set<Selector>> invokedGetters;
47 final Map<SourceString, Set<Selector>> invokedSetters; 48 final Map<SourceString, Set<Selector>> invokedSetters;
48 final Map<SourceString, Set<Selector>> fieldGetters; 49 final Map<SourceString, Set<Selector>> fieldGetters;
49 final Map<SourceString, Set<Selector>> fieldSetters; 50 final Map<SourceString, Set<Selector>> fieldSetters;
50 final Set<DartType> isChecks; 51 final Set<DartType> isChecks;
51 52
52 Universe() : generatedCode = new Map<Element, CodeBuffer>(), 53 Universe() : generatedCode = new Map<Element, CodeBuffer>(),
53 generatedBailoutCode = new Map<Element, CodeBuffer>(), 54 generatedBailoutCode = new Map<Element, CodeBuffer>(),
54 instantiatedClasses = new Set<ClassElement>(), 55 instantiatedClasses = new Set<ClassElement>(),
56 instantiatedTypes = new Set<DartType>(),
55 staticFunctionsNeedingGetter = new Set<FunctionElement>(), 57 staticFunctionsNeedingGetter = new Set<FunctionElement>(),
56 invokedNames = new Map<SourceString, Set<Selector>>(), 58 invokedNames = new Map<SourceString, Set<Selector>>(),
57 invokedGetters = new Map<SourceString, Set<Selector>>(), 59 invokedGetters = new Map<SourceString, Set<Selector>>(),
58 invokedSetters = new Map<SourceString, Set<Selector>>(), 60 invokedSetters = new Map<SourceString, Set<Selector>>(),
59 fieldGetters = new Map<SourceString, Set<Selector>>(), 61 fieldGetters = new Map<SourceString, Set<Selector>>(),
60 fieldSetters = new Map<SourceString, Set<Selector>>(), 62 fieldSetters = new Map<SourceString, Set<Selector>>(),
61 isChecks = new Set<DartType>(); 63 isChecks = new Set<DartType>();
62 64
63 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) { 65 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) {
64 assert(invariant(work.element, work.element.isDeclaration)); 66 assert(invariant(work.element, work.element.isDeclaration));
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 ClassElement cls = self; 463 ClassElement cls = self;
462 if (cls.isSubclassOf(other)) { 464 if (cls.isSubclassOf(other)) {
463 // Resolve an invocation of [element.name] on [self]. If it 465 // Resolve an invocation of [element.name] on [self]. If it
464 // is found, this selector is a candidate. 466 // is found, this selector is a candidate.
465 return hasElementIn(self, element) && appliesUntyped(element, compiler); 467 return hasElementIn(self, element) && appliesUntyped(element, compiler);
466 } 468 }
467 469
468 return false; 470 return false;
469 } 471 }
470 } 472 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698