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

Side by Side Diff: pkg/compiler/lib/src/common/resolution.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/codegen.dart ('k') | pkg/compiler/lib/src/common/work.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.common.resolution; 5 library dart2js.common.resolution;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../compile_time_constants.dart'; 8 import '../compile_time_constants.dart';
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/expressions.dart' show ConstantExpression; 10 import '../constants/expressions.dart' show ConstantExpression;
(...skipping 20 matching lines...) Expand all
31 import '../options.dart' show CompilerOptions, ParserOptions; 31 import '../options.dart' show CompilerOptions, ParserOptions;
32 import '../parser/element_listener.dart' show ScannerOptions; 32 import '../parser/element_listener.dart' show ScannerOptions;
33 import '../parser/parser_task.dart'; 33 import '../parser/parser_task.dart';
34 import '../patch_parser.dart'; 34 import '../patch_parser.dart';
35 import '../resolution/resolution.dart'; 35 import '../resolution/resolution.dart';
36 import '../tree/tree.dart' show Send, TypeAnnotation; 36 import '../tree/tree.dart' show Send, TypeAnnotation;
37 import '../universe/call_structure.dart' show CallStructure; 37 import '../universe/call_structure.dart' show CallStructure;
38 import '../universe/world_impact.dart' show WorldImpact; 38 import '../universe/world_impact.dart' show WorldImpact;
39 import '../universe/feature.dart'; 39 import '../universe/feature.dart';
40 import 'backend_api.dart'; 40 import 'backend_api.dart';
41 import 'work.dart' show ItemCompilationContext, WorkItem; 41 import 'work.dart' show WorkItem;
42 42
43 /// [WorkItem] used exclusively by the [ResolutionEnqueuer]. 43 /// [WorkItem] used exclusively by the [ResolutionEnqueuer].
44 class ResolutionWorkItem extends WorkItem { 44 class ResolutionWorkItem extends WorkItem {
45 bool _isAnalyzed = false; 45 bool _isAnalyzed = false;
46 46
47 ResolutionWorkItem( 47 ResolutionWorkItem(AstElement element) : super(element);
48 AstElement element, ItemCompilationContext compilationContext)
49 : super(element, compilationContext);
50 48
51 WorldImpact run(Compiler compiler, ResolutionEnqueuer world) { 49 WorldImpact run(Compiler compiler, ResolutionEnqueuer world) {
52 WorldImpact impact = compiler.analyze(this, world); 50 WorldImpact impact = compiler.analyze(this, world);
53 _isAnalyzed = true; 51 _isAnalyzed = true;
54 return impact; 52 return impact;
55 } 53 }
56 54
57 bool get isAnalyzed => _isAnalyzed; 55 bool get isAnalyzed => _isAnalyzed;
58 } 56 }
59 57
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 bool hasBeenResolved(Element element); 152 bool hasBeenResolved(Element element);
155 153
156 /// Resolve [element] if it has not already been resolved. 154 /// Resolve [element] if it has not already been resolved.
157 void ensureResolved(Element element); 155 void ensureResolved(Element element);
158 156
159 /// Registers that [element] has a compile time error. 157 /// Registers that [element] has a compile time error.
160 /// 158 ///
161 /// The error itself is given in [message]. 159 /// The error itself is given in [message].
162 void registerCompileTimeError(Element element, DiagnosticMessage message); 160 void registerCompileTimeError(Element element, DiagnosticMessage message);
163 161
164 ResolutionWorkItem createWorkItem( 162 ResolutionWorkItem createWorkItem(Element element);
165 Element element, ItemCompilationContext compilationContext);
166 163
167 /// Returns `true` if [element] as a fully computed [ResolvedAst]. 164 /// Returns `true` if [element] as a fully computed [ResolvedAst].
168 bool hasResolvedAst(ExecutableElement element); 165 bool hasResolvedAst(ExecutableElement element);
169 166
170 /// Returns the `ResolvedAst` for the [element]. 167 /// Returns the `ResolvedAst` for the [element].
171 ResolvedAst getResolvedAst(ExecutableElement element); 168 ResolvedAst getResolvedAst(ExecutableElement element);
172 169
173 /// Returns `true` if the [ResolutionImpact] for [element] is cached. 170 /// Returns `true` if the [ResolutionImpact] for [element] is cached.
174 bool hasResolutionImpact(Element element); 171 bool hasResolutionImpact(Element element);
175 172
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 if (cls.isPatch) { 246 if (cls.isPatch) {
250 patchParser.parsePatchClassNode(cls); 247 patchParser.parsePatchClassNode(cls);
251 } 248 }
252 }); 249 });
253 } 250 }
254 251
255 @override 252 @override
256 ScannerOptions getScannerOptionsFor(Element element) => new ScannerOptions( 253 ScannerOptions getScannerOptionsFor(Element element) => new ScannerOptions(
257 canUseNative: backend.canLibraryUseNative(element.library)); 254 canUseNative: backend.canLibraryUseNative(element.library));
258 } 255 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/common/work.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698