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

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

Issue 1375213003: dart2js cps: Maintain parent pointers instead of recomputing them. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/mutable_ssa.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/insert_refinements.dart
diff --git a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
index 149a4b360922f430b6ead15f366d4d0ec8cb61cc..e9a03642c1fbef3cc353c000f66882a983514eda 100644
--- a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
+++ b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
@@ -4,15 +4,10 @@
library cps_ir.optimization.insert_refinements;
-import '../common/names.dart';
-import '../types/types.dart' show
- TypeMask;
-
+import 'optimizers.dart' show Pass;
import 'cps_ir_nodes.dart';
-import 'optimizers.dart' show
- Pass;
-import 'shrinking_reductions.dart' show
- ParentVisitor;
+import '../common/names.dart';
+import '../types/types.dart' show TypeMask;
import 'type_mask_system.dart';
/// Inserts [Refinement] nodes in the IR to allow for sparse path-sensitive
@@ -23,7 +18,7 @@ import 'type_mask_system.dart';
///
/// Refinement nodes are inserted after a method invocation to refine the
/// receiver to the types that can respond to the given selector.
-class InsertRefinements extends RecursiveVisitor implements Pass {
+class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
String get passName => 'Insert refinement nodes';
final TypeMaskSystem types;
@@ -34,7 +29,6 @@ class InsertRefinements extends RecursiveVisitor implements Pass {
InsertRefinements(this.types);
void rewrite(FunctionDefinition node) {
- new ParentVisitor().visit(node);
visit(node.body);
}
@@ -121,7 +115,8 @@ class InsertRefinements extends RecursiveVisitor implements Pass {
} else {
// Filter away receivers that throw on this selector.
TypeMask type = types.receiverTypeFor(node.selector, node.mask);
- pushRefinement(cont, new Refinement(receiver, type));
+ Refinement refinement = new Refinement(receiver, type);
+ pushRefinement(cont, refinement);
}
}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/mutable_ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698