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

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

Issue 10824234: Reapply "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: 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
« no previous file with comments | « lib/compiler/implementation/enqueue.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 7aba3c44accefc88a226b09e8344a2dba8bc4830..a1b0b3afb569a7f4accb42b4c1f0fdfe33130196 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -138,6 +138,7 @@ class SsaBuilderTask extends CompilerTask {
// Loop tracking information.
final Set<FunctionElement> functionsCalledInLoop;
final Map<SourceString, Selector> selectorsCalledInLoop;
+ final JavaScriptBackend backend;
String get name() => 'SSA builder';
@@ -147,6 +148,7 @@ class SsaBuilderTask extends CompilerTask {
emitter = backend.emitter,
functionsCalledInLoop = new Set<FunctionElement>(),
selectorsCalledInLoop = new Map<SourceString, Selector>(),
+ backend = backend,
super(backend.compiler);
HGraph build(WorkItem work) {
@@ -171,6 +173,20 @@ class SsaBuilderTask extends CompilerTask {
inLoop = selector !== null && selector.applies(element, compiler);
}
graph.calledInLoop = inLoop;
+
+ // If there is an estimate of the parameter types assume these types when
+ // compiling.
+ List<HType> parameterTypes =
+ backend.optimisticParameterTypesWithRecompilationOnTypeChange(
+ element);
+ if (parameterTypes != null) {
+ FunctionSignature signature = element.computeSignature(compiler);
+ int i = 0;
+ signature.forEachParameter((Element param) {
+ builder.parameters[param].guaranteedType = parameterTypes[i++];
+ });
+ }
+
if (compiler.tracer.enabled) {
String name;
if (element.enclosingElement !== null &&
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698