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