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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 } | 1064 } |
1065 | 1065 |
1066 /** | 1066 /** |
1067 * Try to inline [element] within the currect context of the | 1067 * Try to inline [element] within the currect context of the |
1068 * builder. The insertion point is the state of the builder. | 1068 * builder. The insertion point is the state of the builder. |
1069 */ | 1069 */ |
1070 bool tryInlineMethod(Element element, | 1070 bool tryInlineMethod(Element element, |
1071 Selector selector, | 1071 Selector selector, |
1072 Link<Node> arguments, | 1072 Link<Node> arguments, |
1073 Node currentNode) { | 1073 Node currentNode) { |
| 1074 // We cannot inline a method from a deferred library into a method |
| 1075 // which isn't deferred. |
| 1076 // TODO(ahe): But we should still inline into the same |
| 1077 // connected-component of the deferred library. |
| 1078 if (compiler.deferredLoadTask.isDeferred(element)) return false; |
| 1079 |
1074 if (compiler.disableInlining) return false; | 1080 if (compiler.disableInlining) return false; |
1075 // Ensure that [element] is an implementation element. | 1081 // Ensure that [element] is an implementation element. |
1076 element = element.implementation; | 1082 element = element.implementation; |
1077 // TODO(floitsch): we should be able to inline inside lazy initializers. | 1083 // TODO(floitsch): we should be able to inline inside lazy initializers. |
1078 if (!currentElement.isFunction()) return false; | 1084 if (!currentElement.isFunction()) return false; |
1079 // TODO(floitsch): find a cleaner way to know if the element is a function | 1085 // TODO(floitsch): find a cleaner way to know if the element is a function |
1080 // containing nodes. | 1086 // containing nodes. |
1081 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. | 1087 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. |
1082 if (element is !PartialFunctionElement) return false; | 1088 if (element is !PartialFunctionElement) return false; |
1083 // TODO(ngeoffray): try to inline generative constructors. They | 1089 // TODO(ngeoffray): try to inline generative constructors. They |
(...skipping 4000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5084 new HSubGraphBlockInformation(elseBranch.graph)); | 5090 new HSubGraphBlockInformation(elseBranch.graph)); |
5085 | 5091 |
5086 HBasicBlock conditionStartBlock = conditionBranch.block; | 5092 HBasicBlock conditionStartBlock = conditionBranch.block; |
5087 conditionStartBlock.setBlockFlow(info, joinBlock); | 5093 conditionStartBlock.setBlockFlow(info, joinBlock); |
5088 SubGraph conditionGraph = conditionBranch.graph; | 5094 SubGraph conditionGraph = conditionBranch.graph; |
5089 HIf branch = conditionGraph.end.last; | 5095 HIf branch = conditionGraph.end.last; |
5090 assert(branch is HIf); | 5096 assert(branch is HIf); |
5091 branch.blockInformation = conditionStartBlock.blockFlow; | 5097 branch.blockInformation = conditionStartBlock.blockFlow; |
5092 } | 5098 } |
5093 } | 5099 } |
OLD | NEW |