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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 2264
2265 void visitParenthesizedExpression(ParenthesizedExpression node) { 2265 void visitParenthesizedExpression(ParenthesizedExpression node) {
2266 visit(node.expression); 2266 visit(node.expression);
2267 } 2267 }
2268 2268
2269 visitOperator(Operator node) { 2269 visitOperator(Operator node) {
2270 // Operators are intercepted in their surrounding Send nodes. 2270 // Operators are intercepted in their surrounding Send nodes.
2271 unreachable(); 2271 unreachable();
2272 } 2272 }
2273 2273
2274 visitCascade(Cascade node) {
2275 visit(node.expression);
2276 // Remove the result and reveal the duplicated receiver on the stack.
2277 pop();
2278 }
2279
2280 visitCascadeReceiver(CascadeReceiver node) {
2281 visit(node.expression);
2282 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().
2283 }
2284
2274 visitReturn(Return node) { 2285 visitReturn(Return node) {
2275 HInstruction value; 2286 HInstruction value;
2276 if (node.expression === null) { 2287 if (node.expression === null) {
2277 value = graph.addConstantNull(); 2288 value = graph.addConstantNull();
2278 } else { 2289 } else {
2279 visit(node.expression); 2290 visit(node.expression);
2280 value = pop(); 2291 value = pop();
2281 } 2292 }
2282 close(new HReturn(value)).addSuccessor(graph.exit); 2293 close(new HReturn(value)).addSuccessor(graph.exit);
2283 } 2294 }
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
2997 false, 3008 false,
2998 <HInstruction>[target, input])); 3009 <HInstruction>[target, input]));
2999 return builder.pop(); 3010 return builder.pop();
3000 } 3011 }
3001 3012
3002 HInstruction result() { 3013 HInstruction result() {
3003 flushLiterals(); 3014 flushLiterals();
3004 return prefix; 3015 return prefix;
3005 } 3016 }
3006 } 3017 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698