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

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

Issue 10232011: Implement simple dynamic type check. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor edits. Created 8 years, 7 months 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 class Universe { 5 class Universe {
6 Map<Element, String> generatedCode; 6 Map<Element, String> generatedCode;
7 Map<Element, String> generatedBailoutCode; 7 Map<Element, String> generatedBailoutCode;
8 final Set<ClassElement> instantiatedClasses; 8 final Set<ClassElement> instantiatedClasses;
9 final Set<SourceString> instantiatedClassInstanceFields; 9 final Set<SourceString> instantiatedClassInstanceFields;
10 final Set<FunctionElement> staticFunctionsNeedingGetter; 10 final Set<FunctionElement> staticFunctionsNeedingGetter;
11 final Map<SourceString, Set<Selector>> invokedNames; 11 final Map<SourceString, Set<Selector>> invokedNames;
12 final Map<SourceString, Set<Selector>> invokedGetters; 12 final Map<SourceString, Set<Selector>> invokedGetters;
13 final Map<SourceString, Set<Selector>> invokedSetters; 13 final Map<SourceString, Set<Selector>> invokedSetters;
14 final Map<String, LibraryElement> libraries; 14 final Map<String, LibraryElement> libraries;
15 // TODO(ngeoffray): This should be a Set<Type>. 15 // TODO(ngeoffray): This should be a Set<Type>.
16 final Set<Element> isChecks; 16 final Set<Element> isChecks;
17 final RuntimeTypeInformation rti;
17 18
18 Universe() : generatedCode = new Map<Element, String>(), 19 Universe() : generatedCode = new Map<Element, String>(),
19 generatedBailoutCode = new Map<Element, String>(), 20 generatedBailoutCode = new Map<Element, String>(),
20 libraries = new Map<String, LibraryElement>(), 21 libraries = new Map<String, LibraryElement>(),
21 instantiatedClasses = new Set<ClassElement>(), 22 instantiatedClasses = new Set<ClassElement>(),
22 instantiatedClassInstanceFields = new Set<SourceString>(), 23 instantiatedClassInstanceFields = new Set<SourceString>(),
23 staticFunctionsNeedingGetter = new Set<FunctionElement>(), 24 staticFunctionsNeedingGetter = new Set<FunctionElement>(),
24 invokedNames = new Map<SourceString, Set<Selector>>(), 25 invokedNames = new Map<SourceString, Set<Selector>>(),
25 invokedGetters = new Map<SourceString, Set<Selector>>(), 26 invokedGetters = new Map<SourceString, Set<Selector>>(),
26 invokedSetters = new Map<SourceString, Set<Selector>>(), 27 invokedSetters = new Map<SourceString, Set<Selector>>(),
27 isChecks = new Set<Element>(); 28 isChecks = new Set<Element>(),
29 rti = new RuntimeTypeInformation();
28 30
29 void addGeneratedCode(WorkItem work, String code) { 31 void addGeneratedCode(WorkItem work, String code) {
30 generatedCode[work.element] = code; 32 generatedCode[work.element] = code;
31 } 33 }
32 34
33 void addBailoutCode(WorkItem work, String code) { 35 void addBailoutCode(WorkItem work, String code) {
34 generatedBailoutCode[work.element] = code; 36 generatedBailoutCode[work.element] = code;
35 } 37 }
36 38
37 bool hasMatchingSelector(Set<Selector> selectors, 39 bool hasMatchingSelector(Set<Selector> selectors,
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 328
327 return false; 329 return false;
328 } 330 }
329 331
330 bool operator ==(other) { 332 bool operator ==(other) {
331 if (other is !TypedSelector) return false; 333 if (other is !TypedSelector) return false;
332 if (other.receiverType !== receiverType) return false; 334 if (other.receiverType !== receiverType) return false;
333 return super == other; 335 return super == other;
334 } 336 }
335 } 337 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698