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

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: Rebased 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 // We cannot inline a method from a deferred library into a method
1067 // which isn't deferred.
1068 // TODO(ahe): But we shold still inline into the same
sra1 2013/02/12 01:44:47 shold -> should
ahe 2013/02/18 20:19:01 Done.
1069 // connected-component of the deferred library.
1070 if (compiler.deferredLoadTask.isDeferred(element)) return false;
1071
1066 if (compiler.disableInlining) return false; 1072 if (compiler.disableInlining) return false;
1067 // Ensure that [element] is an implementation element. 1073 // Ensure that [element] is an implementation element.
1068 element = element.implementation; 1074 element = element.implementation;
1069 // TODO(floitsch): we should be able to inline inside lazy initializers. 1075 // TODO(floitsch): we should be able to inline inside lazy initializers.
1070 if (!currentElement.isFunction()) return false; 1076 if (!currentElement.isFunction()) return false;
1071 // TODO(floitsch): find a cleaner way to know if the element is a function 1077 // TODO(floitsch): find a cleaner way to know if the element is a function
1072 // containing nodes. 1078 // containing nodes.
1073 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s. 1079 // [PartialFunctionElement]s are [FunctionElement]s that have [Node]s.
1074 if (element is !PartialFunctionElement) return false; 1080 if (element is !PartialFunctionElement) return false;
1075 // TODO(ngeoffray): try to inline generative constructors. They 1081 // TODO(ngeoffray): try to inline generative constructors. They
(...skipping 3924 matching lines...) Expand 10 before | Expand all | Expand 10 after
5000 new HSubGraphBlockInformation(elseBranch.graph)); 5006 new HSubGraphBlockInformation(elseBranch.graph));
5001 5007
5002 HBasicBlock conditionStartBlock = conditionBranch.block; 5008 HBasicBlock conditionStartBlock = conditionBranch.block;
5003 conditionStartBlock.setBlockFlow(info, joinBlock); 5009 conditionStartBlock.setBlockFlow(info, joinBlock);
5004 SubGraph conditionGraph = conditionBranch.graph; 5010 SubGraph conditionGraph = conditionBranch.graph;
5005 HIf branch = conditionGraph.end.last; 5011 HIf branch = conditionGraph.end.last;
5006 assert(branch is HIf); 5012 assert(branch is HIf);
5007 branch.blockInformation = conditionStartBlock.blockFlow; 5013 branch.blockInformation = conditionStartBlock.blockFlow;
5008 } 5014 }
5009 } 5015 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/lib/async_patch.dart ('k') | dart/sdk/lib/async/async.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698