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

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

Issue 1238163003: dart2js cps: Share interceptors by default and propagate to use later. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Renamed to let_sinking.dart 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 export 'mutable_ssa.dart' show MutableVariableEliminator;
15 export 'let_sinking.dart' show LetSinker;
15 16
16 /// An optimization pass over the CPS IR. 17 /// An optimization pass over the CPS IR.
17 abstract class Pass { 18 abstract class Pass {
18 /// Applies optimizations to root, rewriting it in the process. 19 /// Applies optimizations to root, rewriting it in the process.
19 void rewrite(FunctionDefinition root); 20 void rewrite(FunctionDefinition root);
20 21
21 String get passName; 22 String get passName;
22 } 23 }
23 24
24 // Shared code between optimizations 25 // Shared code between optimizations
25 26
26 /// Returns true if [value] is false, null, 0, -0, NaN, or the empty string. 27 /// Returns true if [value] is false, null, 0, -0, NaN, or the empty string.
27 bool isFalsyConstant(ConstantValue value) { 28 bool isFalsyConstant(ConstantValue value) {
28 return value.isFalse || 29 return value.isFalse ||
29 value.isNull || 30 value.isNull ||
30 value.isZero || 31 value.isZero ||
31 value.isMinusZero || 32 value.isMinusZero ||
32 value.isNaN || 33 value.isNaN ||
33 value is StringConstantValue && value.primitiveValue.isEmpty; 34 value is StringConstantValue && value.primitiveValue.isEmpty;
34 } 35 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/let_sinking.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