| 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 library dart2js.enqueue; | 5 library dart2js.enqueue; |
| 6 | 6 |
| 7 import 'dart:collection' show | 7 import 'dart:collection' show |
| 8 Queue; | 8 Queue; |
| 9 import 'dart2jslib.dart' show | 9 import 'dart2jslib.dart' show |
| 10 invariant, | 10 invariant, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 /// Returns [:true:] if [member] has been processed by this enqueuer. | 132 /// Returns [:true:] if [member] has been processed by this enqueuer. |
| 133 bool isProcessed(Element member); | 133 bool isProcessed(Element member); |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * Documentation wanted -- johnniwinther | 136 * Documentation wanted -- johnniwinther |
| 137 * | 137 * |
| 138 * Invariant: [element] must be a declaration element. | 138 * Invariant: [element] must be a declaration element. |
| 139 */ | 139 */ |
| 140 void addToWorkList(Element element) { | 140 void addToWorkList(Element element) { |
| 141 assert(invariant(element, element.isDeclaration)); | 141 assert(invariant(element, element.isDeclaration)); |
| 142 internalAddToWorkList(element); | 142 if (internalAddToWorkList(element) && compiler.dumpInfo) { |
| 143 // TODO(sigmund): add other missing dependencies (internals, selectors |
| 144 // enqueued after allocations), also enable only for the codegen enqueuer. |
| 145 compiler.dumpInfoTask.registerDependency( |
| 146 compiler.currentElement, element); |
| 147 } |
| 143 } | 148 } |
| 144 | 149 |
| 145 /** | 150 /** |
| 146 * Adds [element] to the work list if it has not already been processed. | 151 * Adds [element] to the work list if it has not already been processed. |
| 147 * | 152 * |
| 148 * Returns [true] if the element was actually added to the queue. | 153 * Returns [true] if the element was actually added to the queue. |
| 149 */ | 154 */ |
| 150 bool internalAddToWorkList(Element element); | 155 bool internalAddToWorkList(Element element); |
| 151 | 156 |
| 152 /// Apply the [worldImpact] of processing [element] to this enqueuer. | 157 /// Apply the [worldImpact] of processing [element] to this enqueuer. |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 void processWorkItem(void f(WorkItem work), WorkItem work) { | 1000 void processWorkItem(void f(WorkItem work), WorkItem work) { |
| 996 f(work); | 1001 f(work); |
| 997 } | 1002 } |
| 998 } | 1003 } |
| 999 | 1004 |
| 1000 void removeFromSet(Map<String, Set<Element>> map, Element element) { | 1005 void removeFromSet(Map<String, Set<Element>> map, Element element) { |
| 1001 Set<Element> set = map[element.name]; | 1006 Set<Element> set = map[element.name]; |
| 1002 if (set == null) return; | 1007 if (set == null) return; |
| 1003 set.remove(element); | 1008 set.remove(element); |
| 1004 } | 1009 } |
| OLD | NEW |