Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 12033003: Deferred (aka lazy) loading of static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 } 1056 }
1057 1057
1058 /** 1058 /**
1059 * Try to inline [element] within the currect context of the 1059 * Try to inline [element] within the currect context of the
1060 * builder. The insertion point is the state of the builder. 1060 * builder. The insertion point is the state of the builder.
1061 */ 1061 */
1062 bool tryInlineMethod(Element element, 1062 bool tryInlineMethod(Element element,
1063 Selector selector, 1063 Selector selector,
1064 Link<Node> arguments, 1064 Link<Node> arguments,
1065 Node currentNode) { 1065 Node currentNode) {
1066 // TODO(ahe): What's the harm in inlining from a lazily loaded
kasperl 2013/02/05 08:30:53 Good question. I guess you still want the code to
ahe 2013/02/05 13:54:22 Good point.
1067 // library? It makes testing harder, but is it what the user
1068 // wants?
1069 if (compiler.deferredLoadTask.isDeferred(element)) return false;
1066 if (compiler.disableInlining) return false; 1070 if (compiler.disableInlining) return false;
1067 // Ensure that [element] is an implementation element. 1071 // Ensure that [element] is an implementation element.
1068 element = element.implementation; 1072 element = element.implementation;
1069 // TODO(floitsch): we should be able to inline inside lazy initializers. 1073 // TODO(floitsch): we should be able to inline inside lazy initializers.
1070 if (!currentElement.isFunction()) return false; 1074 if (!currentElement.isFunction()) return false;
1071 // TODO(floitsch): find a cleaner way to know if the element is a function 1075 // TODO(floitsch): find a cleaner way to know if the element is a function
1072 // containing nodes. 1076 // containing nodes.
1073 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. 1077 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s.
1074 if (element is !PartialFunctionElement) return false; 1078 if (element is !PartialFunctionElement) return false;
1075 // TODO(ngeoffray): try to inline generative constructors. They 1079 // TODO(ngeoffray): try to inline generative constructors. They
(...skipping 3925 matching lines...) Expand 10 before | Expand all | Expand 10 after
5001 new HSubGraphBlockInformation(elseBranch.graph)); 5005 new HSubGraphBlockInformation(elseBranch.graph));
5002 5006
5003 HBasicBlock conditionStartBlock = conditionBranch.block; 5007 HBasicBlock conditionStartBlock = conditionBranch.block;
5004 conditionStartBlock.setBlockFlow(info, joinBlock); 5008 conditionStartBlock.setBlockFlow(info, joinBlock);
5005 SubGraph conditionGraph = conditionBranch.graph; 5009 SubGraph conditionGraph = conditionBranch.graph;
5006 HIf branch = conditionGraph.end.last; 5010 HIf branch = conditionGraph.end.last;
5007 assert(branch is HIf); 5011 assert(branch is HIf);
5008 branch.blockInformation = conditionStartBlock.blockFlow; 5012 branch.blockInformation = conditionStartBlock.blockFlow;
5009 } 5013 }
5010 } 5014 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698