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

Unified Diff: lib/compiler/implementation/ssa/codegen.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/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index e43edf1800e0bf96b158403fc4c3c8e8b8417b59..55b17220829be4e42043c342814db8841907cc32 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1607,13 +1607,21 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
buffer.add(compiler.namer.instanceMethodInvocationName(
currentLibrary, node.name, node.selector));
visitArguments(node.inputs);
+ var inLoop = node.block.enclosingLoopHeader !== null;
ngeoffray 2012/06/12 11:11:09 var -> bool
Mads Ager (google) 2012/06/12 11:24:21 Done.
if (node.element !== null) {
// If we know we're calling a specific method, register that
// method only.
+ if (inLoop) {
+ backend.builder.functionsCalledInLoop.add(node.element);
ngeoffray 2012/06/12 11:11:09 You should store the optimized selector (line 1624
Mads Ager (google) 2012/06/12 11:24:21 Done.
+ }
world.registerDynamicInvocationOf(node.element);
} else {
+ if (inLoop) {
+ backend.builder.selectorsCalledInLoop.add(node.name);
+ }
world.registerDynamicInvocation(
- node.name, getOptimizedSelectorFor(node, node.selector));
+ node.name,
+ getOptimizedSelectorFor(node, node.selector));
}
}
endExpression(JSPrecedence.CALL_PRECEDENCE);

Powered by Google App Engine
This is Rietveld 408576698