Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 18311) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy) |
| @@ -3367,9 +3367,13 @@ |
| HInvokeStatic instruction = new HInvokeStatic(inputs, HType.UNKNOWN); |
| // TODO(ngeoffray): Only do this if knowing the return type is |
|
kasperl
2013/02/12 10:33:44
Move TODO to recompilation branch.
ngeoffray
2013/02/12 11:58:22
Done.
|
| // useful. |
| - HType returnType = |
| - builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange( |
| - currentElement, element); |
| + HType returnType = mapInferredType( |
|
kasperl
2013/02/12 10:33:44
Maybe add a helper for getting the guaranteed HTyp
ngeoffray
2013/02/12 11:58:22
Done.
|
| + compiler.typesTask.getGuaranteedTypeOfElement(element)); |
| + if (returnType.isUnknown()) { |
| + returnType = |
| + builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange( |
| + currentElement, element); |
| + } |
| if (returnType != null) instruction.guaranteedType = returnType; |
| pushWithPosition(instruction, node); |
| } else { |
| @@ -3561,7 +3565,14 @@ |
| } |
| inputs.add(receiver); |
| inputs.addAll(arguments); |
| - return new HInvokeDynamicMethod(selector, inputs, isIntercepted); |
| + HInstruction invoke = new HInvokeDynamicMethod( |
| + selector, inputs, isIntercepted); |
| + HType returnType = mapInferredType( |
| + compiler.typesTask.getGuaranteedTypeOfNode(work.element, node)); |
| + if (returnType != null) { |
| + invoke.guaranteedType = returnType; |
| + } |
| + return invoke; |
| } |
| visitSendSet(SendSet node) { |