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

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

Issue 1287253002: dart2js cps: Compile some loops as 'for' loops. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test expectations Created 5 years, 4 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 library tree_ir.integrity; 1 library tree_ir.integrity;
2 2
3 import 'tree_ir_nodes.dart'; 3 import 'tree_ir_nodes.dart';
4 4
5 /// Performs integrity checks on the tree_ir. 5 /// Performs integrity checks on the tree_ir.
6 /// 6 ///
7 /// Should only be run for debugging purposes, not in production. 7 /// Should only be run for debugging purposes, not in production.
8 /// 8 ///
9 /// - Reference counts on must match the actual number of references. 9 /// - Reference counts on must match the actual number of references.
10 /// - Labels must be in scope when referenced. 10 /// - Labels must be in scope when referenced.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 visitLabeledStatement(LabeledStatement node) { 96 visitLabeledStatement(LabeledStatement node) {
97 visitJumpTargetBody(node); 97 visitJumpTargetBody(node);
98 visitStatement(node.next); 98 visitStatement(node.next);
99 } 99 }
100 100
101 visitWhileTrue(WhileTrue node) { 101 visitWhileTrue(WhileTrue node) {
102 visitJumpTargetBody(node); 102 visitJumpTargetBody(node);
103 } 103 }
104 104
105 visitWhileCondition(WhileCondition node) { 105 visitFor(For node) {
106 visitExpression(node.condition); 106 visitExpression(node.condition);
107 visitJumpTargetBody(node); 107 visitJumpTargetBody(node);
108 node.updates.forEach(visitExpression);
108 visitStatement(node.next); 109 visitStatement(node.next);
109 } 110 }
110 111
111 visitBreak(Break node) { 112 visitBreak(Break node) {
112 if (!label2declaration.containsKey(node.target)) { 113 if (!label2declaration.containsKey(node.target)) {
113 error('Break to label that is not in scope'); 114 error('Break to label that is not in scope');
114 } 115 }
115 if (label2declaration[node.target] is! LabeledStatement) { 116 if (label2declaration[node.target] is! LabeledStatement) {
116 error('Break to non-labeled statement ${label2declaration[node.target]}'); 117 error('Break to non-labeled statement ${label2declaration[node.target]}');
117 } 118 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (reads != variable.readCount || writes != variable.writeCount) { 157 if (reads != variable.readCount || writes != variable.writeCount) {
157 error('Invalid reference count for $variable:\n' 158 error('Invalid reference count for $variable:\n'
158 '- Variable has $reads reads and $writes writes\n' 159 '- Variable has $reads reads and $writes writes\n'
159 '- Reference count is ${variable.readCount} reads and ' 160 '- Reference count is ${variable.readCount} reads and '
160 '${variable.writeCount} writes'); 161 '${variable.writeCount} writes');
161 } 162 }
162 } 163 }
163 } 164 }
164 165
165 } 166 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698