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 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 | 3046 |
3047 List<HInstruction> capturedVariables = <HInstruction>[]; | 3047 List<HInstruction> capturedVariables = <HInstruction>[]; |
3048 closureInfo.createdFieldEntities.forEach((Local capturedLocal) { | 3048 closureInfo.createdFieldEntities.forEach((Local capturedLocal) { |
3049 assert(capturedLocal != null); | 3049 assert(capturedLocal != null); |
3050 capturedVariables.add(localsHandler.readLocal(capturedLocal)); | 3050 capturedVariables.add(localsHandler.readLocal(capturedLocal)); |
3051 }); | 3051 }); |
3052 | 3052 |
3053 TypeMask type = new TypeMask.nonNullExact(closureClassEntity, closedWorld); | 3053 TypeMask type = new TypeMask.nonNullExact(closureClassEntity, closedWorld); |
3054 // TODO(efortuna): Add source information here. | 3054 // TODO(efortuna): Add source information here. |
3055 push(new HCreate(closureClassEntity, capturedVariables, type, | 3055 push(new HCreate(closureClassEntity, capturedVariables, type, |
3056 callMethod: closureInfo.callMethod, localFunction: methodElement)); | 3056 callMethod: closureInfo.callMethod)); |
3057 } | 3057 } |
3058 | 3058 |
3059 @override | 3059 @override |
3060 visitFunctionDeclaration(ir.FunctionDeclaration declaration) { | 3060 visitFunctionDeclaration(ir.FunctionDeclaration declaration) { |
3061 assert(isReachable); | 3061 assert(isReachable); |
3062 declaration.function.accept(this); | 3062 declaration.function.accept(this); |
3063 Local localFunction = localsMap.getLocalFunction(declaration); | 3063 Local localFunction = localsMap.getLocalFunction(declaration); |
3064 localsHandler.updateLocal(localFunction, pop()); | 3064 localsHandler.updateLocal(localFunction, pop()); |
3065 } | 3065 } |
3066 | 3066 |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3656 enterBlock.setBlockFlow( | 3656 enterBlock.setBlockFlow( |
3657 new HTryBlockInformation( | 3657 new HTryBlockInformation( |
3658 kernelBuilder.wrapStatementGraph(bodyGraph), | 3658 kernelBuilder.wrapStatementGraph(bodyGraph), |
3659 exception, | 3659 exception, |
3660 kernelBuilder.wrapStatementGraph(catchGraph), | 3660 kernelBuilder.wrapStatementGraph(catchGraph), |
3661 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3661 kernelBuilder.wrapStatementGraph(finallyGraph)), |
3662 exitBlock); | 3662 exitBlock); |
3663 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3663 kernelBuilder.inTryStatement = previouslyInTryStatement; |
3664 } | 3664 } |
3665 } | 3665 } |
OLD | NEW |