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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 } | 1072 } |
1073 | 1073 |
1074 /** | 1074 /** |
1075 * Try to inline [element] within the currect context of the | 1075 * Try to inline [element] within the currect context of the |
1076 * builder. The insertion point is the state of the builder. | 1076 * builder. The insertion point is the state of the builder. |
1077 */ | 1077 */ |
1078 bool tryInlineMethod(Element element, | 1078 bool tryInlineMethod(Element element, |
1079 Selector selector, | 1079 Selector selector, |
1080 Link<Node> arguments, | 1080 Link<Node> arguments, |
1081 Node currentNode) { | 1081 Node currentNode) { |
| 1082 // We cannot inline a method from a deferred library into a method |
| 1083 // which isn't deferred. |
| 1084 // TODO(ahe): But we should still inline into the same |
| 1085 // connected-component of the deferred library. |
| 1086 if (compiler.deferredLoadTask.isDeferred(element)) return false; |
| 1087 |
1082 if (compiler.disableInlining) return false; | 1088 if (compiler.disableInlining) return false; |
1083 // Ensure that [element] is an implementation element. | 1089 // Ensure that [element] is an implementation element. |
1084 element = element.implementation; | 1090 element = element.implementation; |
1085 // TODO(floitsch): we should be able to inline inside lazy initializers. | 1091 // TODO(floitsch): we should be able to inline inside lazy initializers. |
1086 if (!currentElement.isFunction()) return false; | 1092 if (!currentElement.isFunction()) return false; |
1087 // TODO(floitsch): find a cleaner way to know if the element is a function | 1093 // TODO(floitsch): find a cleaner way to know if the element is a function |
1088 // containing nodes. | 1094 // containing nodes. |
1089 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. | 1095 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. |
1090 if (element is !PartialFunctionElement) return false; | 1096 if (element is !PartialFunctionElement) return false; |
1091 // TODO(ngeoffray): try to inline generative constructors. They | 1097 // TODO(ngeoffray): try to inline generative constructors. They |
(...skipping 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5072 new HSubGraphBlockInformation(elseBranch.graph)); | 5078 new HSubGraphBlockInformation(elseBranch.graph)); |
5073 | 5079 |
5074 HBasicBlock conditionStartBlock = conditionBranch.block; | 5080 HBasicBlock conditionStartBlock = conditionBranch.block; |
5075 conditionStartBlock.setBlockFlow(info, joinBlock); | 5081 conditionStartBlock.setBlockFlow(info, joinBlock); |
5076 SubGraph conditionGraph = conditionBranch.graph; | 5082 SubGraph conditionGraph = conditionBranch.graph; |
5077 HIf branch = conditionGraph.end.last; | 5083 HIf branch = conditionGraph.end.last; |
5078 assert(branch is HIf); | 5084 assert(branch is HIf); |
5079 branch.blockInformation = conditionStartBlock.blockFlow; | 5085 branch.blockInformation = conditionStartBlock.blockFlow; |
5080 } | 5086 } |
5081 } | 5087 } |
OLD | NEW |