| 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 EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
| 8 | 8 |
| 9 import '../compiler_new.dart' as api; | 9 import '../compiler_new.dart' as api; |
| 10 import 'cache_strategy.dart' show CacheStrategy; | 10 import 'cache_strategy.dart' show CacheStrategy; |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 int slashPos = libraryUri.path.indexOf('/'); | 1201 int slashPos = libraryUri.path.indexOf('/'); |
| 1202 if (slashPos != -1) { | 1202 if (slashPos != -1) { |
| 1203 String packageName = libraryUri.path.substring(0, slashPos); | 1203 String packageName = libraryUri.path.substring(0, slashPos); |
| 1204 return new Uri(scheme: 'package', path: packageName); | 1204 return new Uri(scheme: 'package', path: packageName); |
| 1205 } | 1205 } |
| 1206 } | 1206 } |
| 1207 return libraryUri; | 1207 return libraryUri; |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 void forgetElement(Element element) { | 1210 void forgetElement(Element element) { |
| 1211 resolution.forgetElement(element); |
| 1211 enqueuer.forgetElement(element); | 1212 enqueuer.forgetElement(element); |
| 1212 if (element is MemberElement) { | 1213 if (element is MemberElement) { |
| 1213 for (Element closure in element.nestedClosures) { | 1214 for (Element closure in element.nestedClosures) { |
| 1214 // TODO(ahe): It would be nice to reuse names of nested closures. | 1215 // TODO(ahe): It would be nice to reuse names of nested closures. |
| 1215 closureToClassMapper.forgetElement(closure); | 1216 closureToClassMapper.forgetElement(closure); |
| 1216 } | 1217 } |
| 1217 } | 1218 } |
| 1218 backend.forgetElement(element); | 1219 backend.forgetElement(element); |
| 1219 } | 1220 } |
| 1220 | 1221 |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 @override | 1970 @override |
| 1970 ResolutionWorkItem createWorkItem( | 1971 ResolutionWorkItem createWorkItem( |
| 1971 Element element, ItemCompilationContext compilationContext) { | 1972 Element element, ItemCompilationContext compilationContext) { |
| 1972 if (compiler.serialization.isDeserialized(element)) { | 1973 if (compiler.serialization.isDeserialized(element)) { |
| 1973 return compiler.serialization | 1974 return compiler.serialization |
| 1974 .createResolutionWorkItem(element, compilationContext); | 1975 .createResolutionWorkItem(element, compilationContext); |
| 1975 } else { | 1976 } else { |
| 1976 return new ResolutionWorkItem(element, compilationContext); | 1977 return new ResolutionWorkItem(element, compilationContext); |
| 1977 } | 1978 } |
| 1978 } | 1979 } |
| 1980 |
| 1981 @override |
| 1982 void forgetElement(Element element) { |
| 1983 _worldImpactCache.remove(element); |
| 1984 _resolutionImpactCache.remove(element); |
| 1985 } |
| 1979 } | 1986 } |
| 1980 | 1987 |
| 1981 class GlobalDependencyRegistry extends EagerRegistry { | 1988 class GlobalDependencyRegistry extends EagerRegistry { |
| 1982 final Compiler compiler; | 1989 final Compiler compiler; |
| 1983 Setlet<Element> _otherDependencies; | 1990 Setlet<Element> _otherDependencies; |
| 1984 | 1991 |
| 1985 GlobalDependencyRegistry(this.compiler) : super('GlobalDependencies', null); | 1992 GlobalDependencyRegistry(this.compiler) : super('GlobalDependencies', null); |
| 1986 | 1993 |
| 1987 // TODO(johnniwinther): Rename world/universe/enqueuer through out the | 1994 // TODO(johnniwinther): Rename world/universe/enqueuer through out the |
| 1988 // compiler. | 1995 // compiler. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2015 _ElementScanner(this.scanner); | 2022 _ElementScanner(this.scanner); |
| 2016 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); | 2023 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); |
| 2017 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); | 2024 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); |
| 2018 } | 2025 } |
| 2019 | 2026 |
| 2020 class _EmptyEnvironment implements Environment { | 2027 class _EmptyEnvironment implements Environment { |
| 2021 const _EmptyEnvironment(); | 2028 const _EmptyEnvironment(); |
| 2022 | 2029 |
| 2023 String valueOf(String key) => null; | 2030 String valueOf(String key) => null; |
| 2024 } | 2031 } |
| OLD | NEW |