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

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

Issue 1562893002: dart2js cps: Generate increment and compound operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Also compound string concatenation Created 4 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
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 library tree_ir_nodes; 5 library tree_ir_nodes;
6 6
7 import '../constants/values.dart' as values; 7 import '../constants/values.dart' as values;
8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; 8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType;
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../io/source_information.dart' show SourceInformation; 10 import '../io/source_information.dart' show SourceInformation;
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 736
737 accept(ExpressionVisitor visitor) => visitor.visitGetField(this); 737 accept(ExpressionVisitor visitor) => visitor.visitGetField(this);
738 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitGetField(this, arg); 738 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitGetField(this, arg);
739 } 739 }
740 740
741 class SetField extends Expression { 741 class SetField extends Expression {
742 Expression object; 742 Expression object;
743 Element field; 743 Element field;
744 Expression value; 744 Expression value;
745 745
746 SetField(this.object, this.field, this.value); 746 /// If non-null, this is a compound assignment to the field, using the given
747 /// operator. The operator must be a compoundable operator.
748 BuiltinOperator compound;
749
750 SetField(this.object, this.field, this.value, {this.compound});
747 751
748 accept(ExpressionVisitor visitor) => visitor.visitSetField(this); 752 accept(ExpressionVisitor visitor) => visitor.visitSetField(this);
749 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitSetField(this, arg); 753 accept1(ExpressionVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
750 } 754 }
751 755
752 756
753 /// Read the type test property from [object]. The value is truthy/fasly rather 757 /// Read the type test property from [object]. The value is truthy/fasly rather
754 /// than bool. [object] must not be `null`. 758 /// than bool. [object] must not be `null`.
755 class GetTypeTestProperty extends Expression { 759 class GetTypeTestProperty extends Expression {
756 Expression object; 760 Expression object;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 GetIndex(this.object, this.index); 810 GetIndex(this.object, this.index);
807 811
808 accept(ExpressionVisitor v) => v.visitGetIndex(this); 812 accept(ExpressionVisitor v) => v.visitGetIndex(this);
809 accept1(ExpressionVisitor1 v, arg) => v.visitGetIndex(this, arg); 813 accept1(ExpressionVisitor1 v, arg) => v.visitGetIndex(this, arg);
810 } 814 }
811 815
812 class SetIndex extends Expression { 816 class SetIndex extends Expression {
813 Expression object; 817 Expression object;
814 Expression index; 818 Expression index;
815 Expression value; 819 Expression value;
820 BuiltinOperator compound;
816 821
817 SetIndex(this.object, this.index, this.value); 822 SetIndex(this.object, this.index, this.value, {this.compound});
818 823
819 accept(ExpressionVisitor v) => v.visitSetIndex(this); 824 accept(ExpressionVisitor v) => v.visitSetIndex(this);
820 accept1(ExpressionVisitor1 v, arg) => v.visitSetIndex(this, arg); 825 accept1(ExpressionVisitor1 v, arg) => v.visitSetIndex(this, arg);
821 } 826 }
822 827
823 class ReifyRuntimeType extends Expression { 828 class ReifyRuntimeType extends Expression {
824 Expression value; 829 Expression value;
825 SourceInformation sourceInformation; 830 SourceInformation sourceInformation;
826 831
827 ReifyRuntimeType(this.value, this.sourceInformation); 832 ReifyRuntimeType(this.value, this.sourceInformation);
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 1645
1641 /// Number of uses of the current fallthrough target. 1646 /// Number of uses of the current fallthrough target.
1642 int get useCount => _stack.last.useCount; 1647 int get useCount => _stack.last.useCount;
1643 1648
1644 /// Indicate that a statement will fall through to the current fallthrough 1649 /// Indicate that a statement will fall through to the current fallthrough
1645 /// target. 1650 /// target.
1646 void use() { 1651 void use() {
1647 ++_stack.last.useCount; 1652 ++_stack.last.useCount;
1648 } 1653 }
1649 } 1654 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698