Chromium Code Reviews| Index: lib/compiler/implementation/ssa/codegen_helpers.dart |
| diff --git a/lib/compiler/implementation/ssa/codegen_helpers.dart b/lib/compiler/implementation/ssa/codegen_helpers.dart |
| index 4344721da0b14d7f8ad8f767a296dbf9ed10fc3e..9460ff3aa0774cfe270a4726e7fe1f71892bf52f 100644 |
| --- a/lib/compiler/implementation/ssa/codegen_helpers.dart |
| +++ b/lib/compiler/implementation/ssa/codegen_helpers.dart |
| @@ -52,16 +52,26 @@ class SsaInstructionMerger extends HBaseVisitor { |
| // they would not be alive. |
| void visitTypeGuard(HTypeGuard instruction) {} |
| - // If an equality operation is builtin it must not have its input generated at |
| - // use site, because it's using it multiple times (because of null/undefined). |
| + // If an equality operation is builtin it must only have its inputs generated |
| + // at use site if does not require an expression with repeated uses (because |
|
floitsch
2012/07/09 20:02:33
if it
sra1
2012/07/09 20:18:58
Done.
|
| + // of null / undefined). |
| void visitEquals(HEquals instruction) { |
| if (!instruction.builtin) super.visitEquals(instruction); |
| - // Otherwise do nothing. |
| + if (singleIdentityComparison(instruction.left, instruction.right) != null) { |
| + super.visitEquals(instruction); |
| + } |
| + // Do nothing. |
| } |
| - // Identity operations must not have its input generated at use site, because |
| - // it's using it multiple times (because of null/undefined). |
| - void visitIdentity(HIdentity instruction) {} |
| + // An identity operation must only have its inputs generated at use site if |
| + // does not require an expression with multiple uses (because of null / |
| + // undefined). |
| + void visitIdentity(HIdentity instruction) { |
| + if (singleIdentityComparison(instruction.left, instruction.right) != null) { |
| + super.visitIdentity(instruction); |
| + } |
| + // Do nothing. |
| + } |
| void visitTypeConversion(HTypeConversion instruction) { |
| if (!instruction.isChecked) { |