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

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

Issue 10823389: Start inferring return types for static functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments 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/js_backend/backend.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 8c6ca6badb54cc3e253a0b5e177c147af88e1d42..7b310aaacb6c37c052f08b5fb421c3677b7e9c8d 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -2365,7 +2365,12 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// exception at runtime.
compiler.cancel('Unimplemented non-matching static call', node: node);
}
- pushWithPosition(new HInvokeStatic(inputs), node);
+ HInvokeStatic instruction = new HInvokeStatic(inputs);
+ HType returnType =
+ builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange(
+ work.element, element);
+ if (returnType != null) instruction.guaranteedType = returnType;
+ pushWithPosition(instruction, node);
} else {
if (element.kind == ElementKind.GETTER) {
target = new HInvokeStatic(inputs);
@@ -3228,7 +3233,7 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
} else {
// TODO(aprelev@gmail.com): Once old catch syntax is removed
// "if" condition above and this "else" branch should be deleted as
- // type of declared variable won't matter for the catch
+ // type of declared variable won't matter for the catch
// condition
Type type = elements.getType(declaration.type);
if (type == null) {
« no previous file with comments | « lib/compiler/implementation/js_backend/backend.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698