| 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 dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 typedef ItemCompilationContext ItemCompilationContextCreator(); | 7 typedef ItemCompilationContext ItemCompilationContextCreator(); |
| 8 | 8 |
| 9 class EnqueueTask extends CompilerTask { | 9 class EnqueueTask extends CompilerTask { |
| 10 final ResolutionEnqueuer resolution; | 10 final ResolutionEnqueuer resolution; |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 | 541 |
| 542 /** | 542 /** |
| 543 * Documentation wanted -- johnniwinther | 543 * Documentation wanted -- johnniwinther |
| 544 * | 544 * |
| 545 * Invariant: [element] must be a declaration element. | 545 * Invariant: [element] must be a declaration element. |
| 546 */ | 546 */ |
| 547 void registerStaticUse(Element element) { | 547 void registerStaticUse(Element element) { |
| 548 if (element == null) return; | 548 if (element == null) return; |
| 549 assert(invariant(element, element.isDeclaration, | 549 assert(invariant(element, element.isDeclaration)); |
| 550 message: "Element ${element} is not the declaration.")); | |
| 551 if (Elements.isStaticOrTopLevel(element) && element.isField) { | 550 if (Elements.isStaticOrTopLevel(element) && element.isField) { |
| 552 universe.registerStaticFieldUse(element); | 551 universe.registerStaticFieldUse(element); |
| 553 } | 552 } |
| 554 addToWorkList(element); | 553 addToWorkList(element); |
| 555 compiler.backend.registerStaticUse(element, this); | 554 compiler.backend.registerStaticUse(element, this); |
| 556 } | 555 } |
| 557 | 556 |
| 558 void registerGetOfStaticFunction(FunctionElement element) { | 557 void registerGetOfStaticFunction(FunctionElement element) { |
| 559 registerStaticUse(element); | 558 registerStaticUse(element); |
| 560 compiler.backend.registerGetOfStaticFunction(this); | 559 compiler.backend.registerGetOfStaticFunction(this); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 void processWorkItem(void f(WorkItem work), WorkItem work) { | 943 void processWorkItem(void f(WorkItem work), WorkItem work) { |
| 945 f(work); | 944 f(work); |
| 946 } | 945 } |
| 947 } | 946 } |
| 948 | 947 |
| 949 void removeFromSet(Map<String, Set<Element>> map, Element element) { | 948 void removeFromSet(Map<String, Set<Element>> map, Element element) { |
| 950 Set<Element> set = map[element.name]; | 949 Set<Element> set = map[element.name]; |
| 951 if (set == null) return; | 950 if (set == null) return; |
| 952 set.remove(element); | 951 set.remove(element); |
| 953 } | 952 } |
| OLD | NEW |