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

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

Issue 9958009: Implement cascaded calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update tests. Fix scanner. Created 8 years, 8 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: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 0f48c2db6630722f804d14577f59830eeb5c0b69..112df65c8a10ccde804c4ee871907a39aba5d918 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -2271,6 +2271,17 @@ class SsaBuilder implements Visitor {
unreachable();
}
+ visitCascade(Cascade node) {
+ visit(node.expression);
+ // Remove the result and reveal the duplicated receiver on the stack.
+ pop();
+ }
+
+ visitCascadeReceiver(CascadeReceiver node) {
+ visit(node.expression);
+ stack.add(stack.last());
ahe 2012/04/16 08:55:23 Perhaps add a comment or create a dup() method.
Lasse Reichstein Nielsen 2012/04/16 12:41:38 Added dup().
+ }
+
visitReturn(Return node) {
HInstruction value;
if (node.expression === null) {

Powered by Google App Engine
This is Rietveld 408576698