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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 14049010: Take noSuchMethod into account when computing the potential targets of a call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 part of js_backend; 5 part of js_backend;
6 6
7 /** 7 /**
8 * A function element that represents a closure call. The signature is copied 8 * A function element that represents a closure call. The signature is copied
9 * from the given element. 9 * from the given element.
10 */ 10 */
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 } 2604 }
2605 2605
2606 // Finally, sort the classes. 2606 // Finally, sort the classes.
2607 List<ClassElement> sortedClasses = Elements.sortedByPosition(neededClasses); 2607 List<ClassElement> sortedClasses = Elements.sortedByPosition(neededClasses);
2608 2608
2609 // If we need noSuchMethod support, we run through all needed 2609 // If we need noSuchMethod support, we run through all needed
2610 // classes to figure out if we need the support on any native 2610 // classes to figure out if we need the support on any native
2611 // class. If so, we let the native emitter deal with it. 2611 // class. If so, we let the native emitter deal with it.
2612 if (compiler.enabledNoSuchMethod) { 2612 if (compiler.enabledNoSuchMethod) {
2613 SourceString noSuchMethodName = Compiler.NO_SUCH_METHOD; 2613 SourceString noSuchMethodName = Compiler.NO_SUCH_METHOD;
2614 Selector noSuchMethodSelector = new Selector.noSuchMethod(); 2614 Selector noSuchMethodSelector = compiler.noSuchMethodSelector;
2615 for (ClassElement element in sortedClasses) { 2615 for (ClassElement element in sortedClasses) {
2616 if (!element.isNative()) continue; 2616 if (!element.isNative()) continue;
2617 Element member = element.lookupLocalMember(noSuchMethodName); 2617 Element member = element.lookupLocalMember(noSuchMethodName);
2618 if (member == null) continue; 2618 if (member == null) continue;
2619 if (noSuchMethodSelector.applies(member, compiler)) { 2619 if (noSuchMethodSelector.applies(member, compiler)) {
2620 nativeEmitter.handleNoSuchMethod = true; 2620 nativeEmitter.handleNoSuchMethod = true;
2621 break; 2621 break;
2622 } 2622 }
2623 } 2623 }
2624 } 2624 }
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
3038 """; 3038 """;
3039 const String HOOKS_API_USAGE = """ 3039 const String HOOKS_API_USAGE = """
3040 // The code supports the following hooks: 3040 // The code supports the following hooks:
3041 // dartPrint(message) - if this function is defined it is called 3041 // dartPrint(message) - if this function is defined it is called
3042 // instead of the Dart [print] method. 3042 // instead of the Dart [print] method.
3043 // dartMainRunner(main) - if this function is defined, the Dart [main] 3043 // dartMainRunner(main) - if this function is defined, the Dart [main]
3044 // method will not be invoked directly. 3044 // method will not be invoked directly.
3045 // Instead, a closure that will invoke [main] is 3045 // Instead, a closure that will invoke [main] is
3046 // passed to [dartMainRunner]. 3046 // passed to [dartMainRunner].
3047 """; 3047 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698