| 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, CodegenWorkItem; | 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 constructor = astAdapter.mapLiteralUntypedMaker; | 1192 constructor = astAdapter.mapLiteralUntypedMaker; |
| 1193 } | 1193 } |
| 1194 } else { | 1194 } else { |
| 1195 inputs.addAll(typeInputs); | 1195 inputs.addAll(typeInputs); |
| 1196 } | 1196 } |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 // If runtime type information is needed and the map literal has no type | 1199 // If runtime type information is needed and the map literal has no type |
| 1200 // parameters, 'constructor' is a static function that forwards the call to | 1200 // parameters, 'constructor' is a static function that forwards the call to |
| 1201 // the factory constructor without type parameters. | 1201 // the factory constructor without type parameters. |
| 1202 assert(constructor.kind == ir.ProcedureKind.Method | 1202 assert(constructor.kind == ir.ProcedureKind.Method || |
| 1203 || constructor.kind == ir.ProcedureKind.Factory); | 1203 constructor.kind == ir.ProcedureKind.Factory); |
| 1204 | 1204 |
| 1205 // The instruction type will always be a subtype of the mapLiteralClass, but | 1205 // The instruction type will always be a subtype of the mapLiteralClass, but |
| 1206 // type inference might discover a more specific type, or find nothing (in | 1206 // type inference might discover a more specific type, or find nothing (in |
| 1207 // dart2js unit tests). | 1207 // dart2js unit tests). |
| 1208 TypeMask mapType = new TypeMask.nonNullSubtype( | 1208 TypeMask mapType = new TypeMask.nonNullSubtype( |
| 1209 astAdapter.getElement(astAdapter.mapLiteralClass), closedWorld); | 1209 astAdapter.getElement(astAdapter.mapLiteralClass), closedWorld); |
| 1210 TypeMask returnTypeMask = TypeMaskFactory.inferredReturnTypeForElement( | 1210 TypeMask returnTypeMask = TypeMaskFactory.inferredReturnTypeForElement( |
| 1211 astAdapter.getElement(constructor), globalInferenceResults); | 1211 astAdapter.getElement(constructor), globalInferenceResults); |
| 1212 TypeMask instructionType = | 1212 TypeMask instructionType = |
| 1213 mapType.intersection(returnTypeMask, closedWorld); | 1213 mapType.intersection(returnTypeMask, closedWorld); |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2479 kernelBuilder.open(exitBlock); | 2479 kernelBuilder.open(exitBlock); |
| 2480 enterBlock.setBlockFlow( | 2480 enterBlock.setBlockFlow( |
| 2481 new HTryBlockInformation( | 2481 new HTryBlockInformation( |
| 2482 kernelBuilder.wrapStatementGraph(bodyGraph), | 2482 kernelBuilder.wrapStatementGraph(bodyGraph), |
| 2483 exception, | 2483 exception, |
| 2484 kernelBuilder.wrapStatementGraph(catchGraph), | 2484 kernelBuilder.wrapStatementGraph(catchGraph), |
| 2485 kernelBuilder.wrapStatementGraph(finallyGraph)), | 2485 kernelBuilder.wrapStatementGraph(finallyGraph)), |
| 2486 exitBlock); | 2486 exitBlock); |
| 2487 } | 2487 } |
| 2488 } | 2488 } |
| OLD | NEW |