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

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

Issue 12211112: Start work on a non-complete type inferrer. Currently only analyzes return types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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: 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) {

Powered by Google App Engine
This is Rietveld 408576698