Index: dart/frog/leg/ssa/builder.dart |
diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart |
index 30cdbe951515cd25f181e77a6ceeadcfe841ac18..ca5e9aa4f3b385c5c346cd4a6be7c1c37a6b3998 100644 |
--- a/dart/frog/leg/ssa/builder.dart |
+++ b/dart/frog/leg/ssa/builder.dart |
@@ -112,10 +112,15 @@ class Interceptors { |
} |
class SsaBuilderTask extends CompilerTask { |
- SsaBuilderTask(Compiler compiler) |
- : super(compiler), interceptors = new Interceptors(compiler); |
+ final Interceptors interceptors; |
+ final Map<Node, ClosureData> closureDataCache; |
+ |
String get name() => 'SSA builder'; |
- Interceptors interceptors; |
+ |
+ SsaBuilderTask(Compiler compiler) |
+ : interceptors = new Interceptors(compiler), |
+ closureDataCache = new HashMap<Node, ClosureData>(), |
+ super(compiler); |
HGraph build(WorkItem work) { |
return measure(() { |
@@ -271,7 +276,8 @@ class LocalsHandler { |
FunctionExpression node) { |
ClosureTranslator translator = |
- new ClosureTranslator(builder.compiler, builder.elements); |
+ new ClosureTranslator(builder.compiler, builder.elements, |
+ builder.closureDataCache); |
closureData = translator.translate(node); |
FunctionParameters params = function.computeParameters(builder.compiler); |
@@ -718,6 +724,7 @@ class SsaBuilder implements Visitor { |
HGraph graph; |
LocalsHandler localsHandler; |
HInstruction rethrowableException; |
+ final Map<Node, ClosureData> closureDataCache; |
ngeoffray
2012/03/23 07:57:02
Since that guy is only used once in this file, I'd
ahe
2012/03/23 09:09:40
I don't understand your concern. I think the field
ngeoffray
2012/03/23 09:16:28
My concern is: I don't like introducing fields, IM
ahe
2012/03/23 09:35:48
Perhaps I should have said: I assume you want me t
|
Map<TargetElement, JumpHandler> jumpTargets; |
@@ -738,6 +745,7 @@ class SsaBuilder implements Visitor { |
: this.compiler = compiler, |
this.work = work, |
interceptors = compiler.builder.interceptors, |
+ closureDataCache = compiler.builder.closureDataCache, |
methodInterceptionEnabled = true, |
elements = work.resolutionTree, |
graph = new HGraph(), |