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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 } | 606 } |
607 | 607 |
608 void registerCallMethodWithFreeTypeVariables( | 608 void registerCallMethodWithFreeTypeVariables( |
609 Element element, | 609 Element element, |
610 Registry registry) { | 610 Registry registry) { |
611 compiler.backend.registerCallMethodWithFreeTypeVariables( | 611 compiler.backend.registerCallMethodWithFreeTypeVariables( |
612 element, this, registry); | 612 element, this, registry); |
613 universe.callMethodsWithFreeTypeVariables.add(element); | 613 universe.callMethodsWithFreeTypeVariables.add(element); |
614 } | 614 } |
615 | 615 |
616 void registerClosurizedMember(Element element, Registry registry) { | 616 void registerClosurizedMember(TypedElement element, Registry registry) { |
617 assert(element.isInstanceMember); | 617 assert(element.isInstanceMember); |
618 registerClosureIfFreeTypeVariables(element, registry); | 618 registerClosureIfFreeTypeVariables(element, registry); |
619 compiler.backend.registerBoundClosure(this); | 619 compiler.backend.registerBoundClosure(this); |
620 universe.closurizedMembers.add(element); | 620 universe.closurizedMembers.add(element); |
621 } | 621 } |
622 | 622 |
623 void registerClosureIfFreeTypeVariables(Element element, Registry registry) { | 623 void registerClosureIfFreeTypeVariables(TypedElement element, |
| 624 Registry registry) { |
624 if (element.computeType(compiler).containsTypeVariables) { | 625 if (element.computeType(compiler).containsTypeVariables) { |
625 compiler.backend.registerClosureWithFreeTypeVariables( | 626 compiler.backend.registerClosureWithFreeTypeVariables( |
626 element, this, registry); | 627 element, this, registry); |
627 universe.closuresWithFreeTypeVariables.add(element); | 628 universe.closuresWithFreeTypeVariables.add(element); |
628 } | 629 } |
629 } | 630 } |
630 | 631 |
631 void registerClosure(LocalFunctionElement element, Registry registry) { | 632 void registerClosure(LocalFunctionElement element, Registry registry) { |
632 universe.allClosures.add(element); | 633 universe.allClosures.add(element); |
633 registerClosureIfFreeTypeVariables(element, registry); | 634 registerClosureIfFreeTypeVariables(element, registry); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 void processWorkItem(void f(WorkItem work), WorkItem work) { | 945 void processWorkItem(void f(WorkItem work), WorkItem work) { |
945 f(work); | 946 f(work); |
946 } | 947 } |
947 } | 948 } |
948 | 949 |
949 void removeFromSet(Map<String, Set<Element>> map, Element element) { | 950 void removeFromSet(Map<String, Set<Element>> map, Element element) { |
950 Set<Element> set = map[element.name]; | 951 Set<Element> set = map[element.name]; |
951 if (set == null) return; | 952 if (set == null) return; |
952 set.remove(element); | 953 set.remove(element); |
953 } | 954 } |
OLD | NEW |