| 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 /** | 7 /** |
| 8 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
| 9 * methods. We need to override [Element.computeType] because our | 9 * methods. We need to override [Element.computeType] because our |
| 10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 defaultValueTypes = | 60 defaultValueTypes = |
| 61 new OptionalParameterTypes(signature.optionalParameterCount); | 61 new OptionalParameterTypes(signature.optionalParameterCount); |
| 62 int index = 0; | 62 int index = 0; |
| 63 signature.forEachOptionalParameter((Element parameter) { | 63 signature.forEachOptionalParameter((Element parameter) { |
| 64 Constant defaultValue = builder.compileVariable(parameter); | 64 Constant defaultValue = builder.compileVariable(parameter); |
| 65 HType type = HGraph.mapConstantTypeToSsaType(defaultValue); | 65 HType type = HGraph.mapConstantTypeToSsaType(defaultValue); |
| 66 defaultValueTypes.update(index, parameter.name, type); | 66 defaultValueTypes.update(index, parameter.name, type); |
| 67 index++; | 67 index++; |
| 68 }); | 68 }); |
| 69 } else { | 69 } else { |
| 70 // BUG(10938): the types are stored in the wrong order. | 70 // TODO(ahe): I have disabled type optimizations for |
| 71 // optional arguments as the types are stored in the wrong |
| 71 // order. | 72 // order. |
| 72 HTypeList parameterTypes = | 73 HTypeList parameterTypes = |
| 73 backend.optimisticParameterTypes(element.declaration, | 74 backend.optimisticParameterTypes(element.declaration, |
| 74 defaultValueTypes); | 75 defaultValueTypes); |
| 75 if (!parameterTypes.allUnknown) { | 76 if (!parameterTypes.allUnknown) { |
| 76 int i = 0; | 77 int i = 0; |
| 77 signature.forEachParameter((Element param) { | 78 signature.forEachParameter((Element param) { |
| 78 builder.parameters[param].instructionType = parameterTypes[i++]; | 79 builder.parameters[param].instructionType = parameterTypes[i++]; |
| 79 }); | 80 }); |
| 80 } | 81 } |
| (...skipping 5290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5371 new HSubGraphBlockInformation(elseBranch.graph)); | 5372 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5372 | 5373 |
| 5373 HBasicBlock conditionStartBlock = conditionBranch.block; | 5374 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5374 conditionStartBlock.setBlockFlow(info, joinBlock); | 5375 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5375 SubGraph conditionGraph = conditionBranch.graph; | 5376 SubGraph conditionGraph = conditionBranch.graph; |
| 5376 HIf branch = conditionGraph.end.last; | 5377 HIf branch = conditionGraph.end.last; |
| 5377 assert(branch is HIf); | 5378 assert(branch is HIf); |
| 5378 branch.blockInformation = conditionStartBlock.blockFlow; | 5379 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5379 } | 5380 } |
| 5380 } | 5381 } |
| OLD | NEW |