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

Side by Side Diff: lib/compiler/implementation/enqueue.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 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 EnqueueTask extends CompilerTask { 5 class EnqueueTask extends CompilerTask {
6 final Enqueuer codegen; 6 final Enqueuer codegen;
7 final Enqueuer resolution; 7 final Enqueuer resolution;
8 8
9 String get name => 'Enqueue'; 9 String get name => 'Enqueue';
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 void processInstantiatedClassMember(Element member) { 168 void processInstantiatedClassMember(Element member) {
169 if (universe.generatedCode.containsKey(member)) return; 169 if (universe.generatedCode.containsKey(member)) return;
170 if (resolvedElements[member] !== null) return; 170 if (resolvedElements[member] !== null) return;
171 if (!member.isInstanceMember()) return; 171 if (!member.isInstanceMember()) return;
172 172
173 if (member.kind === ElementKind.FIELD) { 173 if (member.kind === ElementKind.FIELD) {
174 universe.instantiatedClassInstanceFields.add(member.name); 174 universe.instantiatedClassInstanceFields.add(member.name);
175 if (compiler.enableTypeAssertions) { 175 if (compiler.enableTypeAssertions) {
176 DartType type = member.computeType(compiler); 176 DartType type = member.computeType(compiler);
177 registerIsCheck(type.element); 177 registerIsCheck(type);
178 SourceString helper = compiler.backend.getCheckedModeHelper(type); 178 SourceString helper = compiler.backend.getCheckedModeHelper(type);
179 if (helper != null) { 179 if (helper != null) {
180 Element helperElement = compiler.findHelper(helper); 180 Element helperElement = compiler.findHelper(helper);
181 registerStaticUse(helperElement); 181 registerStaticUse(helperElement);
182 } 182 }
183 } 183 }
184 return; 184 return;
185 } 185 }
186 186
187 String memberName = member.name.slowToString(); 187 String memberName = member.name.slowToString();
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 LibraryElement library, 341 LibraryElement library,
342 DartType type) { 342 DartType type) {
343 task.measure(() { 343 task.measure(() {
344 Selector setter = new Selector.setter(setterName, library); 344 Selector setter = new Selector.setter(setterName, library);
345 registerNewSelector(setterName, 345 registerNewSelector(setterName,
346 new TypedSelector(type, setter), 346 new TypedSelector(type, setter),
347 universe.fieldSetters); 347 universe.fieldSetters);
348 }); 348 });
349 } 349 }
350 350
351 // TODO(ngeoffray): This should get a type. 351 void registerIsCheck(DartType type) {
352 void registerIsCheck(Element element) { 352 universe.isChecks.add(type);
353 universe.isChecks.add(element);
354 } 353 }
355 354
356 void forEach(f(WorkItem work)) { 355 void forEach(f(WorkItem work)) {
357 while (!queue.isEmpty()) { 356 while (!queue.isEmpty()) {
358 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? 357 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst?
359 } 358 }
360 } 359 }
361 } 360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698