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

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

Issue 10417054: Revert "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
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/scanner_task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/compiler.dart
diff --git a/dart/lib/compiler/implementation/compiler.dart b/dart/lib/compiler/implementation/compiler.dart
index e50803e70e5a56f965761966b1a35fd8beb3f6f4..30125895447c2116e9d5d2e72eb3be47b1772c8a 100644
--- a/dart/lib/compiler/implementation/compiler.dart
+++ b/dart/lib/compiler/implementation/compiler.dart
@@ -12,11 +12,20 @@ class WorkItem {
bool isAnalyzed() => resolutionTree !== null;
- String run(Compiler compiler, Enqueuer world) {
- String code = world.universe.generatedCode[element];
+ int hashCode() => element.hashCode();
+
+ String run(Compiler compiler) {
+ String code = compiler.codegenWorld.generatedCode[element];
if (code !== null) return code;
- if (!isAnalyzed()) compiler.analyze(this);
- return compiler.codegen(this);
+ try {
+ if (!isAnalyzed()) compiler.analyze(this);
+ return compiler.codegen(this);
+ } catch (CompilerCancelledException ex) {
+ throw;
+ } catch (var ex) {
+ compiler.unhandledExceptionOnElement(element);
+ throw;
+ }
}
}
@@ -106,11 +115,6 @@ class Compiler implements DiagnosticListener {
_currentElement = element;
try {
return f();
- } catch (CompilerCancelledException ex) {
- throw;
- } catch (var ex) {
- unhandledExceptionOnElement(element);
- throw;
} finally {
_currentElement = old;
}
@@ -374,7 +378,7 @@ class Compiler implements DiagnosticListener {
codegenProgress.reset();
while (!world.queue.isEmpty()) {
WorkItem work = world.queue.removeLast();
- withCurrentElement(work.element, () => work.run(this, world));
+ withCurrentElement(work.element, () => work.run(this));
}
world.queueIsClosed = true;
assert(world.checkNoEnqueuedInvokedInstanceMethods());
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698