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

Unified Diff: pkg/compiler/lib/src/cps_ir/optimizers.dart

Issue 787603003: Generative constructors in the new dart backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments, set element for constructors in frontend_ast_to_backend_ast, adjust status-file 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart ('k') | pkg/compiler/lib/src/cps_ir/redundant_phi.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/optimizers.dart
diff --git a/pkg/compiler/lib/src/cps_ir/optimizers.dart b/pkg/compiler/lib/src/cps_ir/optimizers.dart
index 22318aec88912ce188be32afca5524fc10a2d652..bf3bb458fe2ff3487de1939c34f06ea6d59063f4 100644
--- a/pkg/compiler/lib/src/cps_ir/optimizers.dart
+++ b/pkg/compiler/lib/src/cps_ir/optimizers.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library dart2js.optimizers;
+library dart2js.cps_ir.optimizers;
import '../constants/expressions.dart' show
ConstantExpression,
@@ -26,10 +26,28 @@ part 'shrinking_reductions.dart';
abstract class Pass {
/// Applies optimizations to root, rewriting it in the process.
void rewrite(ExecutableDefinition root) => root.applyPass(this);
+
+ void rewriteConstructorDefinition(ConstructorDefinition root);
+ void rewriteFunctionDefinition(FunctionDefinition root);
+ void rewriteFieldDefinition(FieldDefinition root);
+}
+
+abstract class PassMixin implements Pass {
+ void rewrite(ExecutableDefinition root) => root.applyPass(this);
+
+ void rewriteExecutableDefinition(ExecutableDefinition root);
+
void rewriteFunctionDefinition(FunctionDefinition root) {
- return root.applyPass(this);
+ if (root.isAbstract) return;
+ rewriteExecutableDefinition(root);
+ }
+
+ void rewriteConstructorDefinition(ConstructorDefinition root) {
+ if (root.isAbstract) return;
+ rewriteExecutableDefinition(root);
}
void rewriteFieldDefinition(FieldDefinition root) {
- return root.applyPass(this);
+ if (!root.hasInitializer) return;
+ rewriteExecutableDefinition(root);
}
-}
+}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart ('k') | pkg/compiler/lib/src/cps_ir/redundant_phi.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698