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.")); |
550 if (Elements.isStaticOrTopLevel(element) && element.isField) { | 551 if (Elements.isStaticOrTopLevel(element) && element.isField) { |
551 universe.registerStaticFieldUse(element); | 552 universe.registerStaticFieldUse(element); |
552 } | 553 } |
553 addToWorkList(element); | 554 addToWorkList(element); |
554 compiler.backend.registerStaticUse(element, this); | 555 compiler.backend.registerStaticUse(element, this); |
555 } | 556 } |
556 | 557 |
557 void registerGetOfStaticFunction(FunctionElement element) { | 558 void registerGetOfStaticFunction(FunctionElement element) { |
558 registerStaticUse(element); | 559 registerStaticUse(element); |
559 compiler.backend.registerGetOfStaticFunction(this); | 560 compiler.backend.registerGetOfStaticFunction(this); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 void processWorkItem(void f(WorkItem work), WorkItem work) { | 944 void processWorkItem(void f(WorkItem work), WorkItem work) { |
944 f(work); | 945 f(work); |
945 } | 946 } |
946 } | 947 } |
947 | 948 |
948 void removeFromSet(Map<String, Set<Element>> map, Element element) { | 949 void removeFromSet(Map<String, Set<Element>> map, Element element) { |
949 Set<Element> set = map[element.name]; | 950 Set<Element> set = map[element.name]; |
950 if (set == null) return; | 951 if (set == null) return; |
951 set.remove(element); | 952 set.remove(element); |
952 } | 953 } |
OLD | NEW |