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

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

Issue 762213002: Support top-level field declaration and assignment in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years 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 part of dart2js.optimizers; 5 part of dart2js.optimizers;
6 6
7 /** 7 /**
8 * [[ShrinkingReducer]] applies shrinking reductions to CPS terms as described 8 * [[ShrinkingReducer]] applies shrinking reductions to CPS terms as described
9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy. 9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy.
10 */ 10 */
(...skipping 16 matching lines...) Expand all
27 // Process the worklist. 27 // Process the worklist.
28 while (_worklist.isNotEmpty) { 28 while (_worklist.isNotEmpty) {
29 _ReductionTask task = _worklist.first; 29 _ReductionTask task = _worklist.first;
30 _worklist.remove(task); 30 _worklist.remove(task);
31 _processTask(task); 31 _processTask(task);
32 } 32 }
33 } 33 }
34 34
35 /// Applies shrinking reductions to root, mutating root in the process. 35 /// Applies shrinking reductions to root, mutating root in the process.
36 void rewriteFieldDefinition(FieldDefinition root) { 36 void rewriteFieldDefinition(FieldDefinition root) {
37 if (!root.hasInitializer) return;
37 rewriteExecutableDefinition(root); 38 rewriteExecutableDefinition(root);
38 } 39 }
39 40
40 /// Applies shrinking reductions to root, mutating root in the process. 41 /// Applies shrinking reductions to root, mutating root in the process.
41 void rewriteFunctionDefinition(FunctionDefinition root) { 42 void rewriteFunctionDefinition(FunctionDefinition root) {
42 if (root.isAbstract) return; 43 if (root.isAbstract) return;
43 rewriteExecutableDefinition(root); 44 rewriteExecutableDefinition(root);
44 } 45 }
45 46
46 /// Removes the given node from the CPS graph, replacing it with its body 47 /// Removes the given node from the CPS graph, replacing it with its body
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 450 }
450 451
451 String toString() => "$kind: $node"; 452 String toString() => "$kind: $node";
452 } 453 }
453 454
454 /// A dummy class used solely to mark nodes as deleted once they are removed 455 /// A dummy class used solely to mark nodes as deleted once they are removed
455 /// from a term. 456 /// from a term.
456 class _DeletedNode extends Node { 457 class _DeletedNode extends Node {
457 accept(_) => null; 458 accept(_) => null;
458 } 459 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/redundant_phi.dart ('k') | pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698