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

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 co19-dart2js.status merge error. Created 8 years, 2 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 1204
1205 if (!foundSuperOrRedirect) { 1205 if (!foundSuperOrRedirect) {
1206 // No super initializer found. Try to find the default constructor if 1206 // No super initializer found. Try to find the default constructor if
1207 // the class is not Object. 1207 // the class is not Object.
1208 ClassElement enclosingClass = constructor.getEnclosingClass(); 1208 ClassElement enclosingClass = constructor.getEnclosingClass();
1209 ClassElement superClass = enclosingClass.superclass; 1209 ClassElement superClass = enclosingClass.superclass;
1210 if (!enclosingClass.isObject(compiler)) { 1210 if (!enclosingClass.isObject(compiler)) {
1211 assert(superClass !== null); 1211 assert(superClass !== null);
1212 assert(superClass.resolutionState == STATE_DONE); 1212 assert(superClass.resolutionState == STATE_DONE);
1213 Selector selector = 1213 Selector selector =
1214 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0); 1214 new Selector.callDefaultConstructor(enclosingClass.getLibrary());
1215 // TODO(johnniwinther): Should we find injected constructors as well? 1215 // TODO(johnniwinther): Should we find injected constructors as well?
1216 FunctionElement target = superClass.lookupConstructor(superClass.name); 1216 FunctionElement target = superClass.lookupConstructor(selector);
1217 if (target === null) { 1217 if (target === null) {
1218 compiler.internalError("no default constructor available"); 1218 compiler.internalError("no default constructor available");
1219 } 1219 }
1220 inlineSuperOrRedirect(target.implementation, 1220 inlineSuperOrRedirect(target.implementation,
1221 selector, 1221 selector,
1222 const EmptyLink<Node>(), 1222 const EmptyLink<Node>(),
1223 constructors, 1223 constructors,
1224 fieldValues); 1224 fieldValues);
1225 } 1225 }
1226 } 1226 }
(...skipping 3171 matching lines...) Expand 10 before | Expand all | Expand 10 after
4398 new HSubGraphBlockInformation(elseBranch.graph)); 4398 new HSubGraphBlockInformation(elseBranch.graph));
4399 4399
4400 HBasicBlock conditionStartBlock = conditionBranch.block; 4400 HBasicBlock conditionStartBlock = conditionBranch.block;
4401 conditionStartBlock.setBlockFlow(info, joinBlock); 4401 conditionStartBlock.setBlockFlow(info, joinBlock);
4402 SubGraph conditionGraph = conditionBranch.graph; 4402 SubGraph conditionGraph = conditionBranch.graph;
4403 HIf branch = conditionGraph.end.last; 4403 HIf branch = conditionGraph.end.last;
4404 assert(branch is HIf); 4404 assert(branch is HIf);
4405 branch.blockInformation = conditionStartBlock.blockFlow; 4405 branch.blockInformation = conditionStartBlock.blockFlow;
4406 } 4406 }
4407 } 4407 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698