| 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 | 9 |
| 10 import 'common.dart'; | 10 import 'common.dart'; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // support serialization. | 105 // support serialization. |
| 106 Iterable<DartType> get isChecks => const <DartType>[]; | 106 Iterable<DartType> get isChecks => const <DartType>[]; |
| 107 | 107 |
| 108 Iterable<DartType> get checkedModeChecks => const <DartType>[]; | 108 Iterable<DartType> get checkedModeChecks => const <DartType>[]; |
| 109 | 109 |
| 110 Iterable<DartType> get asCasts => const <DartType>[]; | 110 Iterable<DartType> get asCasts => const <DartType>[]; |
| 111 | 111 |
| 112 Iterable<MethodElement> get closurizedFunctions => const <MethodElement>[]; | 112 Iterable<MethodElement> get closurizedFunctions => const <MethodElement>[]; |
| 113 | 113 |
| 114 Iterable<LocalFunctionElement> get closures => const <LocalFunctionElement>[]; | 114 Iterable<LocalFunctionElement> get closures => const <LocalFunctionElement>[]; |
| 115 |
| 116 Iterable<DartType> get typeLiterals => const <DartType>[]; |
| 117 |
| 118 String toString() { |
| 119 StringBuffer sb = new StringBuffer(); |
| 120 |
| 121 void add(String title, Iterable iterable) { |
| 122 if (iterable.isNotEmpty) { |
| 123 sb.write('\n $title:'); |
| 124 iterable.forEach((e) => sb.write('\n $e')); |
| 125 } |
| 126 } |
| 127 |
| 128 add('dynamic invocations', dynamicInvocations); |
| 129 add('dynamic getters', dynamicGetters); |
| 130 add('dynamic setters', dynamicSetters); |
| 131 add('static uses', staticUses); |
| 132 add('instantiated types', instantiatedTypes); |
| 133 add('is-checks', isChecks); |
| 134 add('checked-mode checks', checkedModeChecks); |
| 135 add('as-casts', asCasts); |
| 136 add('closurized functions', closurizedFunctions); |
| 137 add('closures', closures); |
| 138 add('type literals', typeLiterals); |
| 139 |
| 140 return sb.toString(); |
| 141 } |
| 115 } | 142 } |
| 116 | 143 |
| 117 abstract class Enqueuer { | 144 abstract class Enqueuer { |
| 118 final String name; | 145 final String name; |
| 119 final Compiler compiler; // TODO(ahe): Remove this dependency. | 146 final Compiler compiler; // TODO(ahe): Remove this dependency. |
| 120 final EnqueuerStrategy strategy; | 147 final EnqueuerStrategy strategy; |
| 121 final ItemCompilationContextCreator itemCompilationContextCreator; | 148 final ItemCompilationContextCreator itemCompilationContextCreator; |
| 122 final Map<String, Set<Element>> instanceMembersByName | 149 final Map<String, Set<Element>> instanceMembersByName |
| 123 = new Map<String, Set<Element>>(); | 150 = new Map<String, Set<Element>>(); |
| 124 final Map<String, Set<Element>> instanceFunctionsByName | 151 final Map<String, Set<Element>> instanceFunctionsByName |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 @override | 1110 @override |
| 1084 void processStaticUse(Enqueuer enqueuer, Element element) { | 1111 void processStaticUse(Enqueuer enqueuer, Element element) { |
| 1085 enqueuer.registerStaticUseInternal(element); | 1112 enqueuer.registerStaticUseInternal(element); |
| 1086 } | 1113 } |
| 1087 | 1114 |
| 1088 @override | 1115 @override |
| 1089 void processSelector(Enqueuer enqueuer, UniverseSelector selector) { | 1116 void processSelector(Enqueuer enqueuer, UniverseSelector selector) { |
| 1090 enqueuer.handleUnseenSelectorInternal(selector); | 1117 enqueuer.handleUnseenSelectorInternal(selector); |
| 1091 } | 1118 } |
| 1092 } | 1119 } |
| OLD | NEW |