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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 862703002: Implement constructor bodies and initializers in CPS->JS backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test case Created 5 years, 11 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of tree_ir.optimization; 5 part of tree_ir.optimization;
6 6
7 /** 7 /**
8 * Performs the following transformations on the tree: 8 * Performs the following transformations on the tree:
9 * - Assignment propagation 9 * - Assignment propagation
10 * - If-to-conditional conversion 10 * - If-to-conditional conversion
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 Expression visitGetField(GetField node) { 418 Expression visitGetField(GetField node) {
419 node.object = visitExpression(node.object); 419 node.object = visitExpression(node.object);
420 return node; 420 return node;
421 } 421 }
422 422
423 Expression visitCreateBox(CreateBox node) { 423 Expression visitCreateBox(CreateBox node) {
424 return node; 424 return node;
425 } 425 }
426 426
427 Expression visitCreateClosureClass(CreateClosureClass node) { 427 Expression visitCreateInstance(CreateInstance node) {
428 for (int i = node.arguments.length - 1; i >= 0; --i) { 428 for (int i = node.arguments.length - 1; i >= 0; --i) {
429 node.arguments[i] = visitExpression(node.arguments[i]); 429 node.arguments[i] = visitExpression(node.arguments[i]);
430 } 430 }
431 return node; 431 return node;
432 } 432 }
433 433
434 /// If [s] and [t] are similar statements we extract their subexpressions 434 /// If [s] and [t] are similar statements we extract their subexpressions
435 /// and returns a new statement of the same type using expressions combined 435 /// and returns a new statement of the same type using expressions combined
436 /// with the [combine] callback. For example: 436 /// with the [combine] callback. For example:
437 /// 437 ///
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } 590 }
591 591
592 Expression makeCondition(Expression e, bool polarity) { 592 Expression makeCondition(Expression e, bool polarity) {
593 return polarity ? e : new Not(e); 593 return polarity ? e : new Not(e);
594 } 594 }
595 595
596 Statement getBranch(If node, bool polarity) { 596 Statement getBranch(If node, bool polarity) {
597 return polarity ? node.thenStatement : node.elseStatement; 597 return polarity ? node.thenStatement : node.elseStatement;
598 } 598 }
599 } 599 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698