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

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

Issue 10534109: Use simple loop tracking instead of size to determine if (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 6 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/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 &&

Powered by Google App Engine
This is Rietveld 408576698