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

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

Issue 10191016: Introduce typed selectors for getters and setters also for better tree shaking. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 WorkItem { 5 class WorkItem {
6 final Element element; 6 final Element element;
7 TreeElements resolutionTree; 7 TreeElements resolutionTree;
8 Function run; 8 Function run;
9 bool allowSpeculativeOptimization = true; 9 bool allowSpeculativeOptimization = true;
10 List<HTypeGuard> guards = const <HTypeGuard>[]; 10 List<HTypeGuard> guards = const <HTypeGuard>[];
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 tracer.close(); 179 tracer.close();
180 log('compilation succeeded'); 180 log('compilation succeeded');
181 return true; 181 return true;
182 } 182 }
183 183
184 void enableNoSuchMethod(Element element) { 184 void enableNoSuchMethod(Element element) {
185 if (enabledNoSuchMethod) return; 185 if (enabledNoSuchMethod) return;
186 if (element.enclosingElement == objectClass) return; 186 if (element.enclosingElement == objectClass) return;
187 enabledNoSuchMethod = true; 187 enabledNoSuchMethod = true;
188 enqueuer.registerInvocation(NO_SUCH_METHOD, new Invocation(2)); 188 enqueuer.registerInvocation(NO_SUCH_METHOD, new Selector.invocation(2));
189 } 189 }
190 190
191 void enableIsolateSupport(LibraryElement element) { 191 void enableIsolateSupport(LibraryElement element) {
192 isolateLibrary = element; 192 isolateLibrary = element;
193 addToWorkList(element.find(START_ROOT_ISOLATE)); 193 addToWorkList(element.find(START_ROOT_ISOLATE));
194 } 194 }
195 195
196 bool hasIsolateSupport() => isolateLibrary !== null; 196 bool hasIsolateSupport() => isolateLibrary !== null;
197 197
198 void onLibraryLoaded(LibraryElement library, Uri uri) { 198 void onLibraryLoaded(LibraryElement library, Uri uri) {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 void registerDynamicInvocation(SourceString methodName, Selector selector) { 383 void registerDynamicInvocation(SourceString methodName, Selector selector) {
384 assert(selector !== null); 384 assert(selector !== null);
385 enqueuer.registerInvocation(methodName, selector); 385 enqueuer.registerInvocation(methodName, selector);
386 } 386 }
387 387
388 void registerDynamicInvocationOf(Element element) { 388 void registerDynamicInvocationOf(Element element) {
389 addToWorkList(element); 389 addToWorkList(element);
390 } 390 }
391 391
392 void registerDynamicGetter(SourceString methodName) { 392 void registerDynamicGetter(SourceString methodName, Selector selector) {
393 enqueuer.registerGetter(methodName); 393 enqueuer.registerGetter(methodName, selector);
394 } 394 }
395 395
396 void registerDynamicSetter(SourceString methodName) { 396 void registerDynamicSetter(SourceString methodName, Selector selector) {
397 enqueuer.registerSetter(methodName); 397 enqueuer.registerSetter(methodName, selector);
398 } 398 }
399 399
400 void registerInstantiatedClass(ClassElement element) { 400 void registerInstantiatedClass(ClassElement element) {
401 universe.instantiatedClasses.add(element); 401 universe.instantiatedClasses.add(element);
402 enqueuer.onRegisterInstantiatedClass(element); 402 enqueuer.onRegisterInstantiatedClass(element);
403 } 403 }
404 404
405 // TODO(ngeoffray): This should get a type. 405 // TODO(ngeoffray): This should get a type.
406 void registerIsCheck(Element element) { 406 void registerIsCheck(Element element) {
407 universe.isChecks.add(element); 407 universe.isChecks.add(element);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 } 555 }
556 } 556 }
557 557
558 class SourceSpan { 558 class SourceSpan {
559 final Uri uri; 559 final Uri uri;
560 final int begin; 560 final int begin;
561 final int end; 561 final int end;
562 562
563 const SourceSpan(this.uri, this.begin, this.end); 563 const SourceSpan(this.uri, this.begin, this.end);
564 } 564 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/elements/elements.dart » ('j') | lib/compiler/implementation/universe.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698