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

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

Issue 10386086: RFC: Start refactoring to provide more than a single backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next iteration 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: lib/compiler/implementation/ssa/closure.dart
diff --git a/lib/compiler/implementation/ssa/closure.dart b/lib/compiler/implementation/ssa/closure.dart
index 09e025b3f8b8443de8f881e6a425bd70af186478..591cfb157b7a76dcf76d36c57099032a4498c434 100644
--- a/lib/compiler/implementation/ssa/closure.dart
+++ b/lib/compiler/implementation/ssa/closure.dart
@@ -97,7 +97,7 @@ class ClosureData {
}
class ClosureTranslator extends AbstractVisitor {
- final Compiler compiler;
+ final SsaBuilder builder;
final TreeElements elements;
int closureFieldCounter = 0;
bool inTryCatchOrFinally = false;
@@ -119,11 +119,14 @@ class ClosureTranslator extends AbstractVisitor {
bool insideClosure = false;
- ClosureTranslator(Compiler compiler, this.elements)
- : capturedVariableMapping = new Map<Element, Element>(),
+ Compiler get compiler() => builder.compiler;
+
+ ClosureTranslator(SsaBuilder builder)
+ : this.builder = builder,
+ this.elements = builder.elements,
+ capturedVariableMapping = new Map<Element, Element>(),
closures = <FunctionExpression>[],
- this.compiler = compiler,
- this.closureDataCache = compiler.builder.closureDataCache;
+ this.closureDataCache = builder.builder.closureDataCache;
ClosureData translate(Node node) {
// Closures have already been analyzed when visiting the surrounding

Powered by Google App Engine
This is Rietveld 408576698