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

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

Issue 1229893002: dart2js cps: Redundant join elimination. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.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/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index ebb8574fa66247fe85ac0eee98cb26ca0e74fa14..3cc0f217f39f822458b51a6b02d15def640bb410 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -128,6 +128,17 @@ class Reference<T extends Definition<T>> {
}
if (next != null) next.previous = previous;
}
+
+ /// Changes the definition referenced by this object and updates
+ /// the reference chains accordingly.
+ void changeTo(Definition<T> newDefinition) {
+ unlink();
+ previous = null;
+ definition = newDefinition;
+ next = definition.firstRef;
+ if (next != null) next.previous = this;
+ definition.firstRef = this;
+ }
}
/// Evaluates a primitive and binds it to variable: `let val x = V in E`.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698