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

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: Fix last upload. Created 8 years, 3 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 a03a61c7295d92f44e19ced9a4a85f67449360d7..2e0f6b1412d68317c9c3b99a6bc37d64e2aa1a4a 100644
--- a/lib/compiler/implementation/universe.dart
+++ b/lib/compiler/implementation/universe.dart
@@ -13,8 +13,9 @@ 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<DartType>.
- final Set<Element> isChecks;
+ final Set<DartType> isChecks;
+ // TODO(karlklose): move this data to RuntimeTypeInformation.
+ Set<Element> checkedClasses;
final RuntimeTypeInformation rti;
Universe() : generatedCode = new Map<Element, CodeBuffer>(),
@@ -27,9 +28,16 @@ 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<DartType>(),
rti = new RuntimeTypeInformation();
+ // TODO(karlklose): add the set of instantiatedtypes as second argument.
ngeoffray 2012/09/05 12:50:40 Why is the set of instantiatedTypes needed? You wa
karlklose 2012/09/06 11:04:02 It is important for checks on type arguments to kn
ngeoffray 2012/09/06 11:07:46 So you can just return false for them?
+ void computeRequiredTypes(Set<DartType> isChecks) {
+ assert(checkedClasses == null);
+ checkedClasses = new Set<Element>();
+ isChecks.forEach((DartType t) => checkedClasses.add(t.element));
+ }
+
void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) {
generatedCode[work.element] = codeBuffer;
}

Powered by Google App Engine
This is Rietveld 408576698