Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 23842) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy) |
| @@ -620,8 +620,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) { |
|
karlklose
2013/06/12 13:12:38
I would prefer:
for (HInstruction user in to.usedB
ngeoffray
2013/06/12 13:55:09
Done.
|
| better = better.prepend(user); |
| } |
| } |
| @@ -819,6 +819,10 @@ |
| && !canThrow(); |
| } |
| + // Overridden by [HCheck] to return the actual non-[HCheck] |
| + // instruction it checks against. |
| + HInstruction nonCheck() => this; |
| + |
| // Can this node throw an exception? |
| bool canThrow() => false; |
| @@ -901,7 +905,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 (!identical(inputs[i].nonCheck(), otherInputs[i].nonCheck())) { |
| + return false; |
| + } |
| } |
| // Check that the data in the instruction matches. |
| return dataEquals(other); |
| @@ -911,7 +917,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) + (inputs[i].nonCheck().id) + (result >> 7); |
| } |
| return result; |
| } |
| @@ -1158,11 +1164,7 @@ |
| bool isJsStatement() => true; |
| bool canThrow() => true; |
| - HInstruction unwrap() { |
| - var checked = checkedInput; |
| - while (checked is HCheck) checked = checked.checkedInput; |
| - return checked; |
| - } |
| + HInstruction nonCheck() => checkedInput.nonCheck(); |
| } |
| class HBailoutTarget extends HInstruction { |
| @@ -1320,7 +1322,7 @@ |
| int typeCode() => HInstruction.INVOKE_DYNAMIC_TYPECODE; |
| bool typeEquals(other) => other is HInvokeDynamic; |
| bool dataEquals(HInvokeDynamic other) { |
| - return selector == other.selector && element == other.element; |
| + return selector.name == other.selector.name; |
|
Johnni Winther
2013/06/12 11:06:08
Why not [: selector == other.selector :] ?
ngeoffray
2013/06/12 13:55:09
Because if we end up here, we know the receiver is
|
| } |
| } |