Chromium Code Reviews| 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 if (node.name != null) { | |
|
Johnni Winther
2014/08/15 07:49:20
Add TODO to remove when not needed by the dart2dar
sigurdm
2014/08/15 13:06:27
Done.
| |
| 35 mapping[node.name] = element; | |
| 36 } | |
| 34 mapping[node] = element; | 37 mapping[node] = element; |
| 35 } | 38 } |
| 36 | 39 |
| 37 /// Register [node] as a reference to [element]. | 40 /// Register [node] as a reference to [element]. |
| 38 Element useElement(Node node, Element element) { | 41 Element useElement(Node node, Element element) { |
| 39 if (element == null) return null; | 42 if (element == null) return null; |
| 40 return mapping[node] = element; | 43 return mapping[node] = element; |
| 41 } | 44 } |
| 42 | 45 |
| 43 /// Register [node] as the declaration of [element]. | 46 /// Register [node] as the declaration of [element]. |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 | 357 |
| 355 void registerAssert(Send node) { | 358 void registerAssert(Send node) { |
| 356 mapping.setAssert(node); | 359 mapping.setAssert(node); |
| 357 backend.resolutionCallbacks.onAssert(node, this); | 360 backend.resolutionCallbacks.onAssert(node, this); |
| 358 } | 361 } |
| 359 | 362 |
| 360 bool isAssert(Send node) { | 363 bool isAssert(Send node) { |
| 361 return mapping.isAssert(node); | 364 return mapping.isAssert(node); |
| 362 } | 365 } |
| 363 } | 366 } |
| OLD | NEW |