| 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 class Interceptors { | 5 class Interceptors { |
| 6 Compiler compiler; | 6 Compiler compiler; |
| 7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
| 8 | 8 |
| 9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
| 10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 stack.add(localsHandler.readLocal(returnElement)); | 1004 stack.add(localsHandler.readLocal(returnElement)); |
| 1005 returnElement = state.oldReturnElement; | 1005 returnElement = state.oldReturnElement; |
| 1006 assert(stack.length == 1); | 1006 assert(stack.length == 1); |
| 1007 state.oldStack.add(stack[0]); | 1007 state.oldStack.add(stack[0]); |
| 1008 stack = state.oldStack; | 1008 stack = state.oldStack; |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 bool tryInlineMethod(Element element, | 1011 bool tryInlineMethod(Element element, |
| 1012 Selector selector, | 1012 Selector selector, |
| 1013 Link<Node> arguments) { | 1013 Link<Node> arguments) { |
| 1014 if (compiler.disableInlining) return false; |
| 1014 // TODO(floitsch): we should be able to inline inside lazy initializers. | 1015 // TODO(floitsch): we should be able to inline inside lazy initializers. |
| 1015 if (!currentElement.isFunction()) return false; | 1016 if (!currentElement.isFunction()) return false; |
| 1016 // TODO(floitsch): we should be able to inline getters, setters and | 1017 // TODO(floitsch): we should be able to inline getters, setters and |
| 1017 // constructor bodies. | 1018 // constructor bodies. |
| 1018 if (!element.isFunction()) return false; | 1019 if (!element.isFunction()) return false; |
| 1019 // TODO(floitsch): find a cleaner way to know if the element is a function | 1020 // TODO(floitsch): find a cleaner way to know if the element is a function |
| 1020 // containing nodes. | 1021 // containing nodes. |
| 1021 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. | 1022 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. |
| 1022 if (element is !PartialFunctionElement) return false; | 1023 if (element is !PartialFunctionElement) return false; |
| 1023 if (inliningStack.length > MAX_INLINING_DEPTH) return false; | 1024 if (inliningStack.length > MAX_INLINING_DEPTH) return false; |
| (...skipping 3208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4232 new HSubGraphBlockInformation(elseBranch.graph)); | 4233 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4233 | 4234 |
| 4234 HBasicBlock conditionStartBlock = conditionBranch.block; | 4235 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4235 conditionStartBlock.setBlockFlow(info, joinBlock); | 4236 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4236 SubGraph conditionGraph = conditionBranch.graph; | 4237 SubGraph conditionGraph = conditionBranch.graph; |
| 4237 HIf branch = conditionGraph.end.last; | 4238 HIf branch = conditionGraph.end.last; |
| 4238 assert(branch is HIf); | 4239 assert(branch is HIf); |
| 4239 branch.blockInformation = conditionStartBlock.blockFlow; | 4240 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4240 } | 4241 } |
| 4241 } | 4242 } |
| OLD | NEW |