| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 !link.isEmpty; | 289 !link.isEmpty; |
| 290 link = link.tail) { | 290 link = link.tail) { |
| 291 InterfaceType supertype = link.head; | 291 InterfaceType supertype = link.head; |
| 292 ClassElement superclass = supertype.element; | 292 ClassElement superclass = supertype.element; |
| 293 LibraryElement library = superclass.library; | 293 LibraryElement library = superclass.library; |
| 294 if (library.isPlatformLibrary) { | 294 if (library.isPlatformLibrary) { |
| 295 if (_userImplementedPlatformClasses.add(superclass)) { | 295 if (_userImplementedPlatformClasses.add(superclass)) { |
| 296 // Register selectors for all instance methods since these might | 296 // Register selectors for all instance methods since these might |
| 297 // be called on user classes from within the platform | 297 // be called on user classes from within the platform |
| 298 // implementation. | 298 // implementation. |
| 299 superclass.forEachLocalMember((Element element) { | 299 superclass.forEachLocalMember((MemberElement element) { |
| 300 if (element.isConstructor || element.isStatic) return; | 300 if (element.isConstructor || element.isStatic) return; |
| 301 | 301 |
| 302 FunctionElement function = element.asFunctionElement(); | 302 FunctionElement function = element.asFunctionElement(); |
| 303 if (function != null) { | 303 element.computeType(compiler); |
| 304 function.computeSignature(compiler); | |
| 305 } | |
| 306 Selector selector = new Selector.fromElement(element); | 304 Selector selector = new Selector.fromElement(element); |
| 307 if (selector.isGetter) { | 305 if (selector.isGetter) { |
| 308 registry.registerDynamicGetter(selector); | 306 registry.registerDynamicGetter(selector); |
| 309 } else if (selector.isSetter) { | 307 } else if (selector.isSetter) { |
| 310 registry.registerDynamicSetter(selector); | 308 registry.registerDynamicSetter(selector); |
| 311 } else { | 309 } else { |
| 312 registry.registerDynamicInvocation(selector); | 310 registry.registerDynamicInvocation(selector); |
| 313 } | 311 } |
| 314 }); | 312 }); |
| 315 } | 313 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 class _ElementAstCreationContext implements ElementAstCreationContext { | 521 class _ElementAstCreationContext implements ElementAstCreationContext { |
| 524 final Compiler compiler; | 522 final Compiler compiler; |
| 525 final ConstantSystem constantSystem; | 523 final ConstantSystem constantSystem; |
| 526 | 524 |
| 527 _ElementAstCreationContext(this.compiler, this.constantSystem); | 525 _ElementAstCreationContext(this.compiler, this.constantSystem); |
| 528 | 526 |
| 529 DartTypes get dartTypes => compiler.types; | 527 DartTypes get dartTypes => compiler.types; |
| 530 | 528 |
| 531 InternalErrorFunction get internalError => compiler.internalError; | 529 InternalErrorFunction get internalError => compiler.internalError; |
| 532 } | 530 } |
| OLD | NEW |