| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 /// [ResolutionRegistry] collects all resolution information. It stores node | 7 /// [ResolutionRegistry] collects all resolution information. It stores node |
| 8 /// related information in a [TreeElements] mapping and registers calls with | 8 /// related information in a [TreeElements] mapping and registers calls with |
| 9 /// [Backend], [World] and [Enqueuer]. | 9 /// [Backend], [World] and [Enqueuer]. |
| 10 // TODO(johnniwinther): Split this into an interface and implementation class. | 10 // TODO(johnniwinther): Split this into an interface and implementation class. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 World get universe => compiler.world; | 24 World get universe => compiler.world; |
| 25 | 25 |
| 26 Backend get backend => compiler.backend; | 26 Backend get backend => compiler.backend; |
| 27 | 27 |
| 28 ////////////////////////////////////////////////////////////////////////////// | 28 ////////////////////////////////////////////////////////////////////////////// |
| 29 // Node-to-Element mapping functionality. | 29 // Node-to-Element mapping functionality. |
| 30 ////////////////////////////////////////////////////////////////////////////// | 30 ////////////////////////////////////////////////////////////////////////////// |
| 31 | 31 |
| 32 /// Register [node] as the declaration of [element]. | 32 /// Register [node] as the declaration of [element]. |
| 33 void defineFunction(FunctionExpression node, FunctionElement element) { | 33 void defineFunction(FunctionExpression node, FunctionElement element) { |
| 34 // TODO(sigurdm): Remove when not needed by the dart2dart backend. |
| 35 if (node.name != null) { |
| 36 mapping[node.name] = element; |
| 37 } |
| 34 mapping[node] = element; | 38 mapping[node] = element; |
| 35 } | 39 } |
| 36 | 40 |
| 37 /// Register [node] as a reference to [element]. | 41 /// Register [node] as a reference to [element]. |
| 38 Element useElement(Node node, Element element) { | 42 Element useElement(Node node, Element element) { |
| 39 if (element == null) return null; | 43 if (element == null) return null; |
| 40 return mapping[node] = element; | 44 return mapping[node] = element; |
| 41 } | 45 } |
| 42 | 46 |
| 43 /// Register [node] as the declaration of [element]. | 47 /// Register [node] as the declaration of [element]. |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 358 |
| 355 void registerAssert(Send node) { | 359 void registerAssert(Send node) { |
| 356 mapping.setAssert(node); | 360 mapping.setAssert(node); |
| 357 backend.resolutionCallbacks.onAssert(node, this); | 361 backend.resolutionCallbacks.onAssert(node, this); |
| 358 } | 362 } |
| 359 | 363 |
| 360 bool isAssert(Send node) { | 364 bool isAssert(Send node) { |
| 361 return mapping.isAssert(node); | 365 return mapping.isAssert(node); |
| 362 } | 366 } |
| 363 } | 367 } |
| OLD | NEW |