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

Unified Diff: lib/compiler/implementation/universe.dart

Issue 10911006: Collect the types used in is-checks in the resolver phase. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/universe.dart
diff --git a/lib/compiler/implementation/universe.dart b/lib/compiler/implementation/universe.dart
index 976f06beef56e16aef544a4f315df1d6d69e3af7..41f220d3783bb907e8050c8a9e0e5e83e21d72fc 100644
--- a/lib/compiler/implementation/universe.dart
+++ b/lib/compiler/implementation/universe.dart
@@ -13,8 +13,10 @@ class Universe {
final Map<SourceString, Set<Selector>> invokedSetters;
final Map<SourceString, Set<Selector>> fieldGetters;
final Map<SourceString, Set<Selector>> fieldSetters;
- // TODO(ngeoffray): This should be a Set<Type>.
- final Set<Element> isChecks;
+ final Set<Type> isChecks;
+ // TODO(karlklose): move this data to RuntimeTypeInformation.
+ Set<Element> cachedCheckedClasses;
+
final RuntimeTypeInformation rti;
Universe() : generatedCode = new Map<Element, CodeBuffer>(),
@@ -27,9 +29,17 @@ class Universe {
invokedSetters = new Map<SourceString, Set<Selector>>(),
fieldGetters = new Map<SourceString, Set<Selector>>(),
fieldSetters = new Map<SourceString, Set<Selector>>(),
- isChecks = new Set<Element>(),
+ isChecks = new Set<Type>(),
rti = new RuntimeTypeInformation();
+ get checkedClasses {
ngeoffray 2012/08/30 11:03:33 What is that for? Why not using isChecks?
karlklose 2012/08/30 13:04:31 Currently, the code emitter generates the is$-meth
+ if (cachedCheckedClasses == null) {
+ cachedCheckedClasses = new Set<Element>();
+ isChecks.forEach((Type t) => cachedCheckedClasses.add(t.element));
+ }
+ return cachedCheckedClasses;
+ }
+
void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) {
generatedCode[work.element] = codeBuffer;
}
« lib/compiler/implementation/typechecker.dart ('K') | « lib/compiler/implementation/typechecker.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698