| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 562 |
| 563 void registerIsCheck(DartType type, Registry registry) { | 563 void registerIsCheck(DartType type, Registry registry) { |
| 564 type = universe.registerIsCheck(type, compiler); | 564 type = universe.registerIsCheck(type, compiler); |
| 565 // Even in checked mode, type annotations for return type and argument | 565 // Even in checked mode, type annotations for return type and argument |
| 566 // types do not imply type checks, so there should never be a check | 566 // types do not imply type checks, so there should never be a check |
| 567 // against the type variable of a typedef. | 567 // against the type variable of a typedef. |
| 568 assert(type.kind != TypeKind.TYPE_VARIABLE || | 568 assert(type.kind != TypeKind.TYPE_VARIABLE || |
| 569 !type.element.enclosingElement.isTypedef); | 569 !type.element.enclosingElement.isTypedef); |
| 570 } | 570 } |
| 571 | 571 |
| 572 /** | |
| 573 * If a factory constructor is used with type arguments, we lose track | |
| 574 * which arguments could be used to create instances of classes that use their | |
| 575 * type variables as expressions, so we have to remember if we saw such a use. | |
| 576 */ | |
| 577 void registerFactoryWithTypeArguments(Registry registry) { | |
| 578 universe.usingFactoryWithTypeArguments = true; | |
| 579 } | |
| 580 | |
| 581 void registerCallMethodWithFreeTypeVariables( | 572 void registerCallMethodWithFreeTypeVariables( |
| 582 Element element, | 573 Element element, |
| 583 Registry registry) { | 574 Registry registry) { |
| 584 compiler.backend.registerCallMethodWithFreeTypeVariables( | 575 compiler.backend.registerCallMethodWithFreeTypeVariables( |
| 585 element, this, registry); | 576 element, this, registry); |
| 586 universe.callMethodsWithFreeTypeVariables.add(element); | 577 universe.callMethodsWithFreeTypeVariables.add(element); |
| 587 } | 578 } |
| 588 | 579 |
| 589 void registerClosurizedMember(Element element, Registry registry) { | 580 void registerClosurizedMember(Element element, Registry registry) { |
| 590 assert(element.isInstanceMember); | 581 assert(element.isInstanceMember); |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 void processWorkItem(void f(WorkItem work), WorkItem work) { | 899 void processWorkItem(void f(WorkItem work), WorkItem work) { |
| 909 f(work); | 900 f(work); |
| 910 } | 901 } |
| 911 } | 902 } |
| 912 | 903 |
| 913 void removeFromSet(Map<String, Set<Element>> map, Element element) { | 904 void removeFromSet(Map<String, Set<Element>> map, Element element) { |
| 914 Set<Element> set = map[element.name]; | 905 Set<Element> set = map[element.name]; |
| 915 if (set == null) return; | 906 if (set == null) return; |
| 916 set.remove(element); | 907 set.remove(element); |
| 917 } | 908 } |
| OLD | NEW |