| 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 import 'package:kernel/text/ast_to_text.dart' show debugNodeToString; | 6 import 'package:kernel/text/ast_to_text.dart' show debugNodeToString; |
| 7 | 7 |
| 8 import '../closure.dart'; | 8 import '../closure.dart'; |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 // parameters, 'constructor' is a static function that forwards the call to | 970 // parameters, 'constructor' is a static function that forwards the call to |
| 971 // the factory constructor without type parameters. | 971 // the factory constructor without type parameters. |
| 972 assert(constructor.kind == ir.ProcedureKind.Factory); | 972 assert(constructor.kind == ir.ProcedureKind.Factory); |
| 973 | 973 |
| 974 // The instruction type will always be a subtype of the mapLiteralClass, but | 974 // The instruction type will always be a subtype of the mapLiteralClass, but |
| 975 // type inference might discover a more specific type, or find nothing (in | 975 // type inference might discover a more specific type, or find nothing (in |
| 976 // dart2js unit tests). | 976 // dart2js unit tests). |
| 977 TypeMask mapType = new TypeMask.nonNullSubtype( | 977 TypeMask mapType = new TypeMask.nonNullSubtype( |
| 978 astAdapter.getElement(astAdapter.mapLiteralClass), closedWorld); | 978 astAdapter.getElement(astAdapter.mapLiteralClass), closedWorld); |
| 979 TypeMask returnTypeMask = TypeMaskFactory.inferredReturnTypeForElement( | 979 TypeMask returnTypeMask = TypeMaskFactory.inferredReturnTypeForElement( |
| 980 astAdapter.getElement(constructor), compiler); | 980 astAdapter.getElement(constructor), globalInferenceResults); |
| 981 TypeMask instructionType = | 981 TypeMask instructionType = |
| 982 mapType.intersection(returnTypeMask, closedWorld); | 982 mapType.intersection(returnTypeMask, closedWorld); |
| 983 | 983 |
| 984 addImplicitInstantiation(type); | 984 addImplicitInstantiation(type); |
| 985 _pushStaticInvocation(constructor, inputs, instructionType); | 985 _pushStaticInvocation(constructor, inputs, instructionType); |
| 986 removeImplicitInstantiation(type); | 986 removeImplicitInstantiation(type); |
| 987 } | 987 } |
| 988 | 988 |
| 989 @override | 989 @override |
| 990 void visitMapEntry(ir.MapEntry mapEntry) { | 990 void visitMapEntry(ir.MapEntry mapEntry) { |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 push(new HNot(popBoolified(), commonMasks.boolType)); | 1934 push(new HNot(popBoolified(), commonMasks.boolType)); |
| 1935 } | 1935 } |
| 1936 | 1936 |
| 1937 @override | 1937 @override |
| 1938 void visitStringConcatenation(ir.StringConcatenation stringConcat) { | 1938 void visitStringConcatenation(ir.StringConcatenation stringConcat) { |
| 1939 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); | 1939 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); |
| 1940 stringConcat.accept(stringBuilder); | 1940 stringConcat.accept(stringBuilder); |
| 1941 stack.add(stringBuilder.result); | 1941 stack.add(stringBuilder.result); |
| 1942 } | 1942 } |
| 1943 } | 1943 } |
| OLD | NEW |