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

Unified Diff: frog/leg/ssa/builder.dart

Issue 9487004: Initialize fields with their default values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Two other tests work after rebase. Created 8 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
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/builder.dart
diff --git a/frog/leg/ssa/builder.dart b/frog/leg/ssa/builder.dart
index 9610513ae5b39b8bad7c33e5be03c76cc894b2f3..8d32546e15e4b6bdacc35749fa7150714ede6fcc 100644
--- a/frog/leg/ssa/builder.dart
+++ b/frog/leg/ssa/builder.dart
@@ -809,8 +809,12 @@ class SsaBuilder implements Visitor {
if (localsHandler.hasValueForDirectLocal(member)) {
value = localsHandler.readLocal(member);
} else {
- // TODO(karlklose): get default value.
- value = graph.addNewLiteralNull();
+ var fieldValue =
+ compiler.compileTimeConstantHandler.compileVariable(member);
+ // TODO(floitsch): this constant should be treated like all
+ // other constants and should be at the top of the graph.
+ value = new HLiteral.internal(fieldValue, HType.UNKNOWN);
+ add(value);
}
constructorArguments.add(value);
}
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698