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

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

Issue 898463002: Rename ClosureVariable, use separate IR forms for declaration and assignment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 * An assignments of an [Expression] to a [Variable]. 486 * An assignments of an [Expression] to a [Variable].
487 * 487 *
488 * In contrast to the CPS-based IR, non-primitive expressions can be assigned 488 * In contrast to the CPS-based IR, non-primitive expressions can be assigned
489 * to variables. 489 * to variables.
490 */ 490 */
491 class Assign extends Statement { 491 class Assign extends Statement {
492 Statement next; 492 Statement next;
493 Variable variable; 493 Variable variable;
494 Expression definition; 494 Expression definition;
495 495
496 /// If true, this declares a new copy of the closure variable. 496 /// If true, this declares a new copy of the closure variable.
asgerf 2015/02/03 10:27:31 "closure variable" -> "variable"
Kevin Millikin (Google) 2015/02/03 14:11:49 Done. Actually, the second part of the comment do
497 /// The consequences are similar to [cps_ir.SetClosureVariable]. 497 /// The consequences are similar to [cps_ir.SetMutableVariable].
498 /// All uses of the variable must be nested inside the [next] statement. 498 /// All uses of the variable must be nested inside the [next] statement.
499 bool isDeclaration; 499 bool isDeclaration;
500 500
501 Assign(this.variable, this.definition, this.next, 501 Assign(this.variable, this.definition, this.next,
502 { this.isDeclaration: false }) { 502 { this.isDeclaration: false }) {
503 variable.writeCount++; 503 variable.writeCount++;
504 } 504 }
505 505
506 bool get hasExactlyOneUse => variable.readCount == 1; 506 bool get hasExactlyOneUse => variable.readCount == 1;
507 507
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 visitStatement(node.next); 920 visitStatement(node.next);
921 } 921 }
922 922
923 visitCreateBox(CreateBox node) { 923 visitCreateBox(CreateBox node) {
924 } 924 }
925 925
926 visitCreateInstance(CreateInstance node) { 926 visitCreateInstance(CreateInstance node) {
927 node.arguments.forEach(visitExpression); 927 node.arguments.forEach(visitExpression);
928 } 928 }
929 } 929 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698