Chromium Code Reviews| Index: lib/compiler/implementation/ssa/builder.dart |
| diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart |
| index a66dbaf7c2a4c7ff9fa48ead04383232ebeafb22..c006fc54afb5783870867adb8eb67ede99a1c4cf 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,18 @@ 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 |
|
floitsch
2012/08/06 15:01:06
Optimistically use the parameter types that have b
Søren Gjesse
2012/08/07 09:06:03
Much better, thanks.
|
| + // compiling. |
| + List<HType> parameterTypes = backend.optimisticParameterTypes(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 && |