| 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 dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
| 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
| 9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
| 10 class ElementAst { | 10 class ElementAst { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ClassElement superclass = supertype.element; | 310 ClassElement superclass = supertype.element; |
| 311 LibraryElement library = superclass.library; | 311 LibraryElement library = superclass.library; |
| 312 if (library.isPlatformLibrary) { | 312 if (library.isPlatformLibrary) { |
| 313 if (_userImplementedPlatformClasses.add(superclass)) { | 313 if (_userImplementedPlatformClasses.add(superclass)) { |
| 314 // Register selectors for all instance methods since these might | 314 // Register selectors for all instance methods since these might |
| 315 // be called on user classes from within the platform | 315 // be called on user classes from within the platform |
| 316 // implementation. | 316 // implementation. |
| 317 superclass.forEachLocalMember((MemberElement element) { | 317 superclass.forEachLocalMember((MemberElement element) { |
| 318 if (element.isConstructor || element.isStatic) return; | 318 if (element.isConstructor || element.isStatic) return; |
| 319 | 319 |
| 320 FunctionElement function = element.asFunctionElement(); | |
| 321 element.computeType(resolution); | 320 element.computeType(resolution); |
| 322 Selector selector = new Selector.fromElement(element); | 321 Selector selector = new Selector.fromElement(element); |
| 323 registerUse(new DynamicUse(selector, null)); | 322 registerUse(new DynamicUse(selector, null)); |
| 324 }); | 323 }); |
| 325 } | 324 } |
| 326 } | 325 } |
| 327 } | 326 } |
| 328 } | 327 } |
| 329 } | 328 } |
| 330 | 329 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 531 } |
| 533 | 532 |
| 534 // TODO(johnniwinther): Remove this when values are computed from the | 533 // TODO(johnniwinther): Remove this when values are computed from the |
| 535 // expressions. | 534 // expressions. |
| 536 @override | 535 @override |
| 537 void copyConstantValues(DartConstantTask task) { | 536 void copyConstantValues(DartConstantTask task) { |
| 538 constantCompiler.constantValueMap | 537 constantCompiler.constantValueMap |
| 539 .addAll(task.constantCompiler.constantValueMap); | 538 .addAll(task.constantCompiler.constantValueMap); |
| 540 } | 539 } |
| 541 } | 540 } |
| OLD | NEW |