| 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.compiler_base; | 5 library dart2js.compiler_base; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 EventSink, | 8 EventSink, |
| 9 Future; | 9 Future; |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 Registry; | 27 Registry; |
| 28 import 'common/resolution.dart' show | 28 import 'common/resolution.dart' show |
| 29 Parsing, | 29 Parsing, |
| 30 Resolution, | 30 Resolution, |
| 31 ResolutionWorkItem, | 31 ResolutionWorkItem, |
| 32 ResolutionImpact; | 32 ResolutionImpact; |
| 33 import 'common/tasks.dart' show | 33 import 'common/tasks.dart' show |
| 34 CompilerTask, | 34 CompilerTask, |
| 35 GenericTask; | 35 GenericTask; |
| 36 import 'common/work.dart' show | 36 import 'common/work.dart' show |
| 37 ItemCompilationContext, | |
| 38 WorkItem; | 37 WorkItem; |
| 39 import 'compile_time_constants.dart'; | 38 import 'compile_time_constants.dart'; |
| 40 import 'constants/values.dart'; | 39 import 'constants/values.dart'; |
| 41 import 'core_types.dart' show | 40 import 'core_types.dart' show |
| 42 CoreClasses, | 41 CoreClasses, |
| 43 CoreTypes; | 42 CoreTypes; |
| 44 import 'dart_backend/dart_backend.dart' as dart_backend; | 43 import 'dart_backend/dart_backend.dart' as dart_backend; |
| 45 import 'dart_types.dart' show | 44 import 'dart_types.dart' show |
| 46 DartType, | 45 DartType, |
| 47 DynamicType, | 46 DynamicType, |
| (...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2135 } | 2134 } |
| 2136 WorldImpact worldImpact = | 2135 WorldImpact worldImpact = |
| 2137 compiler.backend.impactTransformer.transformResolutionImpact( | 2136 compiler.backend.impactTransformer.transformResolutionImpact( |
| 2138 resolutionImpact); | 2137 resolutionImpact); |
| 2139 return worldImpact; | 2138 return worldImpact; |
| 2140 }); | 2139 }); |
| 2141 } | 2140 } |
| 2142 | 2141 |
| 2143 @override | 2142 @override |
| 2144 void uncacheWorldImpact(Element element) { | 2143 void uncacheWorldImpact(Element element) { |
| 2145 if (compiler.serialization.isDeserialized(element)) return; | |
| 2146 assert(invariant(element, _worldImpactCache[element] != null, | 2144 assert(invariant(element, _worldImpactCache[element] != null, |
| 2147 message: "WorldImpact not computed for $element.")); | 2145 message: "WorldImpact not computed for $element.")); |
| 2148 _worldImpactCache[element] = const WorldImpact(); | 2146 _worldImpactCache[element] = const WorldImpact(); |
| 2149 } | 2147 } |
| 2150 | 2148 |
| 2151 @override | 2149 @override |
| 2152 void emptyCache() { | 2150 void emptyCache() { |
| 2153 for (Element element in _worldImpactCache.keys) { | 2151 for (Element element in _worldImpactCache.keys) { |
| 2154 _worldImpactCache[element] = const WorldImpact(); | 2152 _worldImpactCache[element] = const WorldImpact(); |
| 2155 } | 2153 } |
| 2156 } | 2154 } |
| 2157 | 2155 |
| 2158 @override | 2156 @override |
| 2159 bool hasBeenResolved(Element element) { | 2157 bool hasBeenResolved(Element element) { |
| 2160 return _worldImpactCache.containsKey(element); | 2158 return _worldImpactCache.containsKey(element); |
| 2161 } | 2159 } |
| 2162 | |
| 2163 @override | |
| 2164 ResolutionWorkItem createWorkItem( | |
| 2165 Element element, ItemCompilationContext compilationContext) { | |
| 2166 if (compiler.serialization.isDeserialized(element)) { | |
| 2167 return compiler.serialization.createResolutionWorkItem( | |
| 2168 element, compilationContext); | |
| 2169 } else { | |
| 2170 return new ResolutionWorkItem(element, compilationContext); | |
| 2171 } | |
| 2172 } | |
| 2173 } | 2160 } |
| 2174 | 2161 |
| 2175 // TODO(johnniwinther): Move [ParserTask], [PatchParserTask], [DietParserTask] | 2162 // TODO(johnniwinther): Move [ParserTask], [PatchParserTask], [DietParserTask] |
| 2176 // and [ScannerTask] here. | 2163 // and [ScannerTask] here. |
| 2177 class _CompilerParsing implements Parsing { | 2164 class _CompilerParsing implements Parsing { |
| 2178 final Compiler compiler; | 2165 final Compiler compiler; |
| 2179 | 2166 |
| 2180 _CompilerParsing(this.compiler); | 2167 _CompilerParsing(this.compiler); |
| 2181 | 2168 |
| 2182 @override | 2169 @override |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2216 if (_otherDependencies == null) { | 2203 if (_otherDependencies == null) { |
| 2217 _otherDependencies = new Setlet<Element>(); | 2204 _otherDependencies = new Setlet<Element>(); |
| 2218 } | 2205 } |
| 2219 _otherDependencies.add(element.implementation); | 2206 _otherDependencies.add(element.implementation); |
| 2220 } | 2207 } |
| 2221 | 2208 |
| 2222 Iterable<Element> get otherDependencies { | 2209 Iterable<Element> get otherDependencies { |
| 2223 return _otherDependencies != null ? _otherDependencies : const <Element>[]; | 2210 return _otherDependencies != null ? _otherDependencies : const <Element>[]; |
| 2224 } | 2211 } |
| 2225 } | 2212 } |
| OLD | NEW |