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

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

Issue 11235061: Avoid calling resolveMethodElement from SSA builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 bodyElement = backendMember; 986 bodyElement = backendMember;
987 break; 987 break;
988 } 988 }
989 } 989 }
990 } 990 }
991 if (bodyElement == null) { 991 if (bodyElement == null) {
992 bodyElement = new ConstructorBodyElement(constructor); 992 bodyElement = new ConstructorBodyElement(constructor);
993 // [:resolveMethodElement:] require the passed element to be a 993 // [:resolveMethodElement:] require the passed element to be a
994 // declaration. 994 // declaration.
995 TreeElements treeElements = 995 TreeElements treeElements =
996 compiler.resolver.resolveMethodElement(constructor.declaration); 996 compiler.enqueuer.resolution.getCachedElements(
997 constructor.declaration);
997 classElement.backendMembers = 998 classElement.backendMembers =
998 classElement.backendMembers.prepend(bodyElement); 999 classElement.backendMembers.prepend(bodyElement);
999 1000
1000 if (constructor.isPatch) { 1001 if (constructor.isPatch) {
1001 // Create origin body element for patched constructors. 1002 // Create origin body element for patched constructors.
1002 bodyElement.origin = new ConstructorBodyElement(constructor.origin); 1003 bodyElement.origin = new ConstructorBodyElement(constructor.origin);
1003 bodyElement.origin.patch = bodyElement; 1004 bodyElement.origin.patch = bodyElement;
1004 classElement.origin.backendMembers = 1005 classElement.origin.backendMembers =
1005 classElement.origin.backendMembers.prepend(bodyElement.origin); 1006 classElement.origin.backendMembers.prepend(bodyElement.origin);
1006 } 1007 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 // Don't forget to update the field, if the parameter is of the 1157 // Don't forget to update the field, if the parameter is of the
1157 // form [:this.x:]. 1158 // form [:this.x:].
1158 if (parameter.kind == ElementKind.FIELD_PARAMETER) { 1159 if (parameter.kind == ElementKind.FIELD_PARAMETER) {
1159 FieldParameterElement fieldParameterElement = parameter; 1160 FieldParameterElement fieldParameterElement = parameter;
1160 fieldValues[fieldParameterElement.fieldElement] = argument; 1161 fieldValues[fieldParameterElement.fieldElement] = argument;
1161 } 1162 }
1162 }); 1163 });
1163 1164
1164 // Build the initializers in the context of the new constructor. 1165 // Build the initializers in the context of the new constructor.
1165 TreeElements oldElements = elements; 1166 TreeElements oldElements = elements;
1166 elements = compiler.resolver.resolveMethodElement(constructor); 1167 elements =
1168 compiler.enqueuer.resolution.getCachedElements(constructor);
1167 buildInitializers(constructor, constructors, fieldValues); 1169 buildInitializers(constructor, constructors, fieldValues);
1168 elements = oldElements; 1170 elements = oldElements;
1169 }); 1171 });
1170 } 1172 }
1171 1173
1172 /** 1174 /**
1173 * Run through the initializers and inline all field initializers. Recursively 1175 * Run through the initializers and inline all field initializers. Recursively
1174 * inlines super initializers. 1176 * inlines super initializers.
1175 * 1177 *
1176 * The constructors of the inlined initializers is added to [constructors] 1178 * The constructors of the inlined initializers is added to [constructors]
(...skipping 3330 matching lines...) Expand 10 before | Expand all | Expand 10 after
4507 new HSubGraphBlockInformation(elseBranch.graph)); 4509 new HSubGraphBlockInformation(elseBranch.graph));
4508 4510
4509 HBasicBlock conditionStartBlock = conditionBranch.block; 4511 HBasicBlock conditionStartBlock = conditionBranch.block;
4510 conditionStartBlock.setBlockFlow(info, joinBlock); 4512 conditionStartBlock.setBlockFlow(info, joinBlock);
4511 SubGraph conditionGraph = conditionBranch.graph; 4513 SubGraph conditionGraph = conditionBranch.graph;
4512 HIf branch = conditionGraph.end.last; 4514 HIf branch = conditionGraph.end.last;
4513 assert(branch is HIf); 4515 assert(branch is HIf);
4514 branch.blockInformation = conditionStartBlock.blockFlow; 4516 branch.blockInformation = conditionStartBlock.blockFlow;
4515 } 4517 }
4516 } 4518 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698