Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 1910473003: Remove invalidated elements from enqueuer and resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
Johnni Winther 2016/04/25 09:39:44 Add _resolutionImpactCache.remove(element);
ahe 2016/04/26 10:00:46 Done.
1984 }
1979 } 1985 }
1980 1986
1981 class GlobalDependencyRegistry extends EagerRegistry { 1987 class GlobalDependencyRegistry extends EagerRegistry {
1982 final Compiler compiler; 1988 final Compiler compiler;
1983 Setlet<Element> _otherDependencies; 1989 Setlet<Element> _otherDependencies;
1984 1990
1985 GlobalDependencyRegistry(this.compiler) : super('GlobalDependencies', null); 1991 GlobalDependencyRegistry(this.compiler) : super('GlobalDependencies', null);
1986 1992
1987 // TODO(johnniwinther): Rename world/universe/enqueuer through out the 1993 // TODO(johnniwinther): Rename world/universe/enqueuer through out the
1988 // compiler. 1994 // compiler.
(...skipping 26 matching lines...) Expand all
2015 _ElementScanner(this.scanner); 2021 _ElementScanner(this.scanner);
2016 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2022 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2017 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2023 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2018 } 2024 }
2019 2025
2020 class _EmptyEnvironment implements Environment { 2026 class _EmptyEnvironment implements Environment {
2021 const _EmptyEnvironment(); 2027 const _EmptyEnvironment();
2022 2028
2023 String valueOf(String key) => null; 2029 String valueOf(String key) => null;
2024 } 2030 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698