Chromium Code Reviews| Index: lib/compiler/implementation/ssa/builder.dart |
| diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart |
| index 3095a7fcb6cea21253ae3124ce548ce6673b6d38..2aa4eb7910416d7eaa1ffd8ab8aee74ae5ce1d00 100644 |
| --- a/lib/compiler/implementation/ssa/builder.dart |
| +++ b/lib/compiler/implementation/ssa/builder.dart |
| @@ -139,6 +139,9 @@ class SsaBuilderTask extends CompilerTask { |
| final Interceptors interceptors; |
| final Map<Node, ClosureData> closureDataCache; |
| final CodeEmitterTask emitter; |
| + // Loop tracking information. |
| + final Set<FunctionElement> functionsCalledInLoop; |
| + final Set<SourceString> selectorsCalledInLoop; |
|
ngeoffray
2012/06/12 11:11:09
I think this should be a Map<SourceString, Selecto
Mads Ager (google)
2012/06/12 11:24:21
Another good point. Done!
|
| String get name() => 'SSA builder'; |
| @@ -146,6 +149,8 @@ class SsaBuilderTask extends CompilerTask { |
| : interceptors = new Interceptors(backend.compiler), |
| closureDataCache = new HashMap<Node, ClosureData>(), |
| emitter = backend.emitter, |
| + functionsCalledInLoop = new Set<FunctionElement>(), |
| + selectorsCalledInLoop = new Set<SourceString>(), |
| super(backend.compiler); |
| HGraph build(WorkItem work) { |
| @@ -166,6 +171,10 @@ class SsaBuilderTask extends CompilerTask { |
| break; |
| } |
| assert(graph.isValid()); |
| + if (functionsCalledInLoop.contains(element) || |
| + selectorsCalledInLoop.contains(element.name)) { |
| + graph.calledInLoop = true; |
| + } |
| if (compiler.tracer.enabled) { |
| String name; |
| if (element.enclosingElement !== null && |