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

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: Another try in implementing constructor lookup, without SelectorName this time. 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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1181
1182 if (!foundSuperOrRedirect) { 1182 if (!foundSuperOrRedirect) {
1183 // No super initializer found. Try to find the default constructor if 1183 // No super initializer found. Try to find the default constructor if
1184 // the class is not Object. 1184 // the class is not Object.
1185 ClassElement enclosingClass = constructor.getEnclosingClass(); 1185 ClassElement enclosingClass = constructor.getEnclosingClass();
1186 ClassElement superClass = enclosingClass.superclass; 1186 ClassElement superClass = enclosingClass.superclass;
1187 if (!enclosingClass.isObject(compiler)) { 1187 if (!enclosingClass.isObject(compiler)) {
1188 assert(superClass !== null); 1188 assert(superClass !== null);
1189 assert(superClass.resolutionState == STATE_DONE); 1189 assert(superClass.resolutionState == STATE_DONE);
1190 Selector selector = 1190 Selector selector =
1191 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0); 1191 new Selector.callDefaultConstructor(superClass.name,
1192 FunctionElement target = superClass.lookupConstructor(superClass.name); 1192 enclosingClass.getLibrary());
1193 FunctionElement target = superClass.lookupConstructor(selector);
1193 if (target === null) { 1194 if (target === null) {
1194 compiler.internalError("no default constructor available"); 1195 compiler.internalError("no default constructor available");
1195 } 1196 }
1196 inlineSuperOrRedirect(target.implementation, 1197 inlineSuperOrRedirect(target.implementation,
1197 selector, 1198 selector,
1198 const EmptyLink<Node>(), 1199 const EmptyLink<Node>(),
1199 constructors, 1200 constructors,
1200 fieldValues); 1201 fieldValues);
1201 } 1202 }
1202 } 1203 }
(...skipping 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after
4327 new HSubGraphBlockInformation(elseBranch.graph)); 4328 new HSubGraphBlockInformation(elseBranch.graph));
4328 4329
4329 HBasicBlock conditionStartBlock = conditionBranch.block; 4330 HBasicBlock conditionStartBlock = conditionBranch.block;
4330 conditionStartBlock.setBlockFlow(info, joinBlock); 4331 conditionStartBlock.setBlockFlow(info, joinBlock);
4331 SubGraph conditionGraph = conditionBranch.graph; 4332 SubGraph conditionGraph = conditionBranch.graph;
4332 HIf branch = conditionGraph.end.last; 4333 HIf branch = conditionGraph.end.last;
4333 assert(branch is HIf); 4334 assert(branch is HIf);
4334 branch.blockInformation = conditionStartBlock.blockFlow; 4335 branch.blockInformation = conditionStartBlock.blockFlow;
4335 } 4336 }
4336 } 4337 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698