| Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 22031)
|
| +++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy)
|
| @@ -617,8 +617,8 @@
|
| */
|
| void rewriteWithBetterUser(HInstruction from, HInstruction to) {
|
| Link<HCheck> better = const Link<HCheck>();
|
| - for (HInstruction user in to.usedBy) {
|
| - if (user is HCheck && identical((user as HCheck).checkedInput, to)) {
|
| + for (var user in to.usedBy) {
|
| + if (user != from && user is HCheck && user.checkedInput == to) {
|
| better = better.prepend(user);
|
| }
|
| }
|
| @@ -930,6 +930,11 @@
|
| return buffer.toString();
|
| }
|
|
|
| + nonCheck(instruction) {
|
| + while (instruction is HCheck) instruction = instruction.checkedInput;
|
| + return instruction;
|
| + }
|
| +
|
| bool gvnEquals(HInstruction other) {
|
| assert(useGvn() && other.useGvn());
|
| // Check that the type and the flags match.
|
| @@ -942,7 +947,9 @@
|
| final List<HInstruction> otherInputs = other.inputs;
|
| if (inputsLength != otherInputs.length) return false;
|
| for (int i = 0; i < inputsLength; i++) {
|
| - if (!identical(inputs[i], otherInputs[i])) return false;
|
| + if (nonCheck(inputs[i]) != nonCheck(otherInputs[i])) {
|
| + return false;
|
| + }
|
| }
|
| // Check that the data in the instruction matches.
|
| return dataEquals(other);
|
| @@ -952,7 +959,7 @@
|
| int result = typeCode();
|
| int length = inputs.length;
|
| for (int i = 0; i < length; i++) {
|
| - result = (result * 19) + (inputs[i].id) + (result >> 7);
|
| + result = (result * 19) + (nonCheck(inputs[i]).id) + (result >> 7);
|
| }
|
| return result;
|
| }
|
| @@ -1398,6 +1405,14 @@
|
| }
|
| toString() => 'invoke dynamic getter: $selector';
|
| accept(HVisitor visitor) => visitor.visitInvokeDynamicGetter(this);
|
| +
|
| + int typeCode() => HInstruction.FIELD_GET_TYPECODE;
|
| + bool typeEquals(other) => other is HFieldGet || other is HInvokeDynamicGetter;
|
| + bool dataEquals(other) {
|
| + return other is HFieldGet
|
| + ? other.element.name == selector.name
|
| + : super.dataEquals(other);
|
| + }
|
| }
|
|
|
| class HInvokeDynamicSetter extends HInvokeDynamicField {
|
| @@ -1485,8 +1500,12 @@
|
| accept(HVisitor visitor) => visitor.visitFieldGet(this);
|
|
|
| int typeCode() => HInstruction.FIELD_GET_TYPECODE;
|
| - bool typeEquals(other) => other is HFieldGet;
|
| - bool dataEquals(HFieldGet other) => element == other.element;
|
| + bool typeEquals(other) => other is HFieldGet || other is HInvokeDynamicGetter;
|
| + bool dataEquals(other) {
|
| + return other is HInvokeDynamicGetter
|
| + ? element.name == other.selector.name
|
| + : element == other.element;
|
| + }
|
| String toString() => "FieldGet $element";
|
| }
|
|
|
|
|