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

Unified Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 16035026: Fix 2 host-checked error with the enqueuer: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/compiler.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/compiler.dart (revision 23812)
+++ sdk/lib/_internal/compiler/implementation/compiler.dart (working copy)
@@ -30,21 +30,18 @@
* Invariant: [element] must be a declaration element.
*/
final Element element;
- TreeElements get resolutionTree;
+ TreeElements resolutionTree;
WorkItem(this.element, this.compilationContext) {
assert(invariant(element, element.isDeclaration));
}
- bool isAnalyzed() => resolutionTree != null;
void run(Compiler compiler, Enqueuer world);
}
/// [WorkItem] used exclusively by the [ResolutionEnqueuer].
class ResolutionWorkItem extends WorkItem {
- TreeElements resolutionTree;
-
ResolutionWorkItem(Element element,
ItemCompilationContext compilationContext)
: super(element, compilationContext);
@@ -52,25 +49,23 @@
void run(Compiler compiler, ResolutionEnqueuer world) {
resolutionTree = compiler.analyze(this, world);
}
+
+ bool isAnalyzed() => resolutionTree != null;
}
/// [WorkItem] used exclusively by the [CodegenEnqueuer].
class CodegenWorkItem extends WorkItem {
- final TreeElements resolutionTree;
-
bool allowSpeculativeOptimization = true;
List<HTypeGuard> guards = const <HTypeGuard>[];
CodegenWorkItem(Element element,
- TreeElements this.resolutionTree,
ItemCompilationContext compilationContext)
- : super(element, compilationContext) {
- assert(invariant(element, resolutionTree != null,
- message: 'Resolution tree is null for $element in codegen work item'));
- }
+ : super(element, compilationContext);
void run(Compiler compiler, CodegenEnqueuer world) {
if (world.isProcessed(element)) return;
+ resolutionTree =
+ compiler.enqueuer.resolution.getCachedElements(element);
compiler.codegen(this, world);
}
}

Powered by Google App Engine
This is Rietveld 408576698