Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Side by Side Diff: pkg/compiler/lib/src/kernel/elements.dart

Issue 2897273002: Add FunctionEntity.asyncMarker and refactor SourceInformationStrategy to avoid ResolvedAst (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 /// Entity model for elements derived from Kernel IR. 5 /// Entity model for elements derived from Kernel IR.
6 6
7 import '../elements/entities.dart'; 7 import '../elements/entities.dart';
8 import '../elements/names.dart'; 8 import '../elements/names.dart';
9 import '../elements/types.dart'; 9 import '../elements/types.dart';
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 String get _kind; 86 String get _kind;
87 87
88 String toString() => 88 String toString() =>
89 '$_kind(${enclosingClass != null ? '${enclosingClass.name}.' : ''}$name)'; 89 '$_kind(${enclosingClass != null ? '${enclosingClass.name}.' : ''}$name)';
90 } 90 }
91 91
92 abstract class KFunction extends KMember implements FunctionEntity { 92 abstract class KFunction extends KMember implements FunctionEntity {
93 final ParameterStructure parameterStructure; 93 final ParameterStructure parameterStructure;
94 final bool isExternal; 94 final bool isExternal;
95 final AsyncMarker asyncMarker;
95 96
96 KFunction(int memberIndex, KLibrary library, KClass enclosingClass, Name name, 97 KFunction(int memberIndex, KLibrary library, KClass enclosingClass, Name name,
97 this.parameterStructure, 98 this.parameterStructure, this.asyncMarker,
98 {bool isStatic: false, this.isExternal: false}) 99 {bool isStatic: false, this.isExternal: false})
99 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic); 100 : super(memberIndex, library, enclosingClass, name, isStatic: isStatic);
100 } 101 }
101 102
102 abstract class KConstructor extends KFunction implements ConstructorEntity { 103 abstract class KConstructor extends KFunction implements ConstructorEntity {
103 final bool isConst; 104 final bool isConst;
104 105
105 KConstructor(int memberIndex, KClass enclosingClass, Name name, 106 KConstructor(int memberIndex, KClass enclosingClass, Name name,
106 ParameterStructure parameterStructure, {bool isExternal, this.isConst}) 107 ParameterStructure parameterStructure, {bool isExternal, this.isConst})
107 : super(memberIndex, enclosingClass.library, enclosingClass, name, 108 : super(memberIndex, enclosingClass.library, enclosingClass, name,
108 parameterStructure, 109 parameterStructure, AsyncMarker.SYNC,
109 isExternal: isExternal); 110 isExternal: isExternal);
110 111
111 @override 112 @override
112 bool get isConstructor => true; 113 bool get isConstructor => true;
113 114
114 @override 115 @override
115 bool get isInstanceMember => false; 116 bool get isInstanceMember => false;
116 117
117 @override 118 @override
118 bool get isStatic => false; 119 bool get isStatic => false;
(...skipping 27 matching lines...) Expand all
146 bool get isFactoryConstructor => true; 147 bool get isFactoryConstructor => true;
147 148
148 @override 149 @override
149 bool get isGenerativeConstructor => false; 150 bool get isGenerativeConstructor => false;
150 } 151 }
151 152
152 class KMethod extends KFunction { 153 class KMethod extends KFunction {
153 final bool isAbstract; 154 final bool isAbstract;
154 155
155 KMethod(int memberIndex, KLibrary library, KClass enclosingClass, Name name, 156 KMethod(int memberIndex, KLibrary library, KClass enclosingClass, Name name,
156 ParameterStructure parameterStructure, 157 ParameterStructure parameterStructure, AsyncMarker asyncMarker,
157 {bool isStatic, bool isExternal, this.isAbstract}) 158 {bool isStatic, bool isExternal, this.isAbstract})
158 : super(memberIndex, library, enclosingClass, name, parameterStructure, 159 : super(memberIndex, library, enclosingClass, name, parameterStructure,
160 asyncMarker,
159 isStatic: isStatic, isExternal: isExternal); 161 isStatic: isStatic, isExternal: isExternal);
160 162
161 @override 163 @override
162 bool get isFunction => true; 164 bool get isFunction => true;
163 165
164 String get _kind => 'method'; 166 String get _kind => 'method';
165 } 167 }
166 168
167 class KGetter extends KFunction { 169 class KGetter extends KFunction {
168 final bool isAbstract; 170 final bool isAbstract;
169 171
170 KGetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name, 172 KGetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name,
173 AsyncMarker asyncMarker,
171 {bool isStatic, bool isExternal, this.isAbstract}) 174 {bool isStatic, bool isExternal, this.isAbstract})
172 : super(memberIndex, library, enclosingClass, name, 175 : super(memberIndex, library, enclosingClass, name,
173 const ParameterStructure.getter(), 176 const ParameterStructure.getter(), asyncMarker,
174 isStatic: isStatic, isExternal: isExternal); 177 isStatic: isStatic, isExternal: isExternal);
175 178
176 @override 179 @override
177 bool get isGetter => true; 180 bool get isGetter => true;
178 181
179 String get _kind => 'getter'; 182 String get _kind => 'getter';
180 } 183 }
181 184
182 class KSetter extends KFunction { 185 class KSetter extends KFunction {
183 final bool isAbstract; 186 final bool isAbstract;
184 187
185 KSetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name, 188 KSetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name,
186 {bool isStatic, bool isExternal, this.isAbstract}) 189 {bool isStatic, bool isExternal, this.isAbstract})
187 : super(memberIndex, library, enclosingClass, name, 190 : super(memberIndex, library, enclosingClass, name,
188 const ParameterStructure.setter(), 191 const ParameterStructure.setter(), AsyncMarker.SYNC,
189 isStatic: isStatic, isExternal: isExternal); 192 isStatic: isStatic, isExternal: isExternal);
190 193
191 @override 194 @override
192 bool get isAssignable => true; 195 bool get isAssignable => true;
193 196
194 @override 197 @override
195 bool get isSetter => true; 198 bool get isSetter => true;
196 199
197 String get _kind => 'setter'; 200 String get _kind => 'setter';
198 } 201 }
(...skipping 27 matching lines...) Expand all
226 final MemberEntity memberContext; 229 final MemberEntity memberContext;
227 final Entity executableContext; 230 final Entity executableContext;
228 final FunctionType functionType; 231 final FunctionType functionType;
229 232
230 KLocalFunction( 233 KLocalFunction(
231 this.name, this.memberContext, this.executableContext, this.functionType); 234 this.name, this.memberContext, this.executableContext, this.functionType);
232 235
233 String toString() => 236 String toString() =>
234 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; 237 'local_function(${memberContext.name}.${name ?? '<anonymous>'})';
235 } 238 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698