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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/tree_ir_nodes.dart

Issue 614993002: Rename Constant to ConstantValue and ConstExp to ConstantExpression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 library tree_ir_nodes; 5 library tree_ir_nodes;
6 6
7 import '../constants/expressions.dart'; 7 import '../constants/expressions.dart';
8 import '../constants/values.dart' as values; 8 import '../constants/values.dart' as values;
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
10 import '../dart_types.dart' show DartType, GenericType; 10 import '../dart_types.dart' show DartType, GenericType;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 160
161 /** 161 /**
162 * Call to a factory or generative constructor. 162 * Call to a factory or generative constructor.
163 */ 163 */
164 class InvokeConstructor extends Expression implements Invoke { 164 class InvokeConstructor extends Expression implements Invoke {
165 final DartType type; 165 final DartType type;
166 final FunctionElement target; 166 final FunctionElement target;
167 final List<Expression> arguments; 167 final List<Expression> arguments;
168 final Selector selector; 168 final Selector selector;
169 final values.Constant constant; 169 final values.ConstantValue constant;
170 170
171 InvokeConstructor(this.type, this.target, this.selector, this.arguments, 171 InvokeConstructor(this.type, this.target, this.selector, this.arguments,
172 [this.constant]); 172 [this.constant]);
173 173
174 ClassElement get targetClass => target.enclosingElement; 174 ClassElement get targetClass => target.enclosingElement;
175 175
176 accept(ExpressionVisitor visitor) => visitor.visitInvokeConstructor(this); 176 accept(ExpressionVisitor visitor) => visitor.visitInvokeConstructor(this);
177 } 177 }
178 178
179 /// Calls [toString] on each argument and concatenates the results. 179 /// Calls [toString] on each argument and concatenates the results.
180 class ConcatenateStrings extends Expression { 180 class ConcatenateStrings extends Expression {
181 final List<Expression> arguments; 181 final List<Expression> arguments;
182 final values.Constant constant; 182 final values.ConstantValue constant;
183 183
184 ConcatenateStrings(this.arguments, [this.constant]); 184 ConcatenateStrings(this.arguments, [this.constant]);
185 185
186 accept(ExpressionVisitor visitor) => visitor.visitConcatenateStrings(this); 186 accept(ExpressionVisitor visitor) => visitor.visitConcatenateStrings(this);
187 } 187 }
188 188
189 /** 189 /**
190 * A constant. 190 * A constant.
191 */ 191 */
192 class Constant extends Expression { 192 class Constant extends Expression {
193 final ConstExp expression; 193 final ConstantExpression expression;
194 194
195 Constant(this.expression); 195 Constant(this.expression);
196 196
197 Constant.primitive(values.PrimitiveConstant primitiveValue) 197 Constant.primitive(values.PrimitiveConstantValue primitiveValue)
198 : expression = new PrimitiveConstExp(primitiveValue); 198 : expression = new PrimitiveConstantExpression(primitiveValue);
199 199
200 accept(ExpressionVisitor visitor) => visitor.visitConstant(this); 200 accept(ExpressionVisitor visitor) => visitor.visitConstant(this);
201 201
202 values.Constant get value => expression.value; 202 values.ConstantValue get value => expression.value;
203 } 203 }
204 204
205 class This extends Expression { 205 class This extends Expression {
206 accept(ExpressionVisitor visitor) => visitor.visitThis(this); 206 accept(ExpressionVisitor visitor) => visitor.visitThis(this);
207 } 207 }
208 208
209 class ReifyTypeVar extends Expression { 209 class ReifyTypeVar extends Expression {
210 TypeVariableElement typeVariable; 210 TypeVariableElement typeVariable;
211 211
212 ReifyTypeVar(this.typeVariable); 212 ReifyTypeVar(this.typeVariable);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 accept(StatementVisitor visitor) => visitor.visitAssign(this); 441 accept(StatementVisitor visitor) => visitor.visitAssign(this);
442 } 442 }
443 443
444 /** 444 /**
445 * A return exit from the function. 445 * A return exit from the function.
446 * 446 *
447 * In contrast to the CPS-based IR, the return value is an arbitrary 447 * In contrast to the CPS-based IR, the return value is an arbitrary
448 * expression. 448 * expression.
449 */ 449 */
450 class Return extends Statement { 450 class Return extends Statement {
451 /// Should not be null. Use [Constant] with [NullConstant] for void returns. 451 /// Should not be null. Use [Constant] with [NullConstantValue] for void retur ns.
sigurdm 2014/10/01 07:46:47 Long line
Johnni Winther 2014/10/01 08:21:23 Done.
452 Expression value; 452 Expression value;
453 453
454 Statement get next => null; 454 Statement get next => null;
455 void set next(Statement s) => throw 'UNREACHABLE'; 455 void set next(Statement s) => throw 'UNREACHABLE';
456 456
457 Return(this.value); 457 Return(this.value);
458 458
459 accept(StatementVisitor visitor) => visitor.visitReturn(this); 459 accept(StatementVisitor visitor) => visitor.visitReturn(this);
460 } 460 }
461 461
(...skipping 20 matching lines...) Expand all
482 ExpressionStatement(this.expression, this.next); 482 ExpressionStatement(this.expression, this.next);
483 483
484 accept(StatementVisitor visitor) => visitor.visitExpressionStatement(this); 484 accept(StatementVisitor visitor) => visitor.visitExpressionStatement(this);
485 } 485 }
486 486
487 class FunctionDefinition extends Node { 487 class FunctionDefinition extends Node {
488 final FunctionElement element; 488 final FunctionElement element;
489 final List<Variable> parameters; 489 final List<Variable> parameters;
490 Statement body; 490 Statement body;
491 final List<ConstDeclaration> localConstants; 491 final List<ConstDeclaration> localConstants;
492 final List<ConstExp> defaultParameterValues; 492 final List<ConstantExpression> defaultParameterValues;
493 493
494 FunctionDefinition(this.element, this.parameters, this.body, 494 FunctionDefinition(this.element, this.parameters, this.body,
495 this.localConstants, this.defaultParameterValues); 495 this.localConstants, this.defaultParameterValues);
496 496
497 /// Returns `true` if this function is abstract. 497 /// Returns `true` if this function is abstract.
498 /// 498 ///
499 /// If `true` [body] is `null` and [localConstants] is empty. 499 /// If `true` [body] is `null` and [localConstants] is empty.
500 bool get isAbstract => body == null; 500 bool get isAbstract => body == null;
501 } 501 }
502 502
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 visitFunctionDeclaration(FunctionDeclaration node) { 646 visitFunctionDeclaration(FunctionDeclaration node) {
647 visitFunctionDefinition(node.definition); 647 visitFunctionDefinition(node.definition);
648 visitStatement(node.next); 648 visitStatement(node.next);
649 } 649 }
650 650
651 visitExpressionStatement(ExpressionStatement node) { 651 visitExpressionStatement(ExpressionStatement node) {
652 visitExpression(node.expression); 652 visitExpression(node.expression);
653 visitStatement(node.next); 653 visitStatement(node.next);
654 } 654 }
655 } 655 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698