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

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

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed indentation. Created 8 years, 3 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 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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 } 1136 }
1137 1137
1138 if (!foundSuperOrRedirect) { 1138 if (!foundSuperOrRedirect) {
1139 // No super initializer found. Try to find the default constructor if 1139 // No super initializer found. Try to find the default constructor if
1140 // the class is not Object. 1140 // the class is not Object.
1141 ClassElement enclosingClass = constructor.getEnclosingClass(); 1141 ClassElement enclosingClass = constructor.getEnclosingClass();
1142 ClassElement superClass = enclosingClass.superclass; 1142 ClassElement superClass = enclosingClass.superclass;
1143 if (enclosingClass != compiler.objectClass) { 1143 if (enclosingClass != compiler.objectClass) {
1144 assert(superClass !== null); 1144 assert(superClass !== null);
1145 assert(superClass.resolutionState == STATE_DONE); 1145 assert(superClass.resolutionState == STATE_DONE);
1146 Selector selector = 1146 Selector selector = new Selector.callConstructor(
1147 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0); 1147 new SelectorName.namedClass(superClass.name),
1148 FunctionElement target = superClass.lookupConstructor(superClass.name); 1148 enclosingClass.getLibrary());
1149 FunctionElement target = superClass.lookupConstructor(selector);
1149 if (target === null) { 1150 if (target === null) {
1150 compiler.internalError("no default constructor available"); 1151 compiler.internalError("no default constructor available");
1151 } 1152 }
1152 inlineSuperOrRedirect(target, 1153 inlineSuperOrRedirect(target,
1153 selector, 1154 selector,
1154 const EmptyLink<Node>(), 1155 const EmptyLink<Node>(),
1155 constructors, 1156 constructors,
1156 fieldValues); 1157 fieldValues);
1157 } 1158 }
1158 } 1159 }
(...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698