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

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

Issue 10441014: Parameterize WorkItem.run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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: dart/lib/compiler/implementation/compiler.dart
diff --git a/dart/lib/compiler/implementation/compiler.dart b/dart/lib/compiler/implementation/compiler.dart
index 30125895447c2116e9d5d2e72eb3be47b1772c8a..e50803e70e5a56f965761966b1a35fd8beb3f6f4 100644
--- a/dart/lib/compiler/implementation/compiler.dart
+++ b/dart/lib/compiler/implementation/compiler.dart
@@ -12,20 +12,11 @@ class WorkItem {
bool isAnalyzed() => resolutionTree !== null;
- int hashCode() => element.hashCode();
-
- String run(Compiler compiler) {
- String code = compiler.codegenWorld.generatedCode[element];
+ String run(Compiler compiler, Enqueuer world) {
+ String code = world.universe.generatedCode[element];
if (code !== null) return code;
- try {
- if (!isAnalyzed()) compiler.analyze(this);
- return compiler.codegen(this);
- } catch (CompilerCancelledException ex) {
- throw;
- } catch (var ex) {
- compiler.unhandledExceptionOnElement(element);
- throw;
- }
+ if (!isAnalyzed()) compiler.analyze(this);
+ return compiler.codegen(this);
}
}
@@ -115,6 +106,11 @@ class Compiler implements DiagnosticListener {
_currentElement = element;
try {
return f();
+ } catch (CompilerCancelledException ex) {
+ throw;
+ } catch (var ex) {
+ unhandledExceptionOnElement(element);
+ throw;
} finally {
_currentElement = old;
}
@@ -378,7 +374,7 @@ class Compiler implements DiagnosticListener {
codegenProgress.reset();
while (!world.queue.isEmpty()) {
WorkItem work = world.queue.removeLast();
- withCurrentElement(work.element, () => work.run(this));
+ withCurrentElement(work.element, () => work.run(this, world));
}
world.queueIsClosed = true;
assert(world.checkNoEnqueuedInvokedInstanceMethods());

Powered by Google App Engine
This is Rietveld 408576698