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

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: 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 =
1147 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0); 1147 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0);
1148 FunctionElement target = superClass.lookupConstructor(superClass.name); 1148 FunctionElement target =
1149 superClass.lookupConstructor(enclosingClass.getLibrary(),
1150 superClass.name);
1149 if (target === null) { 1151 if (target === null) {
1150 compiler.internalError("no default constructor available"); 1152 compiler.internalError("no default constructor available");
1151 } 1153 }
1152 inlineSuperOrRedirect(target, 1154 inlineSuperOrRedirect(target,
1153 selector, 1155 selector,
1154 const EmptyLink<Node>(), 1156 const EmptyLink<Node>(),
1155 constructors, 1157 constructors,
1156 fieldValues); 1158 fieldValues);
1157 } 1159 }
1158 } 1160 }
(...skipping 3044 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 new HSubGraphBlockInformation(elseBranch.graph)); 4205 new HSubGraphBlockInformation(elseBranch.graph));
4204 4206
4205 HBasicBlock conditionStartBlock = conditionBranch.block; 4207 HBasicBlock conditionStartBlock = conditionBranch.block;
4206 conditionStartBlock.setBlockFlow(info, joinBlock); 4208 conditionStartBlock.setBlockFlow(info, joinBlock);
4207 SubGraph conditionGraph = conditionBranch.graph; 4209 SubGraph conditionGraph = conditionBranch.graph;
4208 HIf branch = conditionGraph.end.last; 4210 HIf branch = conditionGraph.end.last;
4209 assert(branch is HIf); 4211 assert(branch is HIf);
4210 branch.blockInformation = conditionStartBlock.blockFlow; 4212 branch.blockInformation = conditionStartBlock.blockFlow;
4211 } 4213 }
4212 } 4214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698