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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // Provide the parameters to the generative constructor body. | 334 // Provide the parameters to the generative constructor body. |
335 body.function.positionalParameters.forEach(handleParameter); | 335 body.function.positionalParameters.forEach(handleParameter); |
336 body.function.namedParameters.toList() | 336 body.function.namedParameters.toList() |
337 ..sort(namedOrdering) | 337 ..sort(namedOrdering) |
338 ..forEach(handleParameter); | 338 ..forEach(handleParameter); |
339 | 339 |
340 // If there are locals that escape (i.e. mutated in closures), we pass the | 340 // If there are locals that escape (i.e. mutated in closures), we pass the |
341 // box to the constructor. | 341 // box to the constructor. |
342 ClosureAnalysisInfo scopeData = closureDataLookup | 342 ClosureAnalysisInfo scopeData = closureDataLookup |
343 .getClosureAnalysisInfo(constructorElement.resolvedAst.node); | 343 .getClosureAnalysisInfo(constructorElement.resolvedAst.node); |
344 if (scopeData.requiresContextBox()) { | 344 if (scopeData.requiresContextBox) { |
345 bodyCallInputs.add(localsHandler.readLocal(scopeData.context)); | 345 bodyCallInputs.add(localsHandler.readLocal(scopeData.context)); |
346 } | 346 } |
347 | 347 |
348 // Pass type arguments. | 348 // Pass type arguments. |
349 ir.Class currentClass = body.enclosingClass; | 349 ir.Class currentClass = body.enclosingClass; |
350 if (backend.rtiNeed.classNeedsRti(_elementMap.getClass(currentClass))) { | 350 if (backend.rtiNeed.classNeedsRti(_elementMap.getClass(currentClass))) { |
351 for (ir.DartType typeParameter in currentClass.thisType.typeArguments) { | 351 for (ir.DartType typeParameter in currentClass.thisType.typeArguments) { |
352 HInstruction argument = localsHandler.readLocal(localsHandler | 352 HInstruction argument = localsHandler.readLocal(localsHandler |
353 .getTypeVariableAsLocal(_elementMap.getDartType(typeParameter) | 353 .getTypeVariableAsLocal(_elementMap.getDartType(typeParameter) |
354 as ResolutionTypeVariableType)); | 354 as ResolutionTypeVariableType)); |
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3471 enterBlock.setBlockFlow( | 3471 enterBlock.setBlockFlow( |
3472 new HTryBlockInformation( | 3472 new HTryBlockInformation( |
3473 kernelBuilder.wrapStatementGraph(bodyGraph), | 3473 kernelBuilder.wrapStatementGraph(bodyGraph), |
3474 exception, | 3474 exception, |
3475 kernelBuilder.wrapStatementGraph(catchGraph), | 3475 kernelBuilder.wrapStatementGraph(catchGraph), |
3476 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3476 kernelBuilder.wrapStatementGraph(finallyGraph)), |
3477 exitBlock); | 3477 exitBlock); |
3478 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3478 kernelBuilder.inTryStatement = previouslyInTryStatement; |
3479 } | 3479 } |
3480 } | 3480 } |
OLD | NEW |