OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 interface OptimizationPhase { | 5 interface OptimizationPhase { |
6 String get name(); | 6 String get name(); |
7 void visitGraph(HGraph graph); | 7 void visitGraph(HGraph graph); |
8 } | 8 } |
9 | 9 |
10 class SsaOptimizerTask extends CompilerTask { | 10 class SsaOptimizerTask extends CompilerTask { |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 } | 879 } |
880 } | 880 } |
881 | 881 |
882 // If the inputs are loop invariant, we can move the | 882 // If the inputs are loop invariant, we can move the |
883 // instruction from the current block to the pre-header block. | 883 // instruction from the current block to the pre-header block. |
884 if (loopInvariantInputs) { | 884 if (loopInvariantInputs) { |
885 block.detach(instruction); | 885 block.detach(instruction); |
886 preheader.moveAtExit(instruction); | 886 preheader.moveAtExit(instruction); |
887 } | 887 } |
888 } | 888 } |
| 889 int oldChangesFlags = changesFlags; |
| 890 changesFlags |= instruction.getChangesFlags(); |
| 891 if (oldChangesFlags != changesFlags) { |
| 892 dependsFlags = HInstruction.computeDependsOnFlags(changesFlags); |
| 893 } |
889 instruction = next; | 894 instruction = next; |
890 } | 895 } |
891 } | 896 } |
892 | 897 |
893 bool isInputDefinedAfterDominator(HInstruction input, | 898 bool isInputDefinedAfterDominator(HInstruction input, |
894 HBasicBlock dominator) { | 899 HBasicBlock dominator) { |
895 return input.block.id > dominator.id; | 900 return input.block.id > dominator.id; |
896 } | 901 } |
897 | 902 |
898 void visitBasicBlock(HBasicBlock block, ValueSet values) { | 903 void visitBasicBlock(HBasicBlock block, ValueSet values) { |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 // this type for the field is still a strong signal | 1306 // this type for the field is still a strong signal |
1302 // indicating the expected type of the field. | 1307 // indicating the expected type of the field. |
1303 field.propagatedType = type; | 1308 field.propagatedType = type; |
1304 } else { | 1309 } else { |
1305 // If there are no invoked setters we know the type of | 1310 // If there are no invoked setters we know the type of |
1306 // this field for sure. | 1311 // this field for sure. |
1307 field.guaranteedType = type; | 1312 field.guaranteedType = type; |
1308 } | 1313 } |
1309 } | 1314 } |
1310 } | 1315 } |
OLD | NEW |