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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart

Issue 1415923012: Simple sharing and hoisting of final field loads (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/optimizers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library dart2js.cps_ir_integrity; 1 library dart2js.cps_ir_integrity;
2 2
3 import 'cps_ir_nodes.dart'; 3 import 'cps_ir_nodes.dart';
4 import 'cps_ir_nodes_sexpr.dart'; 4 import 'cps_ir_nodes_sexpr.dart';
5 import '../tracer.dart' as tracer; 5 import '../tracer.dart' as tracer;
6 6
7 /// Dump S-expressions on error if the tracer is enabled. 7 /// Dump S-expressions on error if the tracer is enabled.
8 /// 8 ///
9 /// Technically this has nothing to do with the tracer, but if you want one 9 /// Technically this has nothing to do with the tracer, but if you want one
10 /// enabled, you typically want the other as well, so we use the same flag. 10 /// enabled, you typically want the other as well, so we use the same flag.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 Decorator decorator = (n, String s) => n == node ? '**$s**' : s; 198 Decorator decorator = (n, String s) => n == node ? '**$s**' : s;
199 sexpr = new SExpressionStringifier(decorator).visit(topLevelNode); 199 sexpr = new SExpressionStringifier(decorator).visit(topLevelNode);
200 sexpr = 'SExpr dump (offending node marked with **):\n\n$sexpr'; 200 sexpr = 'SExpr dump (offending node marked with **):\n\n$sexpr';
201 } catch (e) { 201 } catch (e) {
202 sexpr = '(Exception thrown by SExpressionStringifier: $e)'; 202 sexpr = '(Exception thrown by SExpressionStringifier: $e)';
203 } 203 }
204 } else { 204 } else {
205 sexpr = '(Set DUMP_IR flag to enable SExpr dump)'; 205 sexpr = '(Set DUMP_IR flag to enable SExpr dump)';
206 } 206 }
207 throw 'CPS integrity violation\n' 207 throw 'CPS integrity violation\n'
208 'After $previousPass on ${topLevelNode.element}\n' 208 'After \'$previousPass\' on ${topLevelNode.element}\n'
209 '$message\n\n' 209 '$message\n\n'
210 '$sexpr\n'; 210 '$sexpr\n';
211 } 211 }
212 } 212 }
213 213
214 /// Traverses the CPS term and checks that node.parent is correctly set 214 /// Traverses the CPS term and checks that node.parent is correctly set
215 /// for each visited node. 215 /// for each visited node.
216 class ParentChecker extends DeepRecursiveVisitor { 216 class ParentChecker extends DeepRecursiveVisitor {
217 static void checkParents(Node node, CheckCpsIntegrity main) { 217 static void checkParents(Node node, CheckCpsIntegrity main) {
218 ParentChecker visitor = new ParentChecker._make(main); 218 ParentChecker visitor = new ParentChecker._make(main);
(...skipping 26 matching lines...) Expand all
245 } 245 }
246 246
247 @override 247 @override
248 processReference(Reference node) { 248 processReference(Reference node) {
249 if (node.parent != _parent) { 249 if (node.parent != _parent) {
250 error('Parent pointer on $node is ${node.parent} but should be $_parent', 250 error('Parent pointer on $node is ${node.parent} but should be $_parent',
251 node); 251 node);
252 } 252 }
253 } 253 }
254 } 254 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/optimizers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698