OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 | 6 |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/codegen.dart' show CodegenRegistry; | 9 import '../common/codegen.dart' show CodegenRegistry; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 param = addParameter(typeVariableType.element, commonMasks.nonNullType); | 214 param = addParameter(typeVariableType.element, commonMasks.nonNullType); |
215 } else { | 215 } else { |
216 // Unused, so bind to `dynamic`. | 216 // Unused, so bind to `dynamic`. |
217 param = graph.addConstantNull(closedWorld); | 217 param = graph.addConstantNull(closedWorld); |
218 } | 218 } |
219 localsHandler.directLocals[ | 219 localsHandler.directLocals[ |
220 localsHandler.getTypeVariableAsLocal(typeVariableType)] = param; | 220 localsHandler.getTypeVariableAsLocal(typeVariableType)] = param; |
221 }); | 221 }); |
222 } | 222 } |
223 | 223 |
224 /// Comparator for the canonical order or named arguments. | |
225 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) { | |
226 return a.name.compareTo(b.name); | |
227 } | |
228 | |
229 /// Builds a generative constructor. | 224 /// Builds a generative constructor. |
230 /// | 225 /// |
231 /// Generative constructors are built in stages, in effect inlining the | 226 /// Generative constructors are built in stages, in effect inlining the |
232 /// initializers and constructor bodies up the inheritance chain. | 227 /// initializers and constructor bodies up the inheritance chain. |
233 /// | 228 /// |
234 /// 1. Extend method parameters with parameters the class's type parameters. | 229 /// 1. Extend method parameters with parameters the class's type parameters. |
235 /// | 230 /// |
236 /// 2. Add type checks for value parameters (might need result of (1)). | 231 /// 2. Add type checks for value parameters (might need result of (1)). |
237 /// | 232 /// |
238 /// 3. Walk inheritance chain to build bindings for type parameters of | 233 /// 3. Walk inheritance chain to build bindings for type parameters of |
(...skipping 3232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3471 enterBlock.setBlockFlow( | 3466 enterBlock.setBlockFlow( |
3472 new HTryBlockInformation( | 3467 new HTryBlockInformation( |
3473 kernelBuilder.wrapStatementGraph(bodyGraph), | 3468 kernelBuilder.wrapStatementGraph(bodyGraph), |
3474 exception, | 3469 exception, |
3475 kernelBuilder.wrapStatementGraph(catchGraph), | 3470 kernelBuilder.wrapStatementGraph(catchGraph), |
3476 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3471 kernelBuilder.wrapStatementGraph(finallyGraph)), |
3477 exitBlock); | 3472 exitBlock); |
3478 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3473 kernelBuilder.inTryStatement = previouslyInTryStatement; |
3479 } | 3474 } |
3480 } | 3475 } |
OLD | NEW |