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

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

Issue 10180001: Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters w… (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
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 Type getType(TypeAnnotation annotation); 8 Type getType(TypeAnnotation annotation);
9 } 9 }
10 10
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 String classNameString = className.slowToString(); 341 String classNameString = className.slowToString();
342 String constructorNameString = constructorName.slowToString(); 342 String constructorNameString = constructorName.slowToString();
343 String name = (constructorName === const SourceString('')) 343 String name = (constructorName === const SourceString(''))
344 ? classNameString 344 ? classNameString
345 : "$classNameString.$constructorNameString"; 345 : "$classNameString.$constructorNameString";
346 MessageKind kind = isImplicitSuperCall 346 MessageKind kind = isImplicitSuperCall
347 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT 347 ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT
348 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR; 348 : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR;
349 error(diagnosticNode, kind, [name]); 349 error(diagnosticNode, kind, [name]);
350 } else { 350 } else {
351 final Compiler compiler = visitor.compiler; 351 if (!selector.applies(result, visitor.compiler)) {
352 FunctionParameters parameters = result.computeParameters(compiler);
353 if (!selector.applies(parameters)) {
354 MessageKind kind = isImplicitSuperCall 352 MessageKind kind = isImplicitSuperCall
355 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT 353 ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
356 : MessageKind.NO_MATCHING_CONSTRUCTOR; 354 : MessageKind.NO_MATCHING_CONSTRUCTOR;
357 error(diagnosticNode, kind); 355 error(diagnosticNode, kind);
358 } 356 }
359 } 357 }
360 return result; 358 return result;
361 } 359 }
362 360
363 FunctionElement resolveRedirection(FunctionElement constructor, 361 FunctionElement resolveRedirection(FunctionElement constructor,
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 1911
1914 TopScope(LibraryElement library) : super(null, library); 1912 TopScope(LibraryElement library) : super(null, library);
1915 Element lookup(SourceString name) { 1913 Element lookup(SourceString name) {
1916 return library.find(name); 1914 return library.find(name);
1917 } 1915 }
1918 1916
1919 Element add(Element newElement) { 1917 Element add(Element newElement) {
1920 throw "Cannot add an element in the top scope"; 1918 throw "Cannot add an element in the top scope";
1921 } 1919 }
1922 } 1920 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698