| 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)
|
| + ..type = node.type;
|
| node.replaceWith(refinement);
|
| }
|
| }
|
|
|