| OLD | NEW |
| 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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 | 1206 |
| 1207 if (!foundSuperOrRedirect) { | 1207 if (!foundSuperOrRedirect) { |
| 1208 // No super initializer found. Try to find the default constructor if | 1208 // No super initializer found. Try to find the default constructor if |
| 1209 // the class is not Object. | 1209 // the class is not Object. |
| 1210 ClassElement enclosingClass = constructor.getEnclosingClass(); | 1210 ClassElement enclosingClass = constructor.getEnclosingClass(); |
| 1211 ClassElement superClass = enclosingClass.superclass; | 1211 ClassElement superClass = enclosingClass.superclass; |
| 1212 if (!enclosingClass.isObject(compiler)) { | 1212 if (!enclosingClass.isObject(compiler)) { |
| 1213 assert(superClass !== null); | 1213 assert(superClass !== null); |
| 1214 assert(superClass.resolutionState == STATE_DONE); | 1214 assert(superClass.resolutionState == STATE_DONE); |
| 1215 Selector selector = | 1215 Selector selector = |
| 1216 new Selector.callDefaultConstructor(enclosingClass.getLibrary()); | 1216 new Selector.call(superClass.name, enclosingClass.getLibrary(), 0); |
| 1217 // TODO(johnniwinther): Should we find injected constructors as well? | 1217 // TODO(johnniwinther): Should we find injected constructors as well? |
| 1218 FunctionElement target = superClass.lookupConstructor(selector); | 1218 FunctionElement target = superClass.lookupConstructor(superClass.name); |
| 1219 if (target === null) { | 1219 if (target === null) { |
| 1220 compiler.internalError("no default constructor available"); | 1220 compiler.internalError("no default constructor available"); |
| 1221 } | 1221 } |
| 1222 inlineSuperOrRedirect(target.implementation, | 1222 inlineSuperOrRedirect(target.implementation, |
| 1223 selector, | 1223 selector, |
| 1224 const Link<Node>(), | 1224 const Link<Node>(), |
| 1225 constructors, | 1225 constructors, |
| 1226 fieldValues); | 1226 fieldValues); |
| 1227 } | 1227 } |
| 1228 } | 1228 } |
| (...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4463 new HSubGraphBlockInformation(elseBranch.graph)); | 4463 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4464 | 4464 |
| 4465 HBasicBlock conditionStartBlock = conditionBranch.block; | 4465 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4466 conditionStartBlock.setBlockFlow(info, joinBlock); | 4466 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4467 SubGraph conditionGraph = conditionBranch.graph; | 4467 SubGraph conditionGraph = conditionBranch.graph; |
| 4468 HIf branch = conditionGraph.end.last; | 4468 HIf branch = conditionGraph.end.last; |
| 4469 assert(branch is HIf); | 4469 assert(branch is HIf); |
| 4470 branch.blockInformation = conditionStartBlock.blockFlow; | 4470 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4471 } | 4471 } |
| 4472 } | 4472 } |
| OLD | NEW |