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

Unified Diff: dart/frog/leg/ssa/builder.dart

Issue 9836022: No globals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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/frog/leg/ssa/closure.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « no previous file | dart/frog/leg/ssa/closure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698