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

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

Issue 2302363003: No longer store the compilation-context in WorkItem. (Closed)
Patch Set: ... lint Created 4 years, 3 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/work.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;
11 import 'closure.dart' as closureMapping show ClosureTask; 11 import 'closure.dart' as closureMapping show ClosureTask;
12 import 'common/backend_api.dart' show Backend; 12 import 'common/backend_api.dart' show Backend;
13 import 'common/codegen.dart' show CodegenWorkItem; 13 import 'common/codegen.dart' show CodegenWorkItem;
14 import 'common/names.dart' show Selectors; 14 import 'common/names.dart' show Selectors;
15 import 'common/names.dart' show Identifiers, Uris; 15 import 'common/names.dart' show Identifiers, Uris;
16 import 'common/registry.dart' show EagerRegistry, Registry; 16 import 'common/registry.dart' show EagerRegistry, Registry;
17 import 'common/resolution.dart' 17 import 'common/resolution.dart'
18 show 18 show
19 ParsingContext, 19 ParsingContext,
20 Resolution, 20 Resolution,
21 ResolutionWorkItem, 21 ResolutionWorkItem,
22 ResolutionImpact, 22 ResolutionImpact,
23 Target; 23 Target;
24 import 'common/tasks.dart' show CompilerTask, GenericTask, Measurer; 24 import 'common/tasks.dart' show CompilerTask, GenericTask, Measurer;
25 import 'common/work.dart' show ItemCompilationContext, WorkItem; 25 import 'common/work.dart' show WorkItem;
26 import 'common.dart'; 26 import 'common.dart';
27 import 'compile_time_constants.dart'; 27 import 'compile_time_constants.dart';
28 import 'constants/values.dart'; 28 import 'constants/values.dart';
29 import 'core_types.dart' show CoreClasses, CommonElements, CoreTypes; 29 import 'core_types.dart' show CoreClasses, CommonElements, CoreTypes;
30 import 'dart_types.dart' show DartType, DynamicType, InterfaceType, Types; 30 import 'dart_types.dart' show DartType, DynamicType, InterfaceType, Types;
31 import 'deferred_load.dart' show DeferredLoadTask; 31 import 'deferred_load.dart' show DeferredLoadTask;
32 import 'diagnostics/code_location.dart'; 32 import 'diagnostics/code_location.dart';
33 import 'diagnostics/diagnostic_listener.dart' show DiagnosticReporter; 33 import 'diagnostics/diagnostic_listener.dart' show DiagnosticReporter;
34 import 'diagnostics/invariant.dart' show REPORT_EXCESS_RESOLUTION; 34 import 'diagnostics/invariant.dart' show REPORT_EXCESS_RESOLUTION;
35 import 'diagnostics/messages.dart' show Message, MessageTemplate; 35 import 'diagnostics/messages.dart' show Message, MessageTemplate;
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 } 2144 }
2145 _resolutionImpactCache.clear(); 2145 _resolutionImpactCache.clear();
2146 } 2146 }
2147 2147
2148 @override 2148 @override
2149 bool hasBeenResolved(Element element) { 2149 bool hasBeenResolved(Element element) {
2150 return _worldImpactCache.containsKey(element); 2150 return _worldImpactCache.containsKey(element);
2151 } 2151 }
2152 2152
2153 @override 2153 @override
2154 ResolutionWorkItem createWorkItem( 2154 ResolutionWorkItem createWorkItem(Element element) {
2155 Element element, ItemCompilationContext compilationContext) {
2156 if (compiler.serialization.isDeserialized(element)) { 2155 if (compiler.serialization.isDeserialized(element)) {
2157 return compiler.serialization 2156 return compiler.serialization.createResolutionWorkItem(element);
2158 .createResolutionWorkItem(element, compilationContext);
2159 } else { 2157 } else {
2160 return new ResolutionWorkItem(element, compilationContext); 2158 return new ResolutionWorkItem(element);
2161 } 2159 }
2162 } 2160 }
2163 2161
2164 @override 2162 @override
2165 void forgetElement(Element element) { 2163 void forgetElement(Element element) {
2166 _worldImpactCache.remove(element); 2164 _worldImpactCache.remove(element);
2167 _resolutionImpactCache.remove(element); 2165 _resolutionImpactCache.remove(element);
2168 } 2166 }
2169 2167
2170 ConstantValue _proxyConstant; 2168 ConstantValue _proxyConstant;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2231 _ElementScanner(this.scanner); 2229 _ElementScanner(this.scanner);
2232 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2230 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2233 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2231 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2234 } 2232 }
2235 2233
2236 class _EmptyEnvironment implements Environment { 2234 class _EmptyEnvironment implements Environment {
2237 const _EmptyEnvironment(); 2235 const _EmptyEnvironment();
2238 2236
2239 String valueOf(String key) => null; 2237 String valueOf(String key) => null;
2240 } 2238 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/work.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698