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

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

Issue 1743283002: dart2js cps: Use definitions by default, not references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix doc comments and long lines Created 4 years, 10 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
Index: pkg/compiler/lib/src/cps_ir/finalize.dart
diff --git a/pkg/compiler/lib/src/cps_ir/finalize.dart b/pkg/compiler/lib/src/cps_ir/finalize.dart
index dad9e51dd3d6f887593b6a8a140b6595c7425163..937680030fd640de3e66b9a7a39ad78f93d23608 100644
--- a/pkg/compiler/lib/src/cps_ir/finalize.dart
+++ b/pkg/compiler/lib/src/cps_ir/finalize.dart
@@ -38,11 +38,11 @@ class Finalize extends TrampolineRecursiveVisitor implements Pass {
CpsFragment visitBoundsCheck(BoundsCheck node) {
CpsFragment cps = new CpsFragment(node.sourceInformation);
if (node.hasNoChecks) {
- node..replaceUsesWith(node.object.definition)..destroy();
+ node..replaceUsesWith(node.object)..destroy();
return cps;
}
Continuation fail = cps.letCont();
- Primitive index = node.index.definition;
+ Primitive index = node.index;
if (node.hasIntegerCheck) {
cps.ifTruthy(cps.applyBuiltin(BuiltinOperator.IsNotUnsigned32BitInteger,
[index, index]))
@@ -53,7 +53,7 @@ class Finalize extends TrampolineRecursiveVisitor implements Pass {
.invokeContinuation(fail);
}
if (node.hasUpperBoundCheck) {
- Primitive length = node.length.definition;
+ Primitive length = node.length;
if (length is GetLength &&
length.hasExactlyOneUse &&
areAdjacent(length, node)) {
@@ -69,19 +69,19 @@ class Finalize extends TrampolineRecursiveVisitor implements Pass {
}
if (node.hasEmptinessCheck) {
cps.ifTruthy(cps.applyBuiltin(BuiltinOperator.StrictEq,
- [node.length.definition, cps.makeZero()]))
+ [node.length, cps.makeZero()]))
.invokeContinuation(fail);
}
cps.insideContinuation(fail).invokeStaticThrower(
helpers.throwIndexOutOfRangeException,
- [node.object.definition, index]);
- node..replaceUsesWith(node.object.definition)..destroy();
+ [node.object, index]);
+ node..replaceUsesWith(node.object)..destroy();
return cps;
}
void visitGetStatic(GetStatic node) {
- if (node.witness != null) {
- node..witness.unlink()..witness = null;
+ if (node.witnessRef != null) {
+ node..witnessRef.unlink()..witnessRef = null;
}
}
@@ -92,9 +92,8 @@ class Finalize extends TrampolineRecursiveVisitor implements Pass {
// type of an object is immutable, but the type of an array can change
// after allocation. After the finalize pass, this assumption is no
// longer needed, so we can replace the remaining idenitity templates.
- Refinement refinement = new Refinement(
- node.arguments.single.definition,
- node.type)..type = node.type;
+ Refinement refinement = new Refinement(node.argument(0), node.type)
sra1 2016/03/01 17:59:53 I'm ok with it, but this no longer implicitly asse
+ ..type = node.type;
node.replaceWith(refinement);
}
}

Powered by Google App Engine
This is Rietveld 408576698