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

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: Rebase 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 16 matching lines...) Expand all
27 * 27 *
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 // TODO(karlklose): these sets should be merged.
37 final Set<ClassElement> instantiatedClasses; 38 final Set<ClassElement> instantiatedClasses;
39 final Set<DartType> instantiatedTypes;
38 40
39 /** 41 /**
40 * Documentation wanted -- johnniwinther 42 * Documentation wanted -- johnniwinther
41 * 43 *
42 * Invariant: Elements are declaration elements. 44 * Invariant: Elements are declaration elements.
43 */ 45 */
44 final Set<FunctionElement> staticFunctionsNeedingGetter; 46 final Set<FunctionElement> staticFunctionsNeedingGetter;
45 final Map<SourceString, Set<Selector>> invokedNames; 47 final Map<SourceString, Set<Selector>> invokedNames;
46 final Map<SourceString, Set<Selector>> invokedGetters; 48 final Map<SourceString, Set<Selector>> invokedGetters;
47 final Map<SourceString, Set<Selector>> invokedSetters; 49 final Map<SourceString, Set<Selector>> invokedSetters;
48 final Map<SourceString, Set<Selector>> fieldGetters; 50 final Map<SourceString, Set<Selector>> fieldGetters;
49 final Map<SourceString, Set<Selector>> fieldSetters; 51 final Map<SourceString, Set<Selector>> fieldSetters;
50 final Set<DartType> isChecks; 52 final Set<DartType> isChecks;
51 53
52 Universe() : generatedCode = new Map<Element, CodeBuffer>(), 54 Universe() : generatedCode = new Map<Element, CodeBuffer>(),
53 generatedBailoutCode = new Map<Element, CodeBuffer>(), 55 generatedBailoutCode = new Map<Element, CodeBuffer>(),
54 instantiatedClasses = new Set<ClassElement>(), 56 instantiatedClasses = new Set<ClassElement>(),
57 instantiatedTypes = new Set<DartType>(),
55 staticFunctionsNeedingGetter = new Set<FunctionElement>(), 58 staticFunctionsNeedingGetter = new Set<FunctionElement>(),
56 invokedNames = new Map<SourceString, Set<Selector>>(), 59 invokedNames = new Map<SourceString, Set<Selector>>(),
57 invokedGetters = new Map<SourceString, Set<Selector>>(), 60 invokedGetters = new Map<SourceString, Set<Selector>>(),
58 invokedSetters = new Map<SourceString, Set<Selector>>(), 61 invokedSetters = new Map<SourceString, Set<Selector>>(),
59 fieldGetters = new Map<SourceString, Set<Selector>>(), 62 fieldGetters = new Map<SourceString, Set<Selector>>(),
60 fieldSetters = new Map<SourceString, Set<Selector>>(), 63 fieldSetters = new Map<SourceString, Set<Selector>>(),
61 isChecks = new Set<DartType>(); 64 isChecks = new Set<DartType>();
62 65
63 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) { 66 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) {
64 assert(invariant(work.element, work.element.isDeclaration)); 67 assert(invariant(work.element, work.element.isDeclaration));
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 ClassElement cls = self; 464 ClassElement cls = self;
462 if (cls.isSubclassOf(other)) { 465 if (cls.isSubclassOf(other)) {
463 // Resolve an invocation of [element.name] on [self]. If it 466 // Resolve an invocation of [element.name] on [self]. If it
464 // is found, this selector is a candidate. 467 // is found, this selector is a candidate.
465 return hasElementIn(self, element) && appliesUntyped(element, compiler); 468 return hasElementIn(self, element) && appliesUntyped(element, compiler);
466 } 469 }
467 470
468 return false; 471 return false;
469 } 472 }
470 } 473 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698