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

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

Issue 10827181: Collect call site information and use that for estimating parameter types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments from ahe@ Created 8 years, 4 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 1ef09f150366d92b7012dd2e92fe84fd3cc3afb6..82b9b4ce7f88604f3e88cc3b9b719c1f66df6fcc 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1731,17 +1731,19 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
currentLibrary, node.name, node.selector));
visitArguments(node.inputs);
bool inLoop = node.block.enclosingLoopHeader !== null;
+
+ // Register this invocation to collect the types used at all call sites.
+ Selector selector = getOptimizedSelectorFor(node, node.selector);
+ backend.registerDynamicInvocation(node, selector);
+
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);
- }
+ if (inLoop) backend.builder.functionsCalledInLoop.add(node.element);
world.registerDynamicInvocationOf(node.element);
} else {
- Selector selector = getOptimizedSelectorFor(node, node.selector);
- world.registerDynamicInvocation(node.name, selector);
if (inLoop) backend.builder.selectorsCalledInLoop[node.name] = selector;
+ world.registerDynamicInvocation(node.name, selector);
}
}
endExpression(JSPrecedence.CALL_PRECEDENCE);

Powered by Google App Engine
This is Rietveld 408576698