| 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'; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 ConstructorEntity getConstructor(ir.Member node); | 58 ConstructorEntity getConstructor(ir.Member node); |
| 59 | 59 |
| 60 /// Returns the [FieldEntity] corresponding to the field [node]. | 60 /// Returns the [FieldEntity] corresponding to the field [node]. |
| 61 FieldEntity getField(ir.Field node); | 61 FieldEntity getField(ir.Field node); |
| 62 | 62 |
| 63 /// Returns the [ClassEntity] corresponding to the class [node]. | 63 /// Returns the [ClassEntity] corresponding to the class [node]. |
| 64 ClassEntity getClass(ir.Class node); | 64 ClassEntity getClass(ir.Class node); |
| 65 | 65 |
| 66 /// Returns the [Local] corresponding to the [node]. The node must be either | 66 /// Returns the [Local] corresponding to the [node]. The node must be either |
| 67 /// a [ir.FunctionDeclaration] or [ir.FunctionExpression]. | 67 /// a [ir.FunctionDeclaration] or [ir.FunctionExpression]. |
| 68 // TODO(johnniwinther): Move this to [KernelToElementMapForImpact]. |
| 68 Local getLocalFunction(ir.TreeNode node); | 69 Local getLocalFunction(ir.TreeNode node); |
| 69 | 70 |
| 70 /// Returns the super [MemberEntity] for a super invocation, get or set of | 71 /// Returns the super [MemberEntity] for a super invocation, get or set of |
| 71 /// [name] from the member [context]. | 72 /// [name] from the member [context]. |
| 72 /// | 73 /// |
| 73 /// The IR doesn't always resolve super accesses to the corresponding | 74 /// The IR doesn't always resolve super accesses to the corresponding |
| 74 /// [target]. If not, the target is computed using [name] and [setter] from | 75 /// [target]. If not, the target is computed using [name] and [setter] from |
| 75 /// the enclosing class of [context]. | 76 /// the enclosing class of [context]. |
| 76 MemberEntity getSuperMember(ir.Member context, ir.Name name, ir.Member target, | 77 MemberEntity getSuperMember(ir.Member context, ir.Name name, ir.Member target, |
| 77 {bool setter: false}); | 78 {bool setter: false}); |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 /// Returns the inferred type of a dynamic [selector] access on a receiver of | 355 /// Returns the inferred type of a dynamic [selector] access on a receiver of |
| 355 /// type [mask]. | 356 /// type [mask]. |
| 356 TypeMask selectorTypeOf(Selector selector, TypeMask mask); | 357 TypeMask selectorTypeOf(Selector selector, TypeMask mask); |
| 357 | 358 |
| 358 /// Returns the returned type annotation in the [nativeBehavior]. | 359 /// Returns the returned type annotation in the [nativeBehavior]. |
| 359 TypeMask typeFromNativeBehavior( | 360 TypeMask typeFromNativeBehavior( |
| 360 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld); | 361 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld); |
| 361 } | 362 } |
| 362 | 363 |
| 363 /// Map from kernel IR nodes to local entities. | 364 /// Map from kernel IR nodes to local entities. |
| 365 // TODO(johnniwinther): Add `getLocalFunction`. |
| 364 abstract class KernelToLocalsMap { | 366 abstract class KernelToLocalsMap { |
| 365 /// The member currently being built. | 367 /// The member currently being built. |
| 366 MemberEntity get currentMember; | 368 MemberEntity get currentMember; |
| 367 | 369 |
| 368 // TODO(johnniwinther): Make these return the [KernelToLocalsMap] to use from | 370 // TODO(johnniwinther): Make these return the [KernelToLocalsMap] to use from |
| 369 // now on. | 371 // now on. |
| 370 /// Call to notify that [member] is currently being inlined. | 372 /// Call to notify that [member] is currently being inlined. |
| 371 void enterInlinedMember(covariant MemberEntity member); | 373 void enterInlinedMember(covariant MemberEntity member); |
| 372 | 374 |
| 373 /// Call to notify that [member] is no longer being inlined. | 375 /// Call to notify that [member] is no longer being inlined. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 /// [closureClassMaps]. | 419 /// [closureClassMaps]. |
| 418 CapturedLoopScope getCapturedLoopScope( | 420 CapturedLoopScope getCapturedLoopScope( |
| 419 ClosureDataLookup closureLookup, ir.TreeNode node); | 421 ClosureDataLookup closureLookup, ir.TreeNode node); |
| 420 } | 422 } |
| 421 | 423 |
| 422 /// Comparator for the canonical order or named arguments. | 424 /// Comparator for the canonical order or named arguments. |
| 423 // TODO(johnniwinther): Remove this when named parameters are sorted in dill. | 425 // TODO(johnniwinther): Remove this when named parameters are sorted in dill. |
| 424 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) { | 426 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) { |
| 425 return a.name.compareTo(b.name); | 427 return a.name.compareTo(b.name); |
| 426 } | 428 } |
| OLD | NEW |