| 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 abstract class OptimizationPhase { | 7 abstract class OptimizationPhase { |
| 8 String get name; | 8 String get name; |
| 9 void visitGraph(HGraph graph); | 9 void visitGraph(HGraph graph); |
| 10 } | 10 } |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 | 888 |
| 889 final Compiler compiler; | 889 final Compiler compiler; |
| 890 SsaLiveBlockAnalyzer analyzer; | 890 SsaLiveBlockAnalyzer analyzer; |
| 891 bool eliminatedSideEffects = false; | 891 bool eliminatedSideEffects = false; |
| 892 SsaDeadCodeEliminator(this.compiler); | 892 SsaDeadCodeEliminator(this.compiler); |
| 893 | 893 |
| 894 HInstruction zapInstructionCache; | 894 HInstruction zapInstructionCache; |
| 895 HInstruction get zapInstruction { | 895 HInstruction get zapInstruction { |
| 896 if (zapInstructionCache == null) { | 896 if (zapInstructionCache == null) { |
| 897 // A constant with no type does not pollute types at phi nodes. | 897 // A constant with no type does not pollute types at phi nodes. |
| 898 Constant constant = | 898 Constant constant = new DummyConstant(const TypeMask.nonNullEmpty()); |
| 899 new DummyReceiverConstant(const TypeMask.nonNullEmpty()); | |
| 900 zapInstructionCache = analyzer.graph.addConstant(constant, compiler); | 899 zapInstructionCache = analyzer.graph.addConstant(constant, compiler); |
| 901 } | 900 } |
| 902 return zapInstructionCache; | 901 return zapInstructionCache; |
| 903 } | 902 } |
| 904 | 903 |
| 905 /// Returns whether the next throwing instruction that may have side | 904 /// Returns whether the next throwing instruction that may have side |
| 906 /// effects after [instruction], throws [NoSuchMethodError] on the | 905 /// effects after [instruction], throws [NoSuchMethodError] on the |
| 907 /// same receiver of [instruction]. | 906 /// same receiver of [instruction]. |
| 908 bool hasFollowingThrowingNSM(HInstruction instruction) { | 907 bool hasFollowingThrowingNSM(HInstruction instruction) { |
| 909 HInstruction receiver = instruction.getDartReceiver(compiler); | 908 HInstruction receiver = instruction.getDartReceiver(compiler); |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 | 1968 |
| 1970 keyedValues.forEach((receiver, values) { | 1969 keyedValues.forEach((receiver, values) { |
| 1971 result.keyedValues[receiver] = | 1970 result.keyedValues[receiver] = |
| 1972 new Map<HInstruction, HInstruction>.from(values); | 1971 new Map<HInstruction, HInstruction>.from(values); |
| 1973 }); | 1972 }); |
| 1974 | 1973 |
| 1975 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 1974 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 1976 return result; | 1975 return result; |
| 1977 } | 1976 } |
| 1978 } | 1977 } |
| OLD | NEW |