Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 """; |
| OLD | NEW |