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

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

Issue 1234753003: dart2js cps: Rewrite mutable variables to continuation parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add tests and fix an assertion Created 5 years, 5 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 // 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 dart2js.cps_ir.optimizers; 5 library dart2js.cps_ir.optimizers;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 9
10 export 'type_propagation.dart' show TypePropagator; 10 export 'type_propagation.dart' show TypePropagator;
11 export 'redundant_phi.dart' show RedundantPhiEliminator; 11 export 'redundant_phi.dart' show RedundantPhiEliminator;
12 export 'redundant_join.dart' show RedundantJoinEliminator; 12 export 'redundant_join.dart' show RedundantJoinEliminator;
13 export 'shrinking_reductions.dart' show ShrinkingReducer, ParentVisitor; 13 export 'shrinking_reductions.dart' show ShrinkingReducer, ParentVisitor;
14 export 'mutable_ssa.dart' show MutableVariableEliminator;
14 15
15 /// An optimization pass over the CPS IR. 16 /// An optimization pass over the CPS IR.
16 abstract class Pass { 17 abstract class Pass {
17 /// Applies optimizations to root, rewriting it in the process. 18 /// Applies optimizations to root, rewriting it in the process.
18 void rewrite(FunctionDefinition root); 19 void rewrite(FunctionDefinition root);
19 20
20 String get passName; 21 String get passName;
21 } 22 }
22 23
23 // Shared code between optimizations 24 // Shared code between optimizations
24 25
25 /// Returns true if [value] is false, null, 0, -0, NaN, or the empty string. 26 /// Returns true if [value] is false, null, 0, -0, NaN, or the empty string.
26 bool isFalsyConstant(ConstantValue value) { 27 bool isFalsyConstant(ConstantValue value) {
27 return value.isFalse || 28 return value.isFalse ||
28 value.isNull || 29 value.isNull ||
29 value.isZero || 30 value.isZero ||
30 value.isMinusZero || 31 value.isMinusZero ||
31 value.isNaN || 32 value.isNaN ||
32 value is StringConstantValue && value.primitiveValue.isEmpty; 33 value is StringConstantValue && value.primitiveValue.isEmpty;
33 } 34 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/mutable_ssa.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698