Chromium Code Reviews| Index: lib/compiler/implementation/ssa/optimize.dart |
| =================================================================== |
| --- lib/compiler/implementation/ssa/optimize.dart (revision 5967) |
| +++ lib/compiler/implementation/ssa/optimize.dart (working copy) |
| @@ -21,6 +21,8 @@ |
| void optimize(WorkItem work, HGraph graph) { |
| measure(() { |
| List<OptimizationPhase> phases = <OptimizationPhase>[ |
| + new SsaTypePropagator(compiler, false), |
| + new SsaCheckInserter(compiler), |
| new SsaConstantFolder(compiler), |
| new SsaRedundantPhiEliminator(), |
| new SsaDeadPhiEliminator(), |
| @@ -38,7 +40,7 @@ |
| // types non-speculatively. For example, it propagates the type |
| // array for a call to the List constructor. |
| List<OptimizationPhase> phases = <OptimizationPhase>[ |
| - new SsaTypePropagator(compiler), |
| + new SsaTypePropagator(compiler, true), |
|
Lasse Reichstein Nielsen
2012/03/29 11:46:55
Make the boolean parameter optional so you can giv
|
| new SsaTypeGuardBuilder(compiler, work), |
| new SsaCheckInserter(compiler)]; |
| runPhases(graph, phases); |
| @@ -99,7 +101,7 @@ |
| // must update the type of this instruction manually. Later |
| // phases can then optimize this instruction based on its |
| // type. |
|
Lasse Reichstein Nielsen
2012/03/29 11:46:55
Why don't we run the constant folder before type p
ngeoffray
2012/03/29 12:51:02
No reason, I added the type propagator as the firs
floitsch
2012/03/29 22:00:38
The constant-folder needs types to fold away booli
|
| - replacement.updateType(); |
| + replacement.type = instruction.type; |
| } |
| instruction = next; |
| } |
| @@ -297,6 +299,7 @@ |
| void visitIndex(HIndex node) { |
| if (!node.builtin) return; |
| + if (node.index is HBoundsCheck) return; |
| HInstruction index = insertIntegerCheck(node, node.index); |
| index = insertBoundsCheck(node, node.receiver, index); |
| HIndex newInstruction = new HIndex(node.target, node.receiver, index); |
| @@ -307,6 +310,7 @@ |
| void visitIndexAssign(HIndexAssign node) { |
| if (!node.builtin) return; |
| + if (node.index is HBoundsCheck) return; |
| HInstruction index = insertIntegerCheck(node, node.index); |
| index = insertBoundsCheck(node, node.receiver, index); |
| HIndexAssign newInstruction = |