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

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

Issue 10908142: Add runtimeType() to Object which returns canonicalized instances of Type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 }); 240 });
241 } 241 }
242 242
243 void registerNewSelector(SourceString name, 243 void registerNewSelector(SourceString name,
244 Selector selector, 244 Selector selector,
245 Map<SourceString, Set<Selector>> selectorsMap) { 245 Map<SourceString, Set<Selector>> selectorsMap) {
246 if (name != selector.name) { 246 if (name != selector.name) {
247 String message = "$name != ${selector.name} (${selector.kind})"; 247 String message = "$name != ${selector.name} (${selector.kind})";
248 compiler.internalError("Wrong selector name: $message."); 248 compiler.internalError("Wrong selector name: $message.");
249 } 249 }
250 if (name == const SourceString('runtimeType')
251 && selector.argumentCount == 0) {
252 compiler.enabledRuntimeType = true;
ngeoffray 2012/09/14 07:30:21 I'd prefer doing the check on the Element. There a
karlklose 2012/09/14 12:07:13 Done.
253 }
250 Set<Selector> selectors = 254 Set<Selector> selectors =
251 selectorsMap.putIfAbsent(name, () => new Set<Selector>()); 255 selectorsMap.putIfAbsent(name, () => new Set<Selector>());
252 if (!selectors.contains(selector)) { 256 if (!selectors.contains(selector)) {
253 selectors.add(selector); 257 selectors.add(selector);
254 handleUnseenSelector(name, selector); 258 handleUnseenSelector(name, selector);
255 } 259 }
256 } 260 }
257 261
258 void registerInvocation(SourceString methodName, Selector selector) { 262 void registerInvocation(SourceString methodName, Selector selector) {
259 task.measure(() { 263 task.measure(() {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 void registerIsCheck(DartType type) { 350 void registerIsCheck(DartType type) {
347 universe.isChecks.add(type); 351 universe.isChecks.add(type);
348 } 352 }
349 353
350 void forEach(f(WorkItem work)) { 354 void forEach(f(WorkItem work)) {
351 while (!queue.isEmpty()) { 355 while (!queue.isEmpty()) {
352 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? 356 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst?
353 } 357 }
354 } 358 }
355 } 359 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698