| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart2js.ir_builder; | 5 part of dart2js.ir_builder; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This task iterates through all resolved elements and builds [ir.Node]s. The | 8 * This task iterates through all resolved elements and builds [ir.Node]s. The |
| 9 * nodes are stored in the [nodes] map and accessible through [hasIr] and | 9 * nodes are stored in the [nodes] map and accessible through [hasIr] and |
| 10 * [getIr]. | 10 * [getIr]. |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // No super initializer found. Try to find the default constructor if | 235 // No super initializer found. Try to find the default constructor if |
| 236 // the class is not Object. | 236 // the class is not Object. |
| 237 ClassElement enclosingClass = element.enclosingClass; | 237 ClassElement enclosingClass = element.enclosingClass; |
| 238 if (!enclosingClass.isObject) { | 238 if (!enclosingClass.isObject) { |
| 239 ClassElement superClass = enclosingClass.superclass; | 239 ClassElement superClass = enclosingClass.superclass; |
| 240 FunctionElement target = superClass.lookupDefaultConstructor(); | 240 FunctionElement target = superClass.lookupDefaultConstructor(); |
| 241 if (target == null) { | 241 if (target == null) { |
| 242 compiler.internalError(superClass, | 242 compiler.internalError(superClass, |
| 243 "No default constructor available."); | 243 "No default constructor available."); |
| 244 } | 244 } |
| 245 Selector selector = new Selector.fromElement(target); | 245 Selector selector = new Selector.callDefaultConstructor(); |
| 246 result.add(irBuilder.makeSuperInitializer(target, | 246 result.add(irBuilder.makeSuperInitializer(target, |
| 247 <ir.RunnableBody>[], | 247 <ir.RunnableBody>[], |
| 248 selector)); | 248 selector)); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 return result; | 251 return result; |
| 252 } | 252 } |
| 253 | 253 |
| 254 ir.Primitive visit(ast.Node node) => node.accept(this); | 254 ir.Primitive visit(ast.Node node) => node.accept(this); |
| 255 | 255 |
| (...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 element, | 1540 element, |
| 1541 node, | 1541 node, |
| 1542 elements); | 1542 elements); |
| 1543 IrBuilder builder = | 1543 IrBuilder builder = |
| 1544 new JsIrBuilder(compiler.backend.constantSystem, element); | 1544 new JsIrBuilder(compiler.backend.constantSystem, element); |
| 1545 return withBuilder(builder, () => _makeFunctionBody(element, node)); | 1545 return withBuilder(builder, () => _makeFunctionBody(element, node)); |
| 1546 } | 1546 } |
| 1547 | 1547 |
| 1548 } | 1548 } |
| 1549 | 1549 |
| OLD | NEW |