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

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

Issue 14636002: Make TypeMask an interface and start hiding implementation details of FlatTypeMask. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 // have a user-defined noSuchMethod implementation. If not, we 2268 // have a user-defined noSuchMethod implementation. If not, we
2269 // skip the selector altogether. 2269 // skip the selector altogether.
2270 2270
2271 // TODO(kasperl): This shouldn't depend on the internals of 2271 // TODO(kasperl): This shouldn't depend on the internals of
2272 // the type mask. Move more of this code to the type mask. 2272 // the type mask. Move more of this code to the type mask.
2273 ClassElement receiverClass = objectClass; 2273 ClassElement receiverClass = objectClass;
2274 TypeMask mask = selector.mask; 2274 TypeMask mask = selector.mask;
2275 if (mask != null) { 2275 if (mask != null) {
2276 // If the mask is empty it doesn't contain a noSuchMethod 2276 // If the mask is empty it doesn't contain a noSuchMethod
2277 // handler -- not even if it is nullable. 2277 // handler -- not even if it is nullable.
2278 if (mask.isEmpty) continue; 2278 receiverClass = mask.topClass();
kasperl 2013/04/30 14:03:24 Here we shouldn't compute a receiver class but rat
ngeoffray 2013/05/01 12:56:16 Done.
2279 receiverClass = mask.base.element; 2279 if (receiverClass == null) continue;
2280 } 2280 }
2281 2281
2282 // If the receiver class is guaranteed to have a member that 2282 // If the receiver class is guaranteed to have a member that
2283 // matches what we're looking for, there's no need to 2283 // matches what we're looking for, there's no need to
2284 // introduce a noSuchMethod handler. It will never be called. 2284 // introduce a noSuchMethod handler. It will never be called.
2285 // 2285 //
2286 // As an example, consider this class hierarchy: 2286 // As an example, consider this class hierarchy:
2287 // 2287 //
2288 // A <-- noSuchMethod 2288 // A <-- noSuchMethod
2289 // / \ 2289 // / \
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
3074 """; 3074 """;
3075 const String HOOKS_API_USAGE = """ 3075 const String HOOKS_API_USAGE = """
3076 // The code supports the following hooks: 3076 // The code supports the following hooks:
3077 // dartPrint(message) - if this function is defined it is called 3077 // dartPrint(message) - if this function is defined it is called
3078 // instead of the Dart [print] method. 3078 // instead of the Dart [print] method.
3079 // dartMainRunner(main) - if this function is defined, the Dart [main] 3079 // dartMainRunner(main) - if this function is defined, the Dart [main]
3080 // method will not be invoked directly. 3080 // method will not be invoked directly.
3081 // Instead, a closure that will invoke [main] is 3081 // Instead, a closure that will invoke [main] is
3082 // passed to [dartMainRunner]. 3082 // passed to [dartMainRunner].
3083 """; 3083 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698