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 '../common/names.dart'; | 9 import '../common/names.dart'; |
10 import '../constants/constructors.dart'; | 10 import '../constants/constructors.dart'; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 /// Kernel will say that C()'s super initializer resolves to Object(), but | 76 /// Kernel will say that C()'s super initializer resolves to Object(), but |
77 /// this function will return an entity representing the unnamed mixin | 77 /// this function will return an entity representing the unnamed mixin |
78 /// application "Object+M"'s constructor. | 78 /// application "Object+M"'s constructor. |
79 ConstructorEntity getSuperConstructor( | 79 ConstructorEntity getSuperConstructor( |
80 ir.Constructor constructor, ir.Member target); | 80 ir.Constructor constructor, ir.Member target); |
81 | 81 |
82 /// Returns the [MemberEntity] corresponding to the member [node]. | 82 /// Returns the [MemberEntity] corresponding to the member [node]. |
83 MemberEntity getMember(ir.Member node); | 83 MemberEntity getMember(ir.Member node); |
84 | 84 |
85 /// Returns the kernel IR node that defines the [member]. | 85 /// Returns the kernel IR node that defines the [member]. |
86 ir.Member getMemberNode(MemberEntity member); | 86 ir.Node getMemberNode(covariant MemberEntity member); |
87 | 87 |
88 /// Returns the [FunctionEntity] corresponding to the procedure [node]. | 88 /// Returns the [FunctionEntity] corresponding to the procedure [node]. |
89 FunctionEntity getMethod(ir.Procedure node); | 89 FunctionEntity getMethod(ir.Procedure node); |
90 | 90 |
91 /// Returns the super [MemberEntity] for a super invocation, get or set of | 91 /// Returns the super [MemberEntity] for a super invocation, get or set of |
92 /// [name] from the member [context]. | 92 /// [name] from the member [context]. |
93 /// | 93 /// |
94 /// The IR doesn't always resolve super accesses to the corresponding | 94 /// The IR doesn't always resolve super accesses to the corresponding |
95 /// [target]. If not, the target is computed using [name] and [setter] from | 95 /// [target]. If not, the target is computed using [name] and [setter] from |
96 /// the enclosing class of [context]. | 96 /// the enclosing class of [context]. |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 TypeMask typeOfInvocation( | 972 TypeMask typeOfInvocation( |
973 ir.MethodInvocation invocation, ClosedWorld closedWorld); | 973 ir.MethodInvocation invocation, ClosedWorld closedWorld); |
974 | 974 |
975 /// Returns the inferred receiver type of the dynamic [read]. | 975 /// Returns the inferred receiver type of the dynamic [read]. |
976 TypeMask typeOfGet(ir.PropertyGet read); | 976 TypeMask typeOfGet(ir.PropertyGet read); |
977 | 977 |
978 /// Returns the inferred receiver type of the dynamic [write]. | 978 /// Returns the inferred receiver type of the dynamic [write]. |
979 TypeMask typeOfSet(ir.PropertySet write, ClosedWorld closedWorld); | 979 TypeMask typeOfSet(ir.PropertySet write, ClosedWorld closedWorld); |
980 | 980 |
981 /// Returns the inferred type of [listLiteral]. | 981 /// Returns the inferred type of [listLiteral]. |
982 TypeMask typeOfListLiteral( | 982 TypeMask typeOfListLiteral(covariant MemberEntity owner, |
983 MemberEntity owner, ir.ListLiteral listLiteral, ClosedWorld closedWorld); | 983 ir.ListLiteral listLiteral, ClosedWorld closedWorld); |
984 | 984 |
985 /// Returns the inferred type of iterator in [forInStatement]. | 985 /// Returns the inferred type of iterator in [forInStatement]. |
986 TypeMask typeOfIterator(ir.ForInStatement forInStatement); | 986 TypeMask typeOfIterator(ir.ForInStatement forInStatement); |
987 | 987 |
988 /// Returns the inferred type of `current` in [forInStatement]. | 988 /// Returns the inferred type of `current` in [forInStatement]. |
989 TypeMask typeOfIteratorCurrent(ir.ForInStatement forInStatement); | 989 TypeMask typeOfIteratorCurrent(ir.ForInStatement forInStatement); |
990 | 990 |
991 /// Returns the inferred type of `moveNext` in [forInStatement]. | 991 /// Returns the inferred type of `moveNext` in [forInStatement]. |
992 TypeMask typeOfIteratorMoveNext(ir.ForInStatement forInStatement); | 992 TypeMask typeOfIteratorMoveNext(ir.ForInStatement forInStatement); |
993 | 993 |
(...skipping 25 matching lines...) Expand all Loading... |
1019 } | 1019 } |
1020 | 1020 |
1021 /// Map from kernel IR nodes to local entities. | 1021 /// Map from kernel IR nodes to local entities. |
1022 abstract class KernelToLocalsMap { | 1022 abstract class KernelToLocalsMap { |
1023 /// The member currently being built. | 1023 /// The member currently being built. |
1024 MemberEntity get currentMember; | 1024 MemberEntity get currentMember; |
1025 | 1025 |
1026 // TODO(johnniwinther): Make these return the [KernelToLocalsMap] to use from | 1026 // TODO(johnniwinther): Make these return the [KernelToLocalsMap] to use from |
1027 // now on. | 1027 // now on. |
1028 /// Call to notify that [member] is currently being inlined. | 1028 /// Call to notify that [member] is currently being inlined. |
1029 void enterInlinedMember(MemberEntity member); | 1029 void enterInlinedMember(covariant MemberEntity member); |
1030 | 1030 |
1031 /// Call to notify that [member] is no longer being inlined. | 1031 /// Call to notify that [member] is no longer being inlined. |
1032 void leaveInlinedMember(MemberEntity member); | 1032 void leaveInlinedMember(covariant MemberEntity member); |
1033 | 1033 |
1034 /// Returns the [Local] for [node]. | 1034 /// Returns the [Local] for [node]. |
1035 Local getLocal(ir.VariableDeclaration node); | 1035 Local getLocal(ir.VariableDeclaration node); |
1036 | 1036 |
1037 /// Returns the [JumpTarget] for the branch in [node]. | 1037 /// Returns the [JumpTarget] for the branch in [node]. |
1038 // TODO(johnniwinther): Split this by kind of [node]? | 1038 // TODO(johnniwinther): Split this by kind of [node]? |
1039 JumpTarget getJumpTarget(ir.TreeNode node, {bool isContinueTarget: false}); | 1039 JumpTarget getJumpTarget(ir.TreeNode node, {bool isContinueTarget: false}); |
1040 | 1040 |
1041 /// Returns the [LoopClosureRepresentationInfo] for the loop [node] in | 1041 /// Returns the [LoopClosureRepresentationInfo] for the loop [node] in |
1042 /// [closureClassMaps]. | 1042 /// [closureClassMaps]. |
1043 LoopClosureRepresentationInfo getClosureRepresentationInfoForLoop( | 1043 LoopClosureRepresentationInfo getClosureRepresentationInfoForLoop( |
1044 ClosureDataLookup closureLookup, ir.TreeNode node); | 1044 ClosureDataLookup closureLookup, ir.TreeNode node); |
1045 } | 1045 } |
1046 | 1046 |
1047 /// Comparator for the canonical order or named arguments. | 1047 /// Comparator for the canonical order or named arguments. |
1048 // TODO(johnniwinther): Remove this when named parameters are sorted in dill. | 1048 // TODO(johnniwinther): Remove this when named parameters are sorted in dill. |
1049 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) { | 1049 int namedOrdering(ir.VariableDeclaration a, ir.VariableDeclaration b) { |
1050 return a.name.compareTo(b.name); | 1050 return a.name.compareTo(b.name); |
1051 } | 1051 } |
OLD | NEW |