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

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..31c832d410468f8f4a465af1d9d587619c93a19c 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> checkedClasses;
+
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();
+ // TODO(karlklose): the second argument should be a set of types, too.
ngeoffray 2012/08/30 13:17:46 The second argument is not used.
karlklose 2012/09/05 09:36:01 Done, removed.
+ void computeRequiredTypes(Set<Type> isChecks,
+ Set<Element> instantiatedTypes) {
+ assert(checkedClasses == null);
+ checkedClasses = new Set<Element>();
+ isChecks.forEach((Type t) => checkedClasses.add(t.element));
+ }
+
void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) {
generatedCode[work.element] = codeBuffer;
}

Powered by Google App Engine
This is Rietveld 408576698