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

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: Address review comments. 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
« no previous file with comments | « lib/compiler/implementation/scanner/token.dart ('k') | lib/compiler/implementation/tree/nodes.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 995a244337dc3cad8ea58310f6310e68baae0a87..367c719fafb73fcf2df7c61c3cbe9d4a28038275 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -1019,6 +1019,10 @@ class SsaBuilder implements Visitor {
return stack.removeLast();
}
+ void dup() {
+ stack.add(stack.last());
+ }
+
HBoolify popBoolified() {
HBoolify boolified = new HBoolify(pop());
add(boolified);
@@ -2298,6 +2302,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);
+ dup();
+ }
+
visitReturn(Return node) {
HInstruction value;
if (node.expression === null) {
« no previous file with comments | « lib/compiler/implementation/scanner/token.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698