| 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 class LocalPlaceholder implements Hashable { | 5 class LocalPlaceholder implements Hashable { |
| 6 final String identifier; | 6 final String identifier; |
| 7 final Set<Node> nodes; | 7 final Set<Node> nodes; |
| 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| 9 int hashCode() => identifier.hashCode(); | 9 int hashCode() => identifier.hashCode(); |
| 10 String toString() => | 10 String toString() => |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 void makeNullPlaceholder(Node node) { | 199 void makeNullPlaceholder(Node node) { |
| 200 assert(node is Identifier || node is Send); | 200 assert(node is Identifier || node is Send); |
| 201 nullNodes.add(node); | 201 nullNodes.add(node); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void makeElementPlaceholder(Node node, Element element) { | 204 void makeElementPlaceholder(Node node, Element element) { |
| 205 assert(element !== null); | 205 assert(element !== null); |
| 206 if (element === entryFunction) return; | 206 if (element === entryFunction) return; |
| 207 if (element.getLibrary() === coreLibrary) return; | 207 if (element.getLibrary() === coreLibrary) return; |
| 208 if (isDartCoreLib(compiler, element.getLibrary()) |
| 209 && !element.isTopLevel()) { |
| 210 return; |
| 211 } |
| 208 if (element == compiler.types.dynamicType.element) { | 212 if (element == compiler.types.dynamicType.element) { |
| 209 internalError( | 213 internalError( |
| 210 'Should never make element placeholder for dynamic type element', | 214 'Should never make element placeholder for dynamic type element', |
| 211 node); | 215 node); |
| 212 } | 216 } |
| 213 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); | 217 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); |
| 214 } | 218 } |
| 215 | 219 |
| 216 void makePrivateIdentifier(Identifier node) { | 220 void makePrivateIdentifier(Identifier node) { |
| 217 assert(node !== null); | 221 assert(node !== null); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 } | 411 } |
| 408 node.visitChildren(this); | 412 node.visitChildren(this); |
| 409 } | 413 } |
| 410 | 414 |
| 411 visitTypedef(Typedef node) { | 415 visitTypedef(Typedef node) { |
| 412 assert(currentElement is TypedefElement); | 416 assert(currentElement is TypedefElement); |
| 413 makeElementPlaceholder(node.name, currentElement); | 417 makeElementPlaceholder(node.name, currentElement); |
| 414 node.visitChildren(this); | 418 node.visitChildren(this); |
| 415 } | 419 } |
| 416 } | 420 } |
| OLD | NEW |