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

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 next round of 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
« no previous file with comments | « lib/compiler/implementation/ssa/bailout.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ec5358ff4c14ba5a293f4fabe459d37321d26a19 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 Map<SourceString, Selector> selectorsCalledInLoop;
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 Map<SourceString, Selector>(),
super(backend.compiler);
HGraph build(WorkItem work) {
@@ -166,6 +171,12 @@ class SsaBuilderTask extends CompilerTask {
break;
}
assert(graph.isValid());
+ bool inLoop = functionsCalledInLoop.contains(element);
+ if (!inLoop) {
+ Selector selector = selectorsCalledInLoop[element.name];
+ inLoop = selector !== null && selector.applies(element, compiler);
+ }
+ graph.calledInLoop = inLoop;
if (compiler.tracer.enabled) {
String name;
if (element.enclosingElement !== null &&
« no previous file with comments | « lib/compiler/implementation/ssa/bailout.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698