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

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

Issue 11365108: Implement redirecting constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 1 month 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 class Interceptors { 7 class Interceptors {
8 Compiler compiler; 8 Compiler compiler;
9 Interceptors(Compiler this.compiler); 9 Interceptors(Compiler this.compiler);
10 10
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 return HType.UNKNOWN; 3058 return HType.UNKNOWN;
3059 } 3059 }
3060 } 3060 }
3061 3061
3062 Element constructor = elements[node]; 3062 Element constructor = elements[node];
3063 Selector selector = elements.getSelector(node); 3063 Selector selector = elements.getSelector(node);
3064 if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) { 3064 if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) {
3065 compiler.internalError("Unresolved element: $constructor", node: node); 3065 compiler.internalError("Unresolved element: $constructor", node: node);
3066 } 3066 }
3067 FunctionElement functionElement = constructor; 3067 FunctionElement functionElement = constructor;
3068 constructor = functionElement.defaultImplementation; 3068 constructor = functionElement.redirectionTarget;
3069 // TODO(5346): Try to avoid the need for calling [declaration] before 3069 // TODO(5346): Try to avoid the need for calling [declaration] before
3070 // creating an [HStatic]. 3070 // creating an [HStatic].
3071 HInstruction target = new HStatic(constructor.declaration); 3071 HInstruction target = new HStatic(constructor.declaration);
3072 add(target); 3072 add(target);
3073 var inputs = <HInstruction>[]; 3073 var inputs = <HInstruction>[];
3074 inputs.add(target); 3074 inputs.add(target);
3075 // TODO(5347): Try to avoid the need for calling [implementation] before 3075 // TODO(5347): Try to avoid the need for calling [implementation] before
3076 // calling [addStaticSendArgumentsToList]. 3076 // calling [addStaticSendArgumentsToList].
3077 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, 3077 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
3078 constructor.implementation, 3078 constructor.implementation,
(...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
4763 new HSubGraphBlockInformation(elseBranch.graph)); 4763 new HSubGraphBlockInformation(elseBranch.graph));
4764 4764
4765 HBasicBlock conditionStartBlock = conditionBranch.block; 4765 HBasicBlock conditionStartBlock = conditionBranch.block;
4766 conditionStartBlock.setBlockFlow(info, joinBlock); 4766 conditionStartBlock.setBlockFlow(info, joinBlock);
4767 SubGraph conditionGraph = conditionBranch.graph; 4767 SubGraph conditionGraph = conditionBranch.graph;
4768 HIf branch = conditionGraph.end.last; 4768 HIf branch = conditionGraph.end.last;
4769 assert(branch is HIf); 4769 assert(branch is HIf);
4770 branch.blockInformation = conditionStartBlock.blockFlow; 4770 branch.blockInformation = conditionStartBlock.blockFlow;
4771 } 4771 }
4772 } 4772 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698