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

Side by Side Diff: pkg/analyzer/lib/src/summary/format.dart

Issue 1740923002: Propertly summarize LUB function types. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/idl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files".
7 7
8 library analyzer.src.summary.format; 8 library analyzer.src.summary.format;
9 9
10 import 'flat_buffers.dart' as fb; 10 import 'flat_buffers.dart' as fb;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 } 90 }
91 91
92 class EntityRefBuilder extends Object with _EntityRefMixin implements idl.Entity Ref { 92 class EntityRefBuilder extends Object with _EntityRefMixin implements idl.Entity Ref {
93 bool _finished = false; 93 bool _finished = false;
94 94
95 List<int> _implicitFunctionTypeIndices; 95 List<int> _implicitFunctionTypeIndices;
96 int _paramReference; 96 int _paramReference;
97 int _reference; 97 int _reference;
98 int _slot; 98 int _slot;
99 List<UnlinkedParamBuilder> _syntheticParams;
100 EntityRefBuilder _syntheticReturnType;
99 List<EntityRefBuilder> _typeArguments; 101 List<EntityRefBuilder> _typeArguments;
100 102
101 @override 103 @override
102 List<int> get implicitFunctionTypeIndices => _implicitFunctionTypeIndices ??= <int>[]; 104 List<int> get implicitFunctionTypeIndices => _implicitFunctionTypeIndices ??= <int>[];
103 105
104 /** 106 /**
105 * If this is a reference to a function type implicitly defined by a 107 * If this is a reference to a function type implicitly defined by a
106 * function-typed parameter, a list of zero-based indices indicating the path 108 * function-typed parameter, a list of zero-based indices indicating the path
107 * from the entity referred to by [reference] to the appropriate type 109 * from the entity referred to by [reference] to the appropriate type
108 * parameter. Otherwise the empty list. 110 * parameter. Otherwise the empty list.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 * 182 *
181 * Otherwise zero. 183 * Otherwise zero.
182 */ 184 */
183 void set slot(int _value) { 185 void set slot(int _value) {
184 assert(!_finished); 186 assert(!_finished);
185 assert(_value == null || _value >= 0); 187 assert(_value == null || _value >= 0);
186 _slot = _value; 188 _slot = _value;
187 } 189 }
188 190
189 @override 191 @override
192 List<UnlinkedParamBuilder> get syntheticParams => _syntheticParams ??= <Unlink edParamBuilder>[];
193
194 /**
195 * If this [EntityRef] is a reference to a function type whose
196 * [FunctionElement] is not in any library (e.g. a function type that was
197 * synthesized by a LUB computation), the function parameters. Otherwise
198 * empty.
199 */
200 void set syntheticParams(List<UnlinkedParamBuilder> _value) {
201 assert(!_finished);
202 _syntheticParams = _value;
203 }
204
205 @override
206 EntityRefBuilder get syntheticReturnType => _syntheticReturnType;
207
208 /**
209 * If this [EntityRef] is a reference to a function type whose
210 * [FunctionElement] is not in any library (e.g. a function type that was
211 * synthesized by a LUB computation), the return type of the function.
212 * Otherwise `null`.
213 */
214 void set syntheticReturnType(EntityRefBuilder _value) {
215 assert(!_finished);
216 _syntheticReturnType = _value;
217 }
218
219 @override
190 List<EntityRefBuilder> get typeArguments => _typeArguments ??= <EntityRefBuild er>[]; 220 List<EntityRefBuilder> get typeArguments => _typeArguments ??= <EntityRefBuild er>[];
191 221
192 /** 222 /**
193 * If this is an instantiation of a generic type or generic executable, the 223 * If this is an instantiation of a generic type or generic executable, the
194 * type arguments used to instantiate it. Trailing type arguments of type 224 * type arguments used to instantiate it. Trailing type arguments of type
195 * `dynamic` are omitted. 225 * `dynamic` are omitted.
196 */ 226 */
197 void set typeArguments(List<EntityRefBuilder> _value) { 227 void set typeArguments(List<EntityRefBuilder> _value) {
198 assert(!_finished); 228 assert(!_finished);
199 _typeArguments = _value; 229 _typeArguments = _value;
200 } 230 }
201 231
202 EntityRefBuilder({List<int> implicitFunctionTypeIndices, int paramReference, i nt reference, int slot, List<EntityRefBuilder> typeArguments}) 232 EntityRefBuilder({List<int> implicitFunctionTypeIndices, int paramReference, i nt reference, int slot, List<UnlinkedParamBuilder> syntheticParams, EntityRefBui lder syntheticReturnType, List<EntityRefBuilder> typeArguments})
203 : _implicitFunctionTypeIndices = implicitFunctionTypeIndices, 233 : _implicitFunctionTypeIndices = implicitFunctionTypeIndices,
204 _paramReference = paramReference, 234 _paramReference = paramReference,
205 _reference = reference, 235 _reference = reference,
206 _slot = slot, 236 _slot = slot,
237 _syntheticParams = syntheticParams,
238 _syntheticReturnType = syntheticReturnType,
207 _typeArguments = typeArguments; 239 _typeArguments = typeArguments;
208 240
209 fb.Offset finish(fb.Builder fbBuilder) { 241 fb.Offset finish(fb.Builder fbBuilder) {
210 assert(!_finished); 242 assert(!_finished);
211 _finished = true; 243 _finished = true;
212 fb.Offset offset_implicitFunctionTypeIndices; 244 fb.Offset offset_implicitFunctionTypeIndices;
245 fb.Offset offset_syntheticParams;
246 fb.Offset offset_syntheticReturnType;
213 fb.Offset offset_typeArguments; 247 fb.Offset offset_typeArguments;
214 if (!(_implicitFunctionTypeIndices == null || _implicitFunctionTypeIndices.i sEmpty)) { 248 if (!(_implicitFunctionTypeIndices == null || _implicitFunctionTypeIndices.i sEmpty)) {
215 offset_implicitFunctionTypeIndices = fbBuilder.writeListUint32(_implicitFu nctionTypeIndices); 249 offset_implicitFunctionTypeIndices = fbBuilder.writeListUint32(_implicitFu nctionTypeIndices);
216 } 250 }
251 if (!(_syntheticParams == null || _syntheticParams.isEmpty)) {
252 offset_syntheticParams = fbBuilder.writeList(_syntheticParams.map((b) => b .finish(fbBuilder)).toList());
253 }
254 if (_syntheticReturnType != null) {
255 offset_syntheticReturnType = _syntheticReturnType.finish(fbBuilder);
256 }
217 if (!(_typeArguments == null || _typeArguments.isEmpty)) { 257 if (!(_typeArguments == null || _typeArguments.isEmpty)) {
218 offset_typeArguments = fbBuilder.writeList(_typeArguments.map((b) => b.fin ish(fbBuilder)).toList()); 258 offset_typeArguments = fbBuilder.writeList(_typeArguments.map((b) => b.fin ish(fbBuilder)).toList());
219 } 259 }
220 fbBuilder.startTable(); 260 fbBuilder.startTable();
221 if (offset_implicitFunctionTypeIndices != null) { 261 if (offset_implicitFunctionTypeIndices != null) {
222 fbBuilder.addOffset(4, offset_implicitFunctionTypeIndices); 262 fbBuilder.addOffset(4, offset_implicitFunctionTypeIndices);
223 } 263 }
224 if (_paramReference != null && _paramReference != 0) { 264 if (_paramReference != null && _paramReference != 0) {
225 fbBuilder.addUint32(3, _paramReference); 265 fbBuilder.addUint32(3, _paramReference);
226 } 266 }
227 if (_reference != null && _reference != 0) { 267 if (_reference != null && _reference != 0) {
228 fbBuilder.addUint32(0, _reference); 268 fbBuilder.addUint32(0, _reference);
229 } 269 }
230 if (_slot != null && _slot != 0) { 270 if (_slot != null && _slot != 0) {
231 fbBuilder.addUint32(2, _slot); 271 fbBuilder.addUint32(2, _slot);
232 } 272 }
273 if (offset_syntheticParams != null) {
274 fbBuilder.addOffset(6, offset_syntheticParams);
275 }
276 if (offset_syntheticReturnType != null) {
277 fbBuilder.addOffset(5, offset_syntheticReturnType);
278 }
233 if (offset_typeArguments != null) { 279 if (offset_typeArguments != null) {
234 fbBuilder.addOffset(1, offset_typeArguments); 280 fbBuilder.addOffset(1, offset_typeArguments);
235 } 281 }
236 return fbBuilder.endTable(); 282 return fbBuilder.endTable();
237 } 283 }
238 } 284 }
239 285
240 class _EntityRefReader extends fb.TableReader<_EntityRefImpl> { 286 class _EntityRefReader extends fb.TableReader<_EntityRefImpl> {
241 const _EntityRefReader(); 287 const _EntityRefReader();
242 288
243 @override 289 @override
244 _EntityRefImpl createObject(fb.BufferPointer bp) => new _EntityRefImpl(bp); 290 _EntityRefImpl createObject(fb.BufferPointer bp) => new _EntityRefImpl(bp);
245 } 291 }
246 292
247 class _EntityRefImpl extends Object with _EntityRefMixin implements idl.EntityRe f { 293 class _EntityRefImpl extends Object with _EntityRefMixin implements idl.EntityRe f {
248 final fb.BufferPointer _bp; 294 final fb.BufferPointer _bp;
249 295
250 _EntityRefImpl(this._bp); 296 _EntityRefImpl(this._bp);
251 297
252 List<int> _implicitFunctionTypeIndices; 298 List<int> _implicitFunctionTypeIndices;
253 int _paramReference; 299 int _paramReference;
254 int _reference; 300 int _reference;
255 int _slot; 301 int _slot;
302 List<idl.UnlinkedParam> _syntheticParams;
303 idl.EntityRef _syntheticReturnType;
256 List<idl.EntityRef> _typeArguments; 304 List<idl.EntityRef> _typeArguments;
257 305
258 @override 306 @override
259 List<int> get implicitFunctionTypeIndices { 307 List<int> get implicitFunctionTypeIndices {
260 _implicitFunctionTypeIndices ??= const fb.Uint32ListReader().vTableGet(_bp, 4, const <int>[]); 308 _implicitFunctionTypeIndices ??= const fb.Uint32ListReader().vTableGet(_bp, 4, const <int>[]);
261 return _implicitFunctionTypeIndices; 309 return _implicitFunctionTypeIndices;
262 } 310 }
263 311
264 @override 312 @override
265 int get paramReference { 313 int get paramReference {
266 _paramReference ??= const fb.Uint32Reader().vTableGet(_bp, 3, 0); 314 _paramReference ??= const fb.Uint32Reader().vTableGet(_bp, 3, 0);
267 return _paramReference; 315 return _paramReference;
268 } 316 }
269 317
270 @override 318 @override
271 int get reference { 319 int get reference {
272 _reference ??= const fb.Uint32Reader().vTableGet(_bp, 0, 0); 320 _reference ??= const fb.Uint32Reader().vTableGet(_bp, 0, 0);
273 return _reference; 321 return _reference;
274 } 322 }
275 323
276 @override 324 @override
277 int get slot { 325 int get slot {
278 _slot ??= const fb.Uint32Reader().vTableGet(_bp, 2, 0); 326 _slot ??= const fb.Uint32Reader().vTableGet(_bp, 2, 0);
279 return _slot; 327 return _slot;
280 } 328 }
281 329
282 @override 330 @override
331 List<idl.UnlinkedParam> get syntheticParams {
332 _syntheticParams ??= const fb.ListReader<idl.UnlinkedParam>(const _UnlinkedP aramReader()).vTableGet(_bp, 6, const <idl.UnlinkedParam>[]);
333 return _syntheticParams;
334 }
335
336 @override
337 idl.EntityRef get syntheticReturnType {
338 _syntheticReturnType ??= const _EntityRefReader().vTableGet(_bp, 5, null);
339 return _syntheticReturnType;
340 }
341
342 @override
283 List<idl.EntityRef> get typeArguments { 343 List<idl.EntityRef> get typeArguments {
284 _typeArguments ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader ()).vTableGet(_bp, 1, const <idl.EntityRef>[]); 344 _typeArguments ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader ()).vTableGet(_bp, 1, const <idl.EntityRef>[]);
285 return _typeArguments; 345 return _typeArguments;
286 } 346 }
287 } 347 }
288 348
289 abstract class _EntityRefMixin implements idl.EntityRef { 349 abstract class _EntityRefMixin implements idl.EntityRef {
290 @override 350 @override
291 Map<String, Object> toJson() { 351 Map<String, Object> toJson() {
292 Map<String, Object> _result = <String, Object>{}; 352 Map<String, Object> _result = <String, Object>{};
293 if (implicitFunctionTypeIndices.isNotEmpty) _result["implicitFunctionTypeInd ices"] = implicitFunctionTypeIndices; 353 if (implicitFunctionTypeIndices.isNotEmpty) _result["implicitFunctionTypeInd ices"] = implicitFunctionTypeIndices;
294 if (paramReference != 0) _result["paramReference"] = paramReference; 354 if (paramReference != 0) _result["paramReference"] = paramReference;
295 if (reference != 0) _result["reference"] = reference; 355 if (reference != 0) _result["reference"] = reference;
296 if (slot != 0) _result["slot"] = slot; 356 if (slot != 0) _result["slot"] = slot;
357 if (syntheticParams.isNotEmpty) _result["syntheticParams"] = syntheticParams .map((_value) => _value.toJson()).toList();
358 if (syntheticReturnType != null) _result["syntheticReturnType"] = syntheticR eturnType.toJson();
297 if (typeArguments.isNotEmpty) _result["typeArguments"] = typeArguments.map(( _value) => _value.toJson()).toList(); 359 if (typeArguments.isNotEmpty) _result["typeArguments"] = typeArguments.map(( _value) => _value.toJson()).toList();
298 return _result; 360 return _result;
299 } 361 }
300 362
301 @override 363 @override
302 Map<String, Object> toMap() => { 364 Map<String, Object> toMap() => {
303 "implicitFunctionTypeIndices": implicitFunctionTypeIndices, 365 "implicitFunctionTypeIndices": implicitFunctionTypeIndices,
304 "paramReference": paramReference, 366 "paramReference": paramReference,
305 "reference": reference, 367 "reference": reference,
306 "slot": slot, 368 "slot": slot,
369 "syntheticParams": syntheticParams,
370 "syntheticReturnType": syntheticReturnType,
307 "typeArguments": typeArguments, 371 "typeArguments": typeArguments,
308 }; 372 };
309 373
310 @override 374 @override
311 String toString() => convert.JSON.encode(toJson()); 375 String toString() => convert.JSON.encode(toJson());
312 } 376 }
313 377
314 class LinkedDependencyBuilder extends Object with _LinkedDependencyMixin impleme nts idl.LinkedDependency { 378 class LinkedDependencyBuilder extends Object with _LinkedDependencyMixin impleme nts idl.LinkedDependency {
315 bool _finished = false; 379 bool _finished = false;
316 380
(...skipping 6643 matching lines...) Expand 10 before | Expand all | Expand 10 after
6960 "propagatedTypeSlot": propagatedTypeSlot, 7024 "propagatedTypeSlot": propagatedTypeSlot,
6961 "type": type, 7025 "type": type,
6962 "visibleLength": visibleLength, 7026 "visibleLength": visibleLength,
6963 "visibleOffset": visibleOffset, 7027 "visibleOffset": visibleOffset,
6964 }; 7028 };
6965 7029
6966 @override 7030 @override
6967 String toString() => convert.JSON.encode(toJson()); 7031 String toString() => convert.JSON.encode(toJson());
6968 } 7032 }
6969 7033
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/idl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698