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

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

Issue 10993075: Enable runtime type when it's being hit at resolution. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (elements === null) { 89 if (elements === null) {
90 elements = getCachedElements(element); 90 elements = getCachedElements(element);
91 } 91 }
92 if (isResolutionQueue) { 92 if (isResolutionQueue) {
93 compiler.world.registerUsedElement(element); 93 compiler.world.registerUsedElement(element);
94 } 94 }
95 95
96 queue.add(new WorkItem(element, elements, itemCompilationContextCreator())); 96 queue.add(new WorkItem(element, elements, itemCompilationContextCreator()));
97 97
98 // Enable runtime type support if we discover a getter called runtimeType. 98 // Enable runtime type support if we discover a getter called runtimeType.
99 if (!isResolutionQueue && 99 // We have to enable runtime type before hitting the codegen, so
100 element.isGetter() && 100 // that constructors know whether they need to generate code for
101 element.name == Compiler.RUNTIME_TYPE) { 101 // runtime type.
102 if (element.isGetter() && element.name == Compiler.RUNTIME_TYPE) {
102 compiler.enabledRuntimeType = true; 103 compiler.enabledRuntimeType = true;
103 } 104 }
104 105
105 // Enable isolate support if we start using something from the 106 // Enable isolate support if we start using something from the
106 // isolate library. 107 // isolate library.
107 LibraryElement library = element.getLibrary(); 108 LibraryElement library = element.getLibrary();
108 if (!compiler.hasIsolateSupport() 109 if (!compiler.hasIsolateSupport()
109 && library.uri.toString() == 'dart:isolate') { 110 && library.uri.toString() == 'dart:isolate') {
110 compiler.enableIsolateSupport(library); 111 compiler.enableIsolateSupport(library);
111 } 112 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 353 }
353 354
354 void forEach(f(WorkItem work)) { 355 void forEach(f(WorkItem work)) {
355 while (!queue.isEmpty()) { 356 while (!queue.isEmpty()) {
356 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst? 357 f(queue.removeLast()); // TODO(kasperl): Why isn't this removeFirst?
357 } 358 }
358 } 359 }
359 360
360 String toString() => 'Enqueuer($name)'; 361 String toString() => 'Enqueuer($name)';
361 } 362 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698