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

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

Issue 23225004: Fix a bug where we would emit a noSuchMethod handler in the Object class for Object methods because… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/no_such_method_empty_selector_test.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 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 2800 matching lines...) Expand 10 before | Expand all | Expand 10 after
2811 DartType objectType = objectClass.computeType(compiler); 2811 DartType objectType = objectClass.computeType(compiler);
2812 2812
2813 for (Selector selector in selectors) { 2813 for (Selector selector in selectors) {
2814 // If the selector is typed, we check to see if that type may 2814 // If the selector is typed, we check to see if that type may
2815 // have a user-defined noSuchMethod implementation. If not, we 2815 // have a user-defined noSuchMethod implementation. If not, we
2816 // skip the selector altogether. 2816 // skip the selector altogether.
2817 2817
2818 TypeMask mask = selector.mask; 2818 TypeMask mask = selector.mask;
2819 if (mask == null) { 2819 if (mask == null) {
2820 mask = new TypeMask.subclass(compiler.objectClass.rawType); 2820 mask = new TypeMask.subclass(compiler.objectClass.rawType);
2821 } else if (mask.isEmpty && !mask.isNullable) {
ahe 2013/08/20 08:00:33 I'm a little concerned about this. Perhaps it is j
ngeoffray 2013/08/20 08:03:48 The bug is not necessarily related to type inferen
ahe 2013/08/20 08:11:13 I don't understand why it would be an optimization
ngeoffray 2013/08/20 08:24:03 Why does it have to be bogus? There's an optimizat
ahe 2013/08/20 08:31:44 Your
pavelj 2013/08/20 14:51:44 Peter, that version was not using mirrors. On 201
2822 // We know a non-null empty mask cannot happen at runtime.
2823 // We may have those selectors in the set of seen selectors
2824 // if the backend did not optimize them.
2825 continue;
2821 } 2826 }
2822 2827
2823 // If the receiver is guaranteed to have a member that 2828 // If the receiver is guaranteed to have a member that
2824 // matches what we're looking for, there's no need to 2829 // matches what we're looking for, there's no need to
2825 // introduce a noSuchMethod handler. It will never be called. 2830 // introduce a noSuchMethod handler. It will never be called.
2826 // 2831 //
2827 // As an example, consider this class hierarchy: 2832 // As an example, consider this class hierarchy:
2828 // 2833 //
2829 // A <-- noSuchMethod 2834 // A <-- noSuchMethod
2830 // / \ 2835 // / \
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
4152 4157
4153 const String HOOKS_API_USAGE = """ 4158 const String HOOKS_API_USAGE = """
4154 // The code supports the following hooks: 4159 // The code supports the following hooks:
4155 // dartPrint(message) - if this function is defined it is called 4160 // dartPrint(message) - if this function is defined it is called
4156 // instead of the Dart [print] method. 4161 // instead of the Dart [print] method.
4157 // dartMainRunner(main) - if this function is defined, the Dart [main] 4162 // dartMainRunner(main) - if this function is defined, the Dart [main]
4158 // method will not be invoked directly. 4163 // method will not be invoked directly.
4159 // Instead, a closure that will invoke [main] is 4164 // Instead, a closure that will invoke [main] is
4160 // passed to [dartMainRunner]. 4165 // passed to [dartMainRunner].
4161 """; 4166 """;
OLDNEW
« no previous file with comments | « no previous file | tests/language/no_such_method_empty_selector_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698