| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 abstract class KernelToElementMap { | 26 abstract class KernelToElementMap { |
| 27 /// Access to the commonly used elements and types. | 27 /// Access to the commonly used elements and types. |
| 28 CommonElements get commonElements; | 28 CommonElements get commonElements; |
| 29 | 29 |
| 30 /// [ElementEnvironment] for library, class and member lookup. | 30 /// [ElementEnvironment] for library, class and member lookup. |
| 31 ElementEnvironment get elementEnvironment; | 31 ElementEnvironment get elementEnvironment; |
| 32 | 32 |
| 33 /// Returns the [DartType] corresponding to [type]. | 33 /// Returns the [DartType] corresponding to [type]. |
| 34 DartType getDartType(ir.DartType type); | 34 DartType getDartType(ir.DartType type); |
| 35 | 35 |
| 36 /// Returns the [FunctionType] of the [node]. |
| 37 FunctionType getFunctionType(ir.FunctionNode node); |
| 38 |
| 36 /// Returns the list of [DartType]s corresponding to [types]. | 39 /// Returns the list of [DartType]s corresponding to [types]. |
| 37 List<DartType> getDartTypes(List<ir.DartType> types); | 40 List<DartType> getDartTypes(List<ir.DartType> types); |
| 38 | 41 |
| 39 /// Returns the [InterfaceType] corresponding to [type]. | 42 /// Returns the [InterfaceType] corresponding to [type]. |
| 40 InterfaceType getInterfaceType(ir.InterfaceType type); | 43 InterfaceType getInterfaceType(ir.InterfaceType type); |
| 41 | 44 |
| 42 /// Return the [InterfaceType] corresponding to the [cls] with the given | 45 /// Return the [InterfaceType] corresponding to the [cls] with the given |
| 43 /// [typeArguments]. | 46 /// [typeArguments]. |
| 44 InterfaceType createInterfaceType( | 47 InterfaceType createInterfaceType( |
| 45 ir.Class cls, List<ir.DartType> typeArguments); | 48 ir.Class cls, List<ir.DartType> typeArguments); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 enum ForeignKind { | 161 enum ForeignKind { |
| 159 JS, | 162 JS, |
| 160 JS_BUILTIN, | 163 JS_BUILTIN, |
| 161 JS_EMBEDDED_GLOBAL, | 164 JS_EMBEDDED_GLOBAL, |
| 162 JS_INTERCEPTOR_CONSTANT, | 165 JS_INTERCEPTOR_CONSTANT, |
| 163 NONE, | 166 NONE, |
| 164 } | 167 } |
| 165 | 168 |
| 166 abstract class KernelToElementMapMixin implements KernelToElementMap { | 169 abstract class KernelToElementMapMixin implements KernelToElementMap { |
| 167 DiagnosticReporter get reporter; | 170 DiagnosticReporter get reporter; |
| 168 FunctionType getFunctionType(ir.FunctionNode node); | |
| 169 native.BehaviorBuilder get nativeBehaviorBuilder; | 171 native.BehaviorBuilder get nativeBehaviorBuilder; |
| 170 ConstantValue computeConstantValue(ConstantExpression constant); | 172 ConstantValue computeConstantValue(ConstantExpression constant); |
| 171 | 173 |
| 172 @override | 174 @override |
| 173 Name getName(ir.Name name) { | 175 Name getName(ir.Name name) { |
| 174 return new Name( | 176 return new Name( |
| 175 name.name, name.isPrivate ? getLibrary(name.library) : null); | 177 name.name, name.isPrivate ? getLibrary(name.library) : null); |
| 176 } | 178 } |
| 177 | 179 |
| 178 @override | 180 @override |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 TypeMask getInferredTypeOf(MemberEntity member); | 927 TypeMask getInferredTypeOf(MemberEntity member); |
| 926 | 928 |
| 927 /// Returns the inferred type of a dynamic [selector] access on a receiver of | 929 /// Returns the inferred type of a dynamic [selector] access on a receiver of |
| 928 /// type [mask]. | 930 /// type [mask]. |
| 929 TypeMask selectorTypeOf(Selector selector, TypeMask mask); | 931 TypeMask selectorTypeOf(Selector selector, TypeMask mask); |
| 930 | 932 |
| 931 /// Returns the returned type annotation in the [nativeBehavior]. | 933 /// Returns the returned type annotation in the [nativeBehavior]. |
| 932 TypeMask typeFromNativeBehavior( | 934 TypeMask typeFromNativeBehavior( |
| 933 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld); | 935 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld); |
| 934 } | 936 } |
| OLD | NEW |