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

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

Issue 1519513002: dart2js cps: Retain refinement nodes and update refinements after GVN. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 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/optimizers.dart ('k') | pkg/compiler/lib/src/cps_ir/update_refinements.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/remove_refinements.dart
diff --git a/pkg/compiler/lib/src/cps_ir/remove_refinements.dart b/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
deleted file mode 100644
index eead3f0f7c4cb4d2453c06949ac77a59a0d2bbf7..0000000000000000000000000000000000000000
--- a/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// 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 cps_ir.optimization.remove_refinements;
-
-import 'optimizers.dart' show Pass;
-import 'cps_ir_nodes.dart';
-
-/// Removes all [Refinement] nodes from the IR.
-///
-/// This simplifies subsequent passes that don't rely on path-sensitive
-/// type information but depend on equality between primitives.
-class RemoveRefinements extends TrampolineRecursiveVisitor implements Pass {
- String get passName => 'Remove refinement nodes';
-
- void rewrite(FunctionDefinition node) {
- visit(node);
- }
-
- @override
- Expression traverseLetPrim(LetPrim node) {
- Expression next = node.body;
- if (node.primitive is Refinement) {
- Refinement refinement = node.primitive;
- Primitive value = refinement.value.definition;
- if (refinement.hint != null && value.hint == null) {
- value.hint = refinement.hint;
- }
- refinement..replaceUsesWith(value)..destroy();
- node.remove();
- }
- return next;
- }
-}
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/optimizers.dart ('k') | pkg/compiler/lib/src/cps_ir/update_refinements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698