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

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 attempt at implementing private-aware constructor lookup logic - with normalized constructo… 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 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 1184
1185 if (!foundSuperOrRedirect) { 1185 if (!foundSuperOrRedirect) {
1186 // No super initializer found. Try to find the default constructor if 1186 // No super initializer found. Try to find the default constructor if
1187 // the class is not Object. 1187 // the class is not Object.
1188 ClassElement enclosingClass = constructor.getEnclosingClass(); 1188 ClassElement enclosingClass = constructor.getEnclosingClass();
1189 ClassElement superClass = enclosingClass.superclass; 1189 ClassElement superClass = enclosingClass.superclass;
1190 if (!enclosingClass.isObject(compiler)) { 1190 if (!enclosingClass.isObject(compiler)) {
1191 assert(superClass !== null); 1191 assert(superClass !== null);
1192 assert(superClass.resolutionState == STATE_DONE); 1192 assert(superClass.resolutionState == STATE_DONE);
1193 Selector selector = 1193 Selector selector =
1194 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0); 1194 new Selector.callDefaultConstructor(superClass.name,
1195 FunctionElement target = superClass.lookupConstructor(superClass.name); 1195 enclosingClass.getLibrary());
1196 FunctionElement target = superClass.lookupConstructor(selector);
1196 if (target === null) { 1197 if (target === null) {
1197 compiler.internalError("no default constructor available"); 1198 compiler.internalError("no default constructor available");
1198 } 1199 }
1199 inlineSuperOrRedirect(target.implementation, 1200 inlineSuperOrRedirect(target.implementation,
1200 selector, 1201 selector,
1201 const EmptyLink<Node>(), 1202 const EmptyLink<Node>(),
1202 constructors, 1203 constructors,
1203 fieldValues); 1204 fieldValues);
1204 } 1205 }
1205 } 1206 }
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4343 new HSubGraphBlockInformation(elseBranch.graph)); 4344 new HSubGraphBlockInformation(elseBranch.graph));
4344 4345
4345 HBasicBlock conditionStartBlock = conditionBranch.block; 4346 HBasicBlock conditionStartBlock = conditionBranch.block;
4346 conditionStartBlock.setBlockFlow(info, joinBlock); 4347 conditionStartBlock.setBlockFlow(info, joinBlock);
4347 SubGraph conditionGraph = conditionBranch.graph; 4348 SubGraph conditionGraph = conditionBranch.graph;
4348 HIf branch = conditionGraph.end.last; 4349 HIf branch = conditionGraph.end.last;
4349 assert(branch is HIf); 4350 assert(branch is HIf);
4350 branch.blockInformation = conditionStartBlock.blockFlow; 4351 branch.blockInformation = conditionStartBlock.blockFlow;
4351 } 4352 }
4352 } 4353 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698