| 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 '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../common_elements.dart'; | 10 import '../common_elements.dart'; |
| 11 import '../elements/entities.dart'; | 11 import '../elements/entities.dart'; |
| 12 import '../elements/jumps.dart'; | 12 import '../elements/jumps.dart'; |
| 13 import '../elements/names.dart'; | 13 import '../elements/names.dart'; |
| 14 import '../elements/types.dart'; | 14 import '../elements/types.dart'; |
| 15 import '../js/js.dart' as js; | 15 import '../js/js.dart' as js; |
| 16 import '../js_backend/namer.dart'; | 16 import '../js_backend/namer.dart'; |
| 17 import '../js_backend/native_data.dart'; |
| 17 import '../js_emitter/code_emitter_task.dart'; | 18 import '../js_emitter/code_emitter_task.dart'; |
| 18 import '../native/native.dart' as native; | 19 import '../native/native.dart' as native; |
| 19 import '../types/types.dart'; | 20 import '../types/types.dart'; |
| 20 import '../universe/call_structure.dart'; | 21 import '../universe/call_structure.dart'; |
| 21 import '../universe/selector.dart'; | 22 import '../universe/selector.dart'; |
| 22 import '../world.dart'; | 23 import '../world.dart'; |
| 23 | 24 |
| 24 /// Interface that translates between Kernel IR nodes and entities. | 25 /// Interface that translates between Kernel IR nodes and entities. |
| 25 abstract class KernelToElementMap { | 26 abstract class KernelToElementMap { |
| 26 /// Access to the commonly used elements and types. | 27 /// Access to the commonly used elements and types. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 /// Computes the [ConstantValue] for the constant [expression]. | 98 /// Computes the [ConstantValue] for the constant [expression]. |
| 98 // TODO(johnniwinther): Move to [KernelToElementMapForBuilding]. This is only | 99 // TODO(johnniwinther): Move to [KernelToElementMapForBuilding]. This is only |
| 99 // used in impact builder for symbol constants. | 100 // used in impact builder for symbol constants. |
| 100 ConstantValue getConstantValue(ir.Expression expression, | 101 ConstantValue getConstantValue(ir.Expression expression, |
| 101 {bool requireConstant: true, bool implicitNull: false}); | 102 {bool requireConstant: true, bool implicitNull: false}); |
| 102 } | 103 } |
| 103 | 104 |
| 104 /// Interface that translates between Kernel IR nodes and entities used for | 105 /// Interface that translates between Kernel IR nodes and entities used for |
| 105 /// computing the [WorldImpact] for members. | 106 /// computing the [WorldImpact] for members. |
| 106 abstract class KernelToElementMapForImpact extends KernelToElementMap { | 107 abstract class KernelToElementMapForImpact extends KernelToElementMap { |
| 108 NativeBasicData get nativeBasicData; |
| 109 |
| 107 /// Adds libraries in [program] to the set of libraries. | 110 /// Adds libraries in [program] to the set of libraries. |
| 108 /// | 111 /// |
| 109 /// The main method of the first program is used as the main method for the | 112 /// The main method of the first program is used as the main method for the |
| 110 /// compilation. | 113 /// compilation. |
| 111 void addProgram(ir.Program program); | 114 void addProgram(ir.Program program); |
| 112 | 115 |
| 113 /// Returns the [ConstructorEntity] corresponding to a super initializer in | 116 /// Returns the [ConstructorEntity] corresponding to a super initializer in |
| 114 /// [constructor]. | 117 /// [constructor]. |
| 115 /// | 118 /// |
| 116 /// The IR resolves super initializers to a [target] up in the type hierarchy. | 119 /// The IR resolves super initializers to a [target] up in the type hierarchy. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 uri = Uri.parse(node.location.file); | 445 uri = Uri.parse(node.location.file); |
| 443 break; | 446 break; |
| 444 } | 447 } |
| 445 node = node.parent; | 448 node = node.parent; |
| 446 } | 449 } |
| 447 if (uri != null) { | 450 if (uri != null) { |
| 448 return new SourceSpan(uri, offset, offset + 1); | 451 return new SourceSpan(uri, offset, offset + 1); |
| 449 } | 452 } |
| 450 return null; | 453 return null; |
| 451 } | 454 } |
| OLD | NEW |