| 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 library dart2js.kernel.world_builder; |
| 6 |
| 5 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 6 | 8 |
| 7 import '../common.dart'; | 9 import '../common.dart'; |
| 8 import '../common/backend_api.dart'; | 10 import '../common/backend_api.dart'; |
| 9 import '../common/names.dart'; | 11 import '../common/names.dart'; |
| 10 import '../compile_time_constants.dart'; | 12 import '../compile_time_constants.dart'; |
| 11 import '../constants/constant_system.dart'; | 13 import '../constants/constant_system.dart'; |
| 12 import '../constants/constructors.dart'; | 14 import '../constants/constructors.dart'; |
| 13 import '../constants/evaluation.dart'; | 15 import '../constants/evaluation.dart'; |
| 14 import '../constants/expressions.dart'; | 16 import '../constants/expressions.dart'; |
| 15 import '../constants/values.dart'; | 17 import '../constants/values.dart'; |
| 16 import '../common_elements.dart'; | 18 import '../common_elements.dart'; |
| 17 import '../elements/elements.dart'; | 19 import '../elements/elements.dart'; |
| 18 import '../elements/entities.dart'; | 20 import '../elements/entities.dart'; |
| 19 import '../elements/types.dart'; | 21 import '../elements/types.dart'; |
| 20 import '../js_backend/backend_helpers.dart'; | 22 import '../js_backend/backend_helpers.dart'; |
| 21 import '../js_backend/constant_system_javascript.dart'; | 23 import '../js_backend/constant_system_javascript.dart'; |
| 24 import '../js_backend/no_such_method_registry.dart'; |
| 22 import '../native/native.dart' as native; | 25 import '../native/native.dart' as native; |
| 23 import 'element_adapter.dart'; | 26 import 'element_adapter.dart'; |
| 24 import 'elements.dart'; | 27 import 'elements.dart'; |
| 25 | 28 |
| 29 part 'no_such_method_resolver.dart'; |
| 30 |
| 26 /// World builder used for creating elements and types corresponding to Kernel | 31 /// World builder used for creating elements and types corresponding to Kernel |
| 27 /// IR nodes. | 32 /// IR nodes. |
| 28 // TODO(johnniwinther): Implement [ResolutionWorldBuilder]. | 33 // TODO(johnniwinther): Implement [ResolutionWorldBuilder]. |
| 29 class KernelWorldBuilder extends KernelElementAdapterMixin { | 34 class KernelWorldBuilder extends KernelElementAdapterMixin { |
| 30 CommonElements _commonElements; | 35 CommonElements _commonElements; |
| 31 native.BehaviorBuilder _nativeBehaviorBuilder; | 36 native.BehaviorBuilder _nativeBehaviorBuilder; |
| 32 final DiagnosticReporter reporter; | 37 final DiagnosticReporter reporter; |
| 33 ElementEnvironment _elementEnvironment; | 38 ElementEnvironment _elementEnvironment; |
| 34 DartTypeConverter _typeConverter; | 39 DartTypeConverter _typeConverter; |
| 35 | 40 |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 } | 838 } |
| 834 | 839 |
| 835 InterfaceType getMixinTypeForClass(KClass cls) { | 840 InterfaceType getMixinTypeForClass(KClass cls) { |
| 836 KClassEnv env = builder._classEnvs[cls.classIndex]; | 841 KClassEnv env = builder._classEnvs[cls.classIndex]; |
| 837 ir.Supertype mixedInType = env.cls.mixedInType; | 842 ir.Supertype mixedInType = env.cls.mixedInType; |
| 838 if (mixedInType == null) return null; | 843 if (mixedInType == null) return null; |
| 839 return builder.createInterfaceType( | 844 return builder.createInterfaceType( |
| 840 mixedInType.classNode, mixedInType.typeArguments); | 845 mixedInType.classNode, mixedInType.typeArguments); |
| 841 } | 846 } |
| 842 } | 847 } |
| OLD | NEW |