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

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

Issue 1584313005: Downplay the distinction between linked and prelinked summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/prelink.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 'base.dart' as base; 10 import 'base.dart' as base;
11 import 'flat_buffers.dart' as fb; 11 import 'flat_buffers.dart' as fb;
12 12
13 /** 13 /**
14 * Enum used to indicate the kind of entity referred to by a 14 * Enum used to indicate the kind of entity referred to by a
15 * [PrelinkedReference]. 15 * [LinkedReference].
16 */ 16 */
17 enum PrelinkedReferenceKind { 17 enum ReferenceKind {
18 classOrEnum, 18 classOrEnum,
19 typedef, 19 typedef,
20 topLevelFunction, 20 topLevelFunction,
21 topLevelPropertyAccessor, 21 topLevelPropertyAccessor,
22 prefix, 22 prefix,
23 unresolved, 23 unresolved,
24 } 24 }
25 25
26 /** 26 /**
27 * Enum used to indicate the kind of an executable. 27 * Enum used to indicate the kind of an executable.
28 */ 28 */
29 enum UnlinkedExecutableKind { 29 enum UnlinkedExecutableKind {
30 functionOrMethod, 30 functionOrMethod,
31 getter, 31 getter,
32 setter, 32 setter,
33 constructor, 33 constructor,
34 } 34 }
35 35
36 /** 36 /**
37 * Enum used to indicate the kind of a parameter. 37 * Enum used to indicate the kind of a parameter.
38 */ 38 */
39 enum UnlinkedParamKind { 39 enum UnlinkedParamKind {
40 required, 40 required,
41 positional, 41 positional,
42 named, 42 named,
43 } 43 }
44 44
45 class PrelinkedDependencyBuilder extends Object with _PrelinkedDependencyMixin i mplements PrelinkedDependency { 45 class LinkedDependencyBuilder extends Object with _LinkedDependencyMixin impleme nts LinkedDependency {
46 bool _finished = false; 46 bool _finished = false;
47 47
48 String _uri; 48 String _uri;
49 List<String> _parts; 49 List<String> _parts;
50 50
51 @override 51 @override
52 String get uri => _uri ?? ''; 52 String get uri => _uri ?? '';
53 53
54 /** 54 /**
55 * The relative URI of the dependent library. This URI is relative to the 55 * The relative URI of the dependent library. This URI is relative to the
(...skipping 12 matching lines...) Expand all
68 68
69 /** 69 /**
70 * URI for the compilation units listed in the library's `part` declarations. 70 * URI for the compilation units listed in the library's `part` declarations.
71 * These URIs are relative to the importing library. 71 * These URIs are relative to the importing library.
72 */ 72 */
73 void set parts(List<String> _value) { 73 void set parts(List<String> _value) {
74 assert(!_finished); 74 assert(!_finished);
75 _parts = _value; 75 _parts = _value;
76 } 76 }
77 77
78 PrelinkedDependencyBuilder({String uri, List<String> parts}) 78 LinkedDependencyBuilder({String uri, List<String> parts})
79 : _uri = uri, 79 : _uri = uri,
80 _parts = parts; 80 _parts = parts;
81 81
82 fb.Offset finish(fb.Builder fbBuilder) { 82 fb.Offset finish(fb.Builder fbBuilder) {
83 assert(!_finished); 83 assert(!_finished);
84 _finished = true; 84 _finished = true;
85 fb.Offset offset_uri; 85 fb.Offset offset_uri;
86 fb.Offset offset_parts; 86 fb.Offset offset_parts;
87 if (_uri != null) { 87 if (_uri != null) {
88 offset_uri = fbBuilder.writeString(_uri); 88 offset_uri = fbBuilder.writeString(_uri);
89 } 89 }
90 if (!(_parts == null || _parts.isEmpty)) { 90 if (!(_parts == null || _parts.isEmpty)) {
91 offset_parts = fbBuilder.writeList(_parts.map((b) => fbBuilder.writeString (b)).toList()); 91 offset_parts = fbBuilder.writeList(_parts.map((b) => fbBuilder.writeString (b)).toList());
92 } 92 }
93 fbBuilder.startTable(); 93 fbBuilder.startTable();
94 if (offset_uri != null) { 94 if (offset_uri != null) {
95 fbBuilder.addOffset(0, offset_uri); 95 fbBuilder.addOffset(0, offset_uri);
96 } 96 }
97 if (offset_parts != null) { 97 if (offset_parts != null) {
98 fbBuilder.addOffset(1, offset_parts); 98 fbBuilder.addOffset(1, offset_parts);
99 } 99 }
100 return fbBuilder.endTable(); 100 return fbBuilder.endTable();
101 } 101 }
102 } 102 }
103 103
104 /** 104 /**
105 * Information about a dependency that exists between one library and another 105 * Information about a dependency that exists between one library and another
106 * due to an "import" declaration. 106 * due to an "import" declaration.
107 */ 107 */
108 abstract class PrelinkedDependency extends base.SummaryClass { 108 abstract class LinkedDependency extends base.SummaryClass {
109 109
110 /** 110 /**
111 * The relative URI of the dependent library. This URI is relative to the 111 * The relative URI of the dependent library. This URI is relative to the
112 * importing library, even if there are intervening `export` declarations. 112 * importing library, even if there are intervening `export` declarations.
113 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports 113 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports
114 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be 114 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be
115 * `b/d/e.dart`. 115 * `b/d/e.dart`.
116 */ 116 */
117 String get uri; 117 String get uri;
118 118
119 /** 119 /**
120 * URI for the compilation units listed in the library's `part` declarations. 120 * URI for the compilation units listed in the library's `part` declarations.
121 * These URIs are relative to the importing library. 121 * These URIs are relative to the importing library.
122 */ 122 */
123 List<String> get parts; 123 List<String> get parts;
124 } 124 }
125 125
126 class _PrelinkedDependencyReader extends fb.TableReader<_PrelinkedDependencyImpl > { 126 class _LinkedDependencyReader extends fb.TableReader<_LinkedDependencyImpl> {
127 const _PrelinkedDependencyReader(); 127 const _LinkedDependencyReader();
128 128
129 @override 129 @override
130 _PrelinkedDependencyImpl createObject(fb.BufferPointer bp) => new _PrelinkedDe pendencyImpl(bp); 130 _LinkedDependencyImpl createObject(fb.BufferPointer bp) => new _LinkedDependen cyImpl(bp);
131 } 131 }
132 132
133 class _PrelinkedDependencyImpl extends Object with _PrelinkedDependencyMixin imp lements PrelinkedDependency { 133 class _LinkedDependencyImpl extends Object with _LinkedDependencyMixin implement s LinkedDependency {
134 final fb.BufferPointer _bp; 134 final fb.BufferPointer _bp;
135 135
136 _PrelinkedDependencyImpl(this._bp); 136 _LinkedDependencyImpl(this._bp);
137 137
138 String _uri; 138 String _uri;
139 List<String> _parts; 139 List<String> _parts;
140 140
141 @override 141 @override
142 String get uri { 142 String get uri {
143 _uri ??= const fb.StringReader().vTableGet(_bp, 0, ''); 143 _uri ??= const fb.StringReader().vTableGet(_bp, 0, '');
144 return _uri; 144 return _uri;
145 } 145 }
146 146
147 @override 147 @override
148 List<String> get parts { 148 List<String> get parts {
149 _parts ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_b p, 1, const <String>[]); 149 _parts ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_b p, 1, const <String>[]);
150 return _parts; 150 return _parts;
151 } 151 }
152 } 152 }
153 153
154 abstract class _PrelinkedDependencyMixin implements PrelinkedDependency { 154 abstract class _LinkedDependencyMixin implements LinkedDependency {
155 @override 155 @override
156 Map<String, Object> toMap() => { 156 Map<String, Object> toMap() => {
157 "uri": uri, 157 "uri": uri,
158 "parts": parts, 158 "parts": parts,
159 }; 159 };
160 } 160 }
161 161
162 class PrelinkedExportNameBuilder extends Object with _PrelinkedExportNameMixin i mplements PrelinkedExportName { 162 class LinkedExportNameBuilder extends Object with _LinkedExportNameMixin impleme nts LinkedExportName {
163 bool _finished = false; 163 bool _finished = false;
164 164
165 String _name; 165 String _name;
166 int _dependency; 166 int _dependency;
167 int _unit; 167 int _unit;
168 PrelinkedReferenceKind _kind; 168 ReferenceKind _kind;
169 169
170 @override 170 @override
171 String get name => _name ?? ''; 171 String get name => _name ?? '';
172 172
173 /** 173 /**
174 * Name of the exported entity. TODO(paulberry): do we include the trailing 174 * Name of the exported entity. TODO(paulberry): do we include the trailing
175 * '=' for a setter? 175 * '=' for a setter?
176 */ 176 */
177 void set name(String _value) { 177 void set name(String _value) {
178 assert(!_finished); 178 assert(!_finished);
179 _name = _value; 179 _name = _value;
180 } 180 }
181 181
182 @override 182 @override
183 int get dependency => _dependency ?? 0; 183 int get dependency => _dependency ?? 0;
184 184
185 /** 185 /**
186 * Index into [PrelinkedLibrary.dependencies] for the library in which the 186 * Index into [LinkedLibrary.dependencies] for the library in which the
187 * entity is defined. 187 * entity is defined.
188 */ 188 */
189 void set dependency(int _value) { 189 void set dependency(int _value) {
190 assert(!_finished); 190 assert(!_finished);
191 _dependency = _value; 191 _dependency = _value;
192 } 192 }
193 193
194 @override 194 @override
195 int get unit => _unit ?? 0; 195 int get unit => _unit ?? 0;
196 196
197 /** 197 /**
198 * Integer index indicating which unit in the exported library contains the 198 * Integer index indicating which unit in the exported library contains the
199 * definition of the entity. As with indices into [PrelinkedLibrary.units], 199 * definition of the entity. As with indices into [LinkedLibrary.units],
200 * zero represents the defining compilation unit, and nonzero values 200 * zero represents the defining compilation unit, and nonzero values
201 * represent parts in the order of the corresponding `part` declarations. 201 * represent parts in the order of the corresponding `part` declarations.
202 */ 202 */
203 void set unit(int _value) { 203 void set unit(int _value) {
204 assert(!_finished); 204 assert(!_finished);
205 _unit = _value; 205 _unit = _value;
206 } 206 }
207 207
208 @override 208 @override
209 PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum ; 209 ReferenceKind get kind => _kind ?? ReferenceKind.classOrEnum;
210 210
211 /** 211 /**
212 * The kind of the entity being referred to. 212 * The kind of the entity being referred to.
213 */ 213 */
214 void set kind(PrelinkedReferenceKind _value) { 214 void set kind(ReferenceKind _value) {
215 assert(!_finished); 215 assert(!_finished);
216 _kind = _value; 216 _kind = _value;
217 } 217 }
218 218
219 PrelinkedExportNameBuilder({String name, int dependency, int unit, PrelinkedRe ferenceKind kind}) 219 LinkedExportNameBuilder({String name, int dependency, int unit, ReferenceKind kind})
220 : _name = name, 220 : _name = name,
221 _dependency = dependency, 221 _dependency = dependency,
222 _unit = unit, 222 _unit = unit,
223 _kind = kind; 223 _kind = kind;
224 224
225 fb.Offset finish(fb.Builder fbBuilder) { 225 fb.Offset finish(fb.Builder fbBuilder) {
226 assert(!_finished); 226 assert(!_finished);
227 _finished = true; 227 _finished = true;
228 fb.Offset offset_name; 228 fb.Offset offset_name;
229 if (_name != null) { 229 if (_name != null) {
230 offset_name = fbBuilder.writeString(_name); 230 offset_name = fbBuilder.writeString(_name);
231 } 231 }
232 fbBuilder.startTable(); 232 fbBuilder.startTable();
233 if (offset_name != null) { 233 if (offset_name != null) {
234 fbBuilder.addOffset(0, offset_name); 234 fbBuilder.addOffset(0, offset_name);
235 } 235 }
236 if (_dependency != null && _dependency != 0) { 236 if (_dependency != null && _dependency != 0) {
237 fbBuilder.addInt32(1, _dependency); 237 fbBuilder.addInt32(1, _dependency);
238 } 238 }
239 if (_unit != null && _unit != 0) { 239 if (_unit != null && _unit != 0) {
240 fbBuilder.addInt32(2, _unit); 240 fbBuilder.addInt32(2, _unit);
241 } 241 }
242 if (_kind != null && _kind != PrelinkedReferenceKind.classOrEnum) { 242 if (_kind != null && _kind != ReferenceKind.classOrEnum) {
243 fbBuilder.addInt32(3, _kind.index); 243 fbBuilder.addInt32(3, _kind.index);
244 } 244 }
245 return fbBuilder.endTable(); 245 return fbBuilder.endTable();
246 } 246 }
247 } 247 }
248 248
249 /** 249 /**
250 * Information about a single name in the export namespace of the library that 250 * Information about a single name in the export namespace of the library that
251 * is not in the public namespace. 251 * is not in the public namespace.
252 */ 252 */
253 abstract class PrelinkedExportName extends base.SummaryClass { 253 abstract class LinkedExportName extends base.SummaryClass {
254 254
255 /** 255 /**
256 * Name of the exported entity. TODO(paulberry): do we include the trailing 256 * Name of the exported entity. TODO(paulberry): do we include the trailing
257 * '=' for a setter? 257 * '=' for a setter?
258 */ 258 */
259 String get name; 259 String get name;
260 260
261 /** 261 /**
262 * Index into [PrelinkedLibrary.dependencies] for the library in which the 262 * Index into [LinkedLibrary.dependencies] for the library in which the
263 * entity is defined. 263 * entity is defined.
264 */ 264 */
265 int get dependency; 265 int get dependency;
266 266
267 /** 267 /**
268 * Integer index indicating which unit in the exported library contains the 268 * Integer index indicating which unit in the exported library contains the
269 * definition of the entity. As with indices into [PrelinkedLibrary.units], 269 * definition of the entity. As with indices into [LinkedLibrary.units],
270 * zero represents the defining compilation unit, and nonzero values 270 * zero represents the defining compilation unit, and nonzero values
271 * represent parts in the order of the corresponding `part` declarations. 271 * represent parts in the order of the corresponding `part` declarations.
272 */ 272 */
273 int get unit; 273 int get unit;
274 274
275 /** 275 /**
276 * The kind of the entity being referred to. 276 * The kind of the entity being referred to.
277 */ 277 */
278 PrelinkedReferenceKind get kind; 278 ReferenceKind get kind;
279 } 279 }
280 280
281 class _PrelinkedExportNameReader extends fb.TableReader<_PrelinkedExportNameImpl > { 281 class _LinkedExportNameReader extends fb.TableReader<_LinkedExportNameImpl> {
282 const _PrelinkedExportNameReader(); 282 const _LinkedExportNameReader();
283 283
284 @override 284 @override
285 _PrelinkedExportNameImpl createObject(fb.BufferPointer bp) => new _PrelinkedEx portNameImpl(bp); 285 _LinkedExportNameImpl createObject(fb.BufferPointer bp) => new _LinkedExportNa meImpl(bp);
286 } 286 }
287 287
288 class _PrelinkedExportNameImpl extends Object with _PrelinkedExportNameMixin imp lements PrelinkedExportName { 288 class _LinkedExportNameImpl extends Object with _LinkedExportNameMixin implement s LinkedExportName {
289 final fb.BufferPointer _bp; 289 final fb.BufferPointer _bp;
290 290
291 _PrelinkedExportNameImpl(this._bp); 291 _LinkedExportNameImpl(this._bp);
292 292
293 String _name; 293 String _name;
294 int _dependency; 294 int _dependency;
295 int _unit; 295 int _unit;
296 PrelinkedReferenceKind _kind; 296 ReferenceKind _kind;
297 297
298 @override 298 @override
299 String get name { 299 String get name {
300 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); 300 _name ??= const fb.StringReader().vTableGet(_bp, 0, '');
301 return _name; 301 return _name;
302 } 302 }
303 303
304 @override 304 @override
305 int get dependency { 305 int get dependency {
306 _dependency ??= const fb.Int32Reader().vTableGet(_bp, 1, 0); 306 _dependency ??= const fb.Int32Reader().vTableGet(_bp, 1, 0);
307 return _dependency; 307 return _dependency;
308 } 308 }
309 309
310 @override 310 @override
311 int get unit { 311 int get unit {
312 _unit ??= const fb.Int32Reader().vTableGet(_bp, 2, 0); 312 _unit ??= const fb.Int32Reader().vTableGet(_bp, 2, 0);
313 return _unit; 313 return _unit;
314 } 314 }
315 315
316 @override 316 @override
317 PrelinkedReferenceKind get kind { 317 ReferenceKind get kind {
318 _kind ??= PrelinkedReferenceKind.values[const fb.Int32Reader().vTableGet(_bp , 3, 0)]; 318 _kind ??= ReferenceKind.values[const fb.Int32Reader().vTableGet(_bp, 3, 0)];
319 return _kind; 319 return _kind;
320 } 320 }
321 } 321 }
322 322
323 abstract class _PrelinkedExportNameMixin implements PrelinkedExportName { 323 abstract class _LinkedExportNameMixin implements LinkedExportName {
324 @override 324 @override
325 Map<String, Object> toMap() => { 325 Map<String, Object> toMap() => {
326 "name": name, 326 "name": name,
327 "dependency": dependency, 327 "dependency": dependency,
328 "unit": unit, 328 "unit": unit,
329 "kind": kind, 329 "kind": kind,
330 }; 330 };
331 } 331 }
332 332
333 class PrelinkedLibraryBuilder extends Object with _PrelinkedLibraryMixin impleme nts PrelinkedLibrary { 333 class LinkedLibraryBuilder extends Object with _LinkedLibraryMixin implements Li nkedLibrary {
334 bool _finished = false; 334 bool _finished = false;
335 335
336 List<PrelinkedUnitBuilder> _units; 336 List<LinkedUnitBuilder> _units;
337 List<PrelinkedDependencyBuilder> _dependencies; 337 List<LinkedDependencyBuilder> _dependencies;
338 List<int> _importDependencies; 338 List<int> _importDependencies;
339 List<PrelinkedExportNameBuilder> _exportNames; 339 List<LinkedExportNameBuilder> _exportNames;
340 340
341 @override 341 @override
342 List<PrelinkedUnit> get units => _units ?? const <PrelinkedUnit>[]; 342 List<LinkedUnit> get units => _units ?? const <LinkedUnit>[];
343 343
344 /** 344 /**
345 * The pre-linked summary of all the compilation units constituting the 345 * The linked summary of all the compilation units constituting the
346 * library. The summary of the defining compilation unit is listed first, 346 * library. The summary of the defining compilation unit is listed first,
347 * followed by the summary of each part, in the order of the `part` 347 * followed by the summary of each part, in the order of the `part`
348 * declarations in the defining compilation unit. 348 * declarations in the defining compilation unit.
349 */ 349 */
350 void set units(List<PrelinkedUnitBuilder> _value) { 350 void set units(List<LinkedUnitBuilder> _value) {
351 assert(!_finished); 351 assert(!_finished);
352 _units = _value; 352 _units = _value;
353 } 353 }
354 354
355 @override 355 @override
356 List<PrelinkedDependency> get dependencies => _dependencies ?? const <Prelinke dDependency>[]; 356 List<LinkedDependency> get dependencies => _dependencies ?? const <LinkedDepen dency>[];
357 357
358 /** 358 /**
359 * The libraries that this library depends on (either via an explicit import 359 * The libraries that this library depends on (either via an explicit import
360 * statement or via the implicit dependencies on `dart:core` and 360 * statement or via the implicit dependencies on `dart:core` and
361 * `dart:async`). The first element of this array is a pseudo-dependency 361 * `dart:async`). The first element of this array is a pseudo-dependency
362 * representing the library itself (it is also used for "dynamic"). 362 * representing the library itself (it is also used for "dynamic").
363 * 363 *
364 * TODO(paulberry): consider removing this entirely and just using 364 * TODO(paulberry): consider removing this entirely and just using
365 * [UnlinkedLibrary.imports]. 365 * [UnlinkedLibrary.imports].
366 */ 366 */
367 void set dependencies(List<PrelinkedDependencyBuilder> _value) { 367 void set dependencies(List<LinkedDependencyBuilder> _value) {
368 assert(!_finished); 368 assert(!_finished);
369 _dependencies = _value; 369 _dependencies = _value;
370 } 370 }
371 371
372 @override 372 @override
373 List<int> get importDependencies => _importDependencies ?? const <int>[]; 373 List<int> get importDependencies => _importDependencies ?? const <int>[];
374 374
375 /** 375 /**
376 * For each import in [UnlinkedUnit.imports], an index into [dependencies] 376 * For each import in [UnlinkedUnit.imports], an index into [dependencies]
377 * of the library being imported. 377 * of the library being imported.
378 * 378 *
379 * TODO(paulberry): if [dependencies] is removed, this can be removed as 379 * TODO(paulberry): if [dependencies] is removed, this can be removed as
380 * well, since there will effectively be a one-to-one mapping. 380 * well, since there will effectively be a one-to-one mapping.
381 */ 381 */
382 void set importDependencies(List<int> _value) { 382 void set importDependencies(List<int> _value) {
383 assert(!_finished); 383 assert(!_finished);
384 _importDependencies = _value; 384 _importDependencies = _value;
385 } 385 }
386 386
387 @override 387 @override
388 List<PrelinkedExportName> get exportNames => _exportNames ?? const <PrelinkedE xportName>[]; 388 List<LinkedExportName> get exportNames => _exportNames ?? const <LinkedExportN ame>[];
389 389
390 /** 390 /**
391 * Information about entities in the export namespace of the library that are 391 * Information about entities in the export namespace of the library that are
392 * not in the public namespace of the library (that is, entities that are 392 * not in the public namespace of the library (that is, entities that are
393 * brought into the namespace via `export` directives). 393 * brought into the namespace via `export` directives).
394 * 394 *
395 * Sorted by name. 395 * Sorted by name.
396 */ 396 */
397 void set exportNames(List<PrelinkedExportNameBuilder> _value) { 397 void set exportNames(List<LinkedExportNameBuilder> _value) {
398 assert(!_finished); 398 assert(!_finished);
399 _exportNames = _value; 399 _exportNames = _value;
400 } 400 }
401 401
402 PrelinkedLibraryBuilder({List<PrelinkedUnitBuilder> units, List<PrelinkedDepen dencyBuilder> dependencies, List<int> importDependencies, List<PrelinkedExportNa meBuilder> exportNames}) 402 LinkedLibraryBuilder({List<LinkedUnitBuilder> units, List<LinkedDependencyBuil der> dependencies, List<int> importDependencies, List<LinkedExportNameBuilder> e xportNames})
403 : _units = units, 403 : _units = units,
404 _dependencies = dependencies, 404 _dependencies = dependencies,
405 _importDependencies = importDependencies, 405 _importDependencies = importDependencies,
406 _exportNames = exportNames; 406 _exportNames = exportNames;
407 407
408 List<int> toBuffer() { 408 List<int> toBuffer() {
409 fb.Builder fbBuilder = new fb.Builder(); 409 fb.Builder fbBuilder = new fb.Builder();
410 return fbBuilder.finish(finish(fbBuilder)); 410 return fbBuilder.finish(finish(fbBuilder));
411 } 411 }
412 412
(...skipping 27 matching lines...) Expand all
440 fbBuilder.addOffset(2, offset_importDependencies); 440 fbBuilder.addOffset(2, offset_importDependencies);
441 } 441 }
442 if (offset_exportNames != null) { 442 if (offset_exportNames != null) {
443 fbBuilder.addOffset(3, offset_exportNames); 443 fbBuilder.addOffset(3, offset_exportNames);
444 } 444 }
445 return fbBuilder.endTable(); 445 return fbBuilder.endTable();
446 } 446 }
447 } 447 }
448 448
449 /** 449 /**
450 * Pre-linked summary of a library. 450 * Linked summary of a library.
451 */ 451 */
452 abstract class PrelinkedLibrary extends base.SummaryClass { 452 abstract class LinkedLibrary extends base.SummaryClass {
453 factory PrelinkedLibrary.fromBuffer(List<int> buffer) { 453 factory LinkedLibrary.fromBuffer(List<int> buffer) {
454 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer); 454 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer);
455 return const _PrelinkedLibraryReader().read(rootRef); 455 return const _LinkedLibraryReader().read(rootRef);
456 } 456 }
457 457
458 /** 458 /**
459 * The pre-linked summary of all the compilation units constituting the 459 * The linked summary of all the compilation units constituting the
460 * library. The summary of the defining compilation unit is listed first, 460 * library. The summary of the defining compilation unit is listed first,
461 * followed by the summary of each part, in the order of the `part` 461 * followed by the summary of each part, in the order of the `part`
462 * declarations in the defining compilation unit. 462 * declarations in the defining compilation unit.
463 */ 463 */
464 List<PrelinkedUnit> get units; 464 List<LinkedUnit> get units;
465 465
466 /** 466 /**
467 * The libraries that this library depends on (either via an explicit import 467 * The libraries that this library depends on (either via an explicit import
468 * statement or via the implicit dependencies on `dart:core` and 468 * statement or via the implicit dependencies on `dart:core` and
469 * `dart:async`). The first element of this array is a pseudo-dependency 469 * `dart:async`). The first element of this array is a pseudo-dependency
470 * representing the library itself (it is also used for "dynamic"). 470 * representing the library itself (it is also used for "dynamic").
471 * 471 *
472 * TODO(paulberry): consider removing this entirely and just using 472 * TODO(paulberry): consider removing this entirely and just using
473 * [UnlinkedLibrary.imports]. 473 * [UnlinkedLibrary.imports].
474 */ 474 */
475 List<PrelinkedDependency> get dependencies; 475 List<LinkedDependency> get dependencies;
476 476
477 /** 477 /**
478 * For each import in [UnlinkedUnit.imports], an index into [dependencies] 478 * For each import in [UnlinkedUnit.imports], an index into [dependencies]
479 * of the library being imported. 479 * of the library being imported.
480 * 480 *
481 * TODO(paulberry): if [dependencies] is removed, this can be removed as 481 * TODO(paulberry): if [dependencies] is removed, this can be removed as
482 * well, since there will effectively be a one-to-one mapping. 482 * well, since there will effectively be a one-to-one mapping.
483 */ 483 */
484 List<int> get importDependencies; 484 List<int> get importDependencies;
485 485
486 /** 486 /**
487 * Information about entities in the export namespace of the library that are 487 * Information about entities in the export namespace of the library that are
488 * not in the public namespace of the library (that is, entities that are 488 * not in the public namespace of the library (that is, entities that are
489 * brought into the namespace via `export` directives). 489 * brought into the namespace via `export` directives).
490 * 490 *
491 * Sorted by name. 491 * Sorted by name.
492 */ 492 */
493 List<PrelinkedExportName> get exportNames; 493 List<LinkedExportName> get exportNames;
494 } 494 }
495 495
496 class _PrelinkedLibraryReader extends fb.TableReader<_PrelinkedLibraryImpl> { 496 class _LinkedLibraryReader extends fb.TableReader<_LinkedLibraryImpl> {
497 const _PrelinkedLibraryReader(); 497 const _LinkedLibraryReader();
498 498
499 @override 499 @override
500 _PrelinkedLibraryImpl createObject(fb.BufferPointer bp) => new _PrelinkedLibra ryImpl(bp); 500 _LinkedLibraryImpl createObject(fb.BufferPointer bp) => new _LinkedLibraryImpl (bp);
501 } 501 }
502 502
503 class _PrelinkedLibraryImpl extends Object with _PrelinkedLibraryMixin implement s PrelinkedLibrary { 503 class _LinkedLibraryImpl extends Object with _LinkedLibraryMixin implements Link edLibrary {
504 final fb.BufferPointer _bp; 504 final fb.BufferPointer _bp;
505 505
506 _PrelinkedLibraryImpl(this._bp); 506 _LinkedLibraryImpl(this._bp);
507 507
508 List<PrelinkedUnit> _units; 508 List<LinkedUnit> _units;
509 List<PrelinkedDependency> _dependencies; 509 List<LinkedDependency> _dependencies;
510 List<int> _importDependencies; 510 List<int> _importDependencies;
511 List<PrelinkedExportName> _exportNames; 511 List<LinkedExportName> _exportNames;
512 512
513 @override 513 @override
514 List<PrelinkedUnit> get units { 514 List<LinkedUnit> get units {
515 _units ??= const fb.ListReader<PrelinkedUnit>(const _PrelinkedUnitReader()). vTableGet(_bp, 0, const <PrelinkedUnit>[]); 515 _units ??= const fb.ListReader<LinkedUnit>(const _LinkedUnitReader()).vTable Get(_bp, 0, const <LinkedUnit>[]);
516 return _units; 516 return _units;
517 } 517 }
518 518
519 @override 519 @override
520 List<PrelinkedDependency> get dependencies { 520 List<LinkedDependency> get dependencies {
521 _dependencies ??= const fb.ListReader<PrelinkedDependency>(const _PrelinkedD ependencyReader()).vTableGet(_bp, 1, const <PrelinkedDependency>[]); 521 _dependencies ??= const fb.ListReader<LinkedDependency>(const _LinkedDepende ncyReader()).vTableGet(_bp, 1, const <LinkedDependency>[]);
522 return _dependencies; 522 return _dependencies;
523 } 523 }
524 524
525 @override 525 @override
526 List<int> get importDependencies { 526 List<int> get importDependencies {
527 _importDependencies ??= const fb.ListReader<int>(const fb.Int32Reader()).vTa bleGet(_bp, 2, const <int>[]); 527 _importDependencies ??= const fb.ListReader<int>(const fb.Int32Reader()).vTa bleGet(_bp, 2, const <int>[]);
528 return _importDependencies; 528 return _importDependencies;
529 } 529 }
530 530
531 @override 531 @override
532 List<PrelinkedExportName> get exportNames { 532 List<LinkedExportName> get exportNames {
533 _exportNames ??= const fb.ListReader<PrelinkedExportName>(const _PrelinkedEx portNameReader()).vTableGet(_bp, 3, const <PrelinkedExportName>[]); 533 _exportNames ??= const fb.ListReader<LinkedExportName>(const _LinkedExportNa meReader()).vTableGet(_bp, 3, const <LinkedExportName>[]);
534 return _exportNames; 534 return _exportNames;
535 } 535 }
536 } 536 }
537 537
538 abstract class _PrelinkedLibraryMixin implements PrelinkedLibrary { 538 abstract class _LinkedLibraryMixin implements LinkedLibrary {
539 @override 539 @override
540 Map<String, Object> toMap() => { 540 Map<String, Object> toMap() => {
541 "units": units, 541 "units": units,
542 "dependencies": dependencies, 542 "dependencies": dependencies,
543 "importDependencies": importDependencies, 543 "importDependencies": importDependencies,
544 "exportNames": exportNames, 544 "exportNames": exportNames,
545 }; 545 };
546 } 546 }
547 547
548 class PrelinkedReferenceBuilder extends Object with _PrelinkedReferenceMixin imp lements PrelinkedReference { 548 class LinkedReferenceBuilder extends Object with _LinkedReferenceMixin implement s LinkedReference {
549 bool _finished = false; 549 bool _finished = false;
550 550
551 int _dependency; 551 int _dependency;
552 PrelinkedReferenceKind _kind; 552 ReferenceKind _kind;
553 int _unit; 553 int _unit;
554 int _numTypeParameters; 554 int _numTypeParameters;
555 555
556 @override 556 @override
557 int get dependency => _dependency ?? 0; 557 int get dependency => _dependency ?? 0;
558 558
559 /** 559 /**
560 * Index into [PrelinkedLibrary.dependencies] indicating which imported librar y 560 * Index into [LinkedLibrary.dependencies] indicating which imported library
561 * declares the entity being referred to. 561 * declares the entity being referred to.
562 */ 562 */
563 void set dependency(int _value) { 563 void set dependency(int _value) {
564 assert(!_finished); 564 assert(!_finished);
565 _dependency = _value; 565 _dependency = _value;
566 } 566 }
567 567
568 @override 568 @override
569 PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum ; 569 ReferenceKind get kind => _kind ?? ReferenceKind.classOrEnum;
570 570
571 /** 571 /**
572 * The kind of the entity being referred to. For the pseudo-type `dynamic`, 572 * The kind of the entity being referred to. For the pseudo-type `dynamic`,
573 * the kind is [PrelinkedReferenceKind.classOrEnum]. 573 * the kind is [ReferenceKind.classOrEnum].
574 */ 574 */
575 void set kind(PrelinkedReferenceKind _value) { 575 void set kind(ReferenceKind _value) {
576 assert(!_finished); 576 assert(!_finished);
577 _kind = _value; 577 _kind = _value;
578 } 578 }
579 579
580 @override 580 @override
581 int get unit => _unit ?? 0; 581 int get unit => _unit ?? 0;
582 582
583 /** 583 /**
584 * Integer index indicating which unit in the imported library contains the 584 * Integer index indicating which unit in the imported library contains the
585 * definition of the entity. As with indices into [PrelinkedLibrary.units], 585 * definition of the entity. As with indices into [LinkedLibrary.units],
586 * zero represents the defining compilation unit, and nonzero values 586 * zero represents the defining compilation unit, and nonzero values
587 * represent parts in the order of the corresponding `part` declarations. 587 * represent parts in the order of the corresponding `part` declarations.
588 */ 588 */
589 void set unit(int _value) { 589 void set unit(int _value) {
590 assert(!_finished); 590 assert(!_finished);
591 _unit = _value; 591 _unit = _value;
592 } 592 }
593 593
594 @override 594 @override
595 int get numTypeParameters => _numTypeParameters ?? 0; 595 int get numTypeParameters => _numTypeParameters ?? 0;
596 596
597 /** 597 /**
598 * If the entity being referred to is generic, the number of type parameters 598 * If the entity being referred to is generic, the number of type parameters
599 * it accepts. Otherwise zero. 599 * it accepts. Otherwise zero.
600 */ 600 */
601 void set numTypeParameters(int _value) { 601 void set numTypeParameters(int _value) {
602 assert(!_finished); 602 assert(!_finished);
603 _numTypeParameters = _value; 603 _numTypeParameters = _value;
604 } 604 }
605 605
606 PrelinkedReferenceBuilder({int dependency, PrelinkedReferenceKind kind, int un it, int numTypeParameters}) 606 LinkedReferenceBuilder({int dependency, ReferenceKind kind, int unit, int numT ypeParameters})
607 : _dependency = dependency, 607 : _dependency = dependency,
608 _kind = kind, 608 _kind = kind,
609 _unit = unit, 609 _unit = unit,
610 _numTypeParameters = numTypeParameters; 610 _numTypeParameters = numTypeParameters;
611 611
612 fb.Offset finish(fb.Builder fbBuilder) { 612 fb.Offset finish(fb.Builder fbBuilder) {
613 assert(!_finished); 613 assert(!_finished);
614 _finished = true; 614 _finished = true;
615 fbBuilder.startTable(); 615 fbBuilder.startTable();
616 if (_dependency != null && _dependency != 0) { 616 if (_dependency != null && _dependency != 0) {
617 fbBuilder.addInt32(0, _dependency); 617 fbBuilder.addInt32(0, _dependency);
618 } 618 }
619 if (_kind != null && _kind != PrelinkedReferenceKind.classOrEnum) { 619 if (_kind != null && _kind != ReferenceKind.classOrEnum) {
620 fbBuilder.addInt32(1, _kind.index); 620 fbBuilder.addInt32(1, _kind.index);
621 } 621 }
622 if (_unit != null && _unit != 0) { 622 if (_unit != null && _unit != 0) {
623 fbBuilder.addInt32(2, _unit); 623 fbBuilder.addInt32(2, _unit);
624 } 624 }
625 if (_numTypeParameters != null && _numTypeParameters != 0) { 625 if (_numTypeParameters != null && _numTypeParameters != 0) {
626 fbBuilder.addInt32(3, _numTypeParameters); 626 fbBuilder.addInt32(3, _numTypeParameters);
627 } 627 }
628 return fbBuilder.endTable(); 628 return fbBuilder.endTable();
629 } 629 }
630 } 630 }
631 631
632 /** 632 /**
633 * Information about the resolution of an [UnlinkedReference]. 633 * Information about the resolution of an [UnlinkedReference].
634 */ 634 */
635 abstract class PrelinkedReference extends base.SummaryClass { 635 abstract class LinkedReference extends base.SummaryClass {
636 636
637 /** 637 /**
638 * Index into [PrelinkedLibrary.dependencies] indicating which imported librar y 638 * Index into [LinkedLibrary.dependencies] indicating which imported library
639 * declares the entity being referred to. 639 * declares the entity being referred to.
640 */ 640 */
641 int get dependency; 641 int get dependency;
642 642
643 /** 643 /**
644 * The kind of the entity being referred to. For the pseudo-type `dynamic`, 644 * The kind of the entity being referred to. For the pseudo-type `dynamic`,
645 * the kind is [PrelinkedReferenceKind.classOrEnum]. 645 * the kind is [ReferenceKind.classOrEnum].
646 */ 646 */
647 PrelinkedReferenceKind get kind; 647 ReferenceKind get kind;
648 648
649 /** 649 /**
650 * Integer index indicating which unit in the imported library contains the 650 * Integer index indicating which unit in the imported library contains the
651 * definition of the entity. As with indices into [PrelinkedLibrary.units], 651 * definition of the entity. As with indices into [LinkedLibrary.units],
652 * zero represents the defining compilation unit, and nonzero values 652 * zero represents the defining compilation unit, and nonzero values
653 * represent parts in the order of the corresponding `part` declarations. 653 * represent parts in the order of the corresponding `part` declarations.
654 */ 654 */
655 int get unit; 655 int get unit;
656 656
657 /** 657 /**
658 * If the entity being referred to is generic, the number of type parameters 658 * If the entity being referred to is generic, the number of type parameters
659 * it accepts. Otherwise zero. 659 * it accepts. Otherwise zero.
660 */ 660 */
661 int get numTypeParameters; 661 int get numTypeParameters;
662 } 662 }
663 663
664 class _PrelinkedReferenceReader extends fb.TableReader<_PrelinkedReferenceImpl> { 664 class _LinkedReferenceReader extends fb.TableReader<_LinkedReferenceImpl> {
665 const _PrelinkedReferenceReader(); 665 const _LinkedReferenceReader();
666 666
667 @override 667 @override
668 _PrelinkedReferenceImpl createObject(fb.BufferPointer bp) => new _PrelinkedRef erenceImpl(bp); 668 _LinkedReferenceImpl createObject(fb.BufferPointer bp) => new _LinkedReference Impl(bp);
669 } 669 }
670 670
671 class _PrelinkedReferenceImpl extends Object with _PrelinkedReferenceMixin imple ments PrelinkedReference { 671 class _LinkedReferenceImpl extends Object with _LinkedReferenceMixin implements LinkedReference {
672 final fb.BufferPointer _bp; 672 final fb.BufferPointer _bp;
673 673
674 _PrelinkedReferenceImpl(this._bp); 674 _LinkedReferenceImpl(this._bp);
675 675
676 int _dependency; 676 int _dependency;
677 PrelinkedReferenceKind _kind; 677 ReferenceKind _kind;
678 int _unit; 678 int _unit;
679 int _numTypeParameters; 679 int _numTypeParameters;
680 680
681 @override 681 @override
682 int get dependency { 682 int get dependency {
683 _dependency ??= const fb.Int32Reader().vTableGet(_bp, 0, 0); 683 _dependency ??= const fb.Int32Reader().vTableGet(_bp, 0, 0);
684 return _dependency; 684 return _dependency;
685 } 685 }
686 686
687 @override 687 @override
688 PrelinkedReferenceKind get kind { 688 ReferenceKind get kind {
689 _kind ??= PrelinkedReferenceKind.values[const fb.Int32Reader().vTableGet(_bp , 1, 0)]; 689 _kind ??= ReferenceKind.values[const fb.Int32Reader().vTableGet(_bp, 1, 0)];
690 return _kind; 690 return _kind;
691 } 691 }
692 692
693 @override 693 @override
694 int get unit { 694 int get unit {
695 _unit ??= const fb.Int32Reader().vTableGet(_bp, 2, 0); 695 _unit ??= const fb.Int32Reader().vTableGet(_bp, 2, 0);
696 return _unit; 696 return _unit;
697 } 697 }
698 698
699 @override 699 @override
700 int get numTypeParameters { 700 int get numTypeParameters {
701 _numTypeParameters ??= const fb.Int32Reader().vTableGet(_bp, 3, 0); 701 _numTypeParameters ??= const fb.Int32Reader().vTableGet(_bp, 3, 0);
702 return _numTypeParameters; 702 return _numTypeParameters;
703 } 703 }
704 } 704 }
705 705
706 abstract class _PrelinkedReferenceMixin implements PrelinkedReference { 706 abstract class _LinkedReferenceMixin implements LinkedReference {
707 @override 707 @override
708 Map<String, Object> toMap() => { 708 Map<String, Object> toMap() => {
709 "dependency": dependency, 709 "dependency": dependency,
710 "kind": kind, 710 "kind": kind,
711 "unit": unit, 711 "unit": unit,
712 "numTypeParameters": numTypeParameters, 712 "numTypeParameters": numTypeParameters,
713 }; 713 };
714 } 714 }
715 715
716 class PrelinkedUnitBuilder extends Object with _PrelinkedUnitMixin implements Pr elinkedUnit { 716 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements LinkedUn it {
717 bool _finished = false; 717 bool _finished = false;
718 718
719 List<PrelinkedReferenceBuilder> _references; 719 List<LinkedReferenceBuilder> _references;
720 720
721 @override 721 @override
722 List<PrelinkedReference> get references => _references ?? const <PrelinkedRefe rence>[]; 722 List<LinkedReference> get references => _references ?? const <LinkedReference> [];
723 723
724 /** 724 /**
725 * For each reference in [UnlinkedUnit.references], information about how 725 * For each reference in [UnlinkedUnit.references], information about how
726 * that reference is resolved. 726 * that reference is resolved.
727 */ 727 */
728 void set references(List<PrelinkedReferenceBuilder> _value) { 728 void set references(List<LinkedReferenceBuilder> _value) {
729 assert(!_finished); 729 assert(!_finished);
730 _references = _value; 730 _references = _value;
731 } 731 }
732 732
733 PrelinkedUnitBuilder({List<PrelinkedReferenceBuilder> references}) 733 LinkedUnitBuilder({List<LinkedReferenceBuilder> references})
734 : _references = references; 734 : _references = references;
735 735
736 fb.Offset finish(fb.Builder fbBuilder) { 736 fb.Offset finish(fb.Builder fbBuilder) {
737 assert(!_finished); 737 assert(!_finished);
738 _finished = true; 738 _finished = true;
739 fb.Offset offset_references; 739 fb.Offset offset_references;
740 if (!(_references == null || _references.isEmpty)) { 740 if (!(_references == null || _references.isEmpty)) {
741 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb Builder)).toList()); 741 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb Builder)).toList());
742 } 742 }
743 fbBuilder.startTable(); 743 fbBuilder.startTable();
744 if (offset_references != null) { 744 if (offset_references != null) {
745 fbBuilder.addOffset(0, offset_references); 745 fbBuilder.addOffset(0, offset_references);
746 } 746 }
747 return fbBuilder.endTable(); 747 return fbBuilder.endTable();
748 } 748 }
749 } 749 }
750 750
751 /** 751 /**
752 * Pre-linked summary of a compilation unit. 752 * Linked summary of a compilation unit.
753 */ 753 */
754 abstract class PrelinkedUnit extends base.SummaryClass { 754 abstract class LinkedUnit extends base.SummaryClass {
755 755
756 /** 756 /**
757 * For each reference in [UnlinkedUnit.references], information about how 757 * For each reference in [UnlinkedUnit.references], information about how
758 * that reference is resolved. 758 * that reference is resolved.
759 */ 759 */
760 List<PrelinkedReference> get references; 760 List<LinkedReference> get references;
761 } 761 }
762 762
763 class _PrelinkedUnitReader extends fb.TableReader<_PrelinkedUnitImpl> { 763 class _LinkedUnitReader extends fb.TableReader<_LinkedUnitImpl> {
764 const _PrelinkedUnitReader(); 764 const _LinkedUnitReader();
765 765
766 @override 766 @override
767 _PrelinkedUnitImpl createObject(fb.BufferPointer bp) => new _PrelinkedUnitImpl (bp); 767 _LinkedUnitImpl createObject(fb.BufferPointer bp) => new _LinkedUnitImpl(bp);
768 } 768 }
769 769
770 class _PrelinkedUnitImpl extends Object with _PrelinkedUnitMixin implements Prel inkedUnit { 770 class _LinkedUnitImpl extends Object with _LinkedUnitMixin implements LinkedUnit {
771 final fb.BufferPointer _bp; 771 final fb.BufferPointer _bp;
772 772
773 _PrelinkedUnitImpl(this._bp); 773 _LinkedUnitImpl(this._bp);
774 774
775 List<PrelinkedReference> _references; 775 List<LinkedReference> _references;
776 776
777 @override 777 @override
778 List<PrelinkedReference> get references { 778 List<LinkedReference> get references {
779 _references ??= const fb.ListReader<PrelinkedReference>(const _PrelinkedRefe renceReader()).vTableGet(_bp, 0, const <PrelinkedReference>[]); 779 _references ??= const fb.ListReader<LinkedReference>(const _LinkedReferenceR eader()).vTableGet(_bp, 0, const <LinkedReference>[]);
780 return _references; 780 return _references;
781 } 781 }
782 } 782 }
783 783
784 abstract class _PrelinkedUnitMixin implements PrelinkedUnit { 784 abstract class _LinkedUnitMixin implements LinkedUnit {
785 @override 785 @override
786 Map<String, Object> toMap() => { 786 Map<String, Object> toMap() => {
787 "references": references, 787 "references": references,
788 }; 788 };
789 } 789 }
790 790
791 class SdkBundleBuilder extends Object with _SdkBundleMixin implements SdkBundle { 791 class SdkBundleBuilder extends Object with _SdkBundleMixin implements SdkBundle {
792 bool _finished = false; 792 bool _finished = false;
793 793
794 List<String> _prelinkedLibraryUris; 794 List<String> _linkedLibraryUris;
795 List<PrelinkedLibraryBuilder> _prelinkedLibraries; 795 List<LinkedLibraryBuilder> _linkedLibraries;
796 List<String> _unlinkedUnitUris; 796 List<String> _unlinkedUnitUris;
797 List<UnlinkedUnitBuilder> _unlinkedUnits; 797 List<UnlinkedUnitBuilder> _unlinkedUnits;
798 798
799 @override 799 @override
800 List<String> get prelinkedLibraryUris => _prelinkedLibraryUris ?? const <Strin g>[]; 800 List<String> get linkedLibraryUris => _linkedLibraryUris ?? const <String>[];
801 801
802 /** 802 /**
803 * The list of URIs of items in [prelinkedLibraries], e.g. `dart:core`. 803 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`.
804 */ 804 */
805 void set prelinkedLibraryUris(List<String> _value) { 805 void set linkedLibraryUris(List<String> _value) {
806 assert(!_finished); 806 assert(!_finished);
807 _prelinkedLibraryUris = _value; 807 _linkedLibraryUris = _value;
808 } 808 }
809 809
810 @override 810 @override
811 List<PrelinkedLibrary> get prelinkedLibraries => _prelinkedLibraries ?? const <PrelinkedLibrary>[]; 811 List<LinkedLibrary> get linkedLibraries => _linkedLibraries ?? const <LinkedLi brary>[];
812 812
813 /** 813 /**
814 * Pre-linked libraries. 814 * Linked libraries.
815 */ 815 */
816 void set prelinkedLibraries(List<PrelinkedLibraryBuilder> _value) { 816 void set linkedLibraries(List<LinkedLibraryBuilder> _value) {
817 assert(!_finished); 817 assert(!_finished);
818 _prelinkedLibraries = _value; 818 _linkedLibraries = _value;
819 } 819 }
820 820
821 @override 821 @override
822 List<String> get unlinkedUnitUris => _unlinkedUnitUris ?? const <String>[]; 822 List<String> get unlinkedUnitUris => _unlinkedUnitUris ?? const <String>[];
823 823
824 /** 824 /**
825 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. 825 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`.
826 */ 826 */
827 void set unlinkedUnitUris(List<String> _value) { 827 void set unlinkedUnitUris(List<String> _value) {
828 assert(!_finished); 828 assert(!_finished);
829 _unlinkedUnitUris = _value; 829 _unlinkedUnitUris = _value;
830 } 830 }
831 831
832 @override 832 @override
833 List<UnlinkedUnit> get unlinkedUnits => _unlinkedUnits ?? const <UnlinkedUnit> []; 833 List<UnlinkedUnit> get unlinkedUnits => _unlinkedUnits ?? const <UnlinkedUnit> [];
834 834
835 /** 835 /**
836 * Unlinked information for the compilation units constituting the SDK. 836 * Unlinked information for the compilation units constituting the SDK.
837 */ 837 */
838 void set unlinkedUnits(List<UnlinkedUnitBuilder> _value) { 838 void set unlinkedUnits(List<UnlinkedUnitBuilder> _value) {
839 assert(!_finished); 839 assert(!_finished);
840 _unlinkedUnits = _value; 840 _unlinkedUnits = _value;
841 } 841 }
842 842
843 SdkBundleBuilder({List<String> prelinkedLibraryUris, List<PrelinkedLibraryBuil der> prelinkedLibraries, List<String> unlinkedUnitUris, List<UnlinkedUnitBuilder > unlinkedUnits}) 843 SdkBundleBuilder({List<String> linkedLibraryUris, List<LinkedLibraryBuilder> l inkedLibraries, List<String> unlinkedUnitUris, List<UnlinkedUnitBuilder> unlinke dUnits})
844 : _prelinkedLibraryUris = prelinkedLibraryUris, 844 : _linkedLibraryUris = linkedLibraryUris,
845 _prelinkedLibraries = prelinkedLibraries, 845 _linkedLibraries = linkedLibraries,
846 _unlinkedUnitUris = unlinkedUnitUris, 846 _unlinkedUnitUris = unlinkedUnitUris,
847 _unlinkedUnits = unlinkedUnits; 847 _unlinkedUnits = unlinkedUnits;
848 848
849 List<int> toBuffer() { 849 List<int> toBuffer() {
850 fb.Builder fbBuilder = new fb.Builder(); 850 fb.Builder fbBuilder = new fb.Builder();
851 return fbBuilder.finish(finish(fbBuilder)); 851 return fbBuilder.finish(finish(fbBuilder));
852 } 852 }
853 853
854 fb.Offset finish(fb.Builder fbBuilder) { 854 fb.Offset finish(fb.Builder fbBuilder) {
855 assert(!_finished); 855 assert(!_finished);
856 _finished = true; 856 _finished = true;
857 fb.Offset offset_prelinkedLibraryUris; 857 fb.Offset offset_linkedLibraryUris;
858 fb.Offset offset_prelinkedLibraries; 858 fb.Offset offset_linkedLibraries;
859 fb.Offset offset_unlinkedUnitUris; 859 fb.Offset offset_unlinkedUnitUris;
860 fb.Offset offset_unlinkedUnits; 860 fb.Offset offset_unlinkedUnits;
861 if (!(_prelinkedLibraryUris == null || _prelinkedLibraryUris.isEmpty)) { 861 if (!(_linkedLibraryUris == null || _linkedLibraryUris.isEmpty)) {
862 offset_prelinkedLibraryUris = fbBuilder.writeList(_prelinkedLibraryUris.ma p((b) => fbBuilder.writeString(b)).toList()); 862 offset_linkedLibraryUris = fbBuilder.writeList(_linkedLibraryUris.map((b) => fbBuilder.writeString(b)).toList());
863 } 863 }
864 if (!(_prelinkedLibraries == null || _prelinkedLibraries.isEmpty)) { 864 if (!(_linkedLibraries == null || _linkedLibraries.isEmpty)) {
865 offset_prelinkedLibraries = fbBuilder.writeList(_prelinkedLibraries.map((b ) => b.finish(fbBuilder)).toList()); 865 offset_linkedLibraries = fbBuilder.writeList(_linkedLibraries.map((b) => b .finish(fbBuilder)).toList());
866 } 866 }
867 if (!(_unlinkedUnitUris == null || _unlinkedUnitUris.isEmpty)) { 867 if (!(_unlinkedUnitUris == null || _unlinkedUnitUris.isEmpty)) {
868 offset_unlinkedUnitUris = fbBuilder.writeList(_unlinkedUnitUris.map((b) => fbBuilder.writeString(b)).toList()); 868 offset_unlinkedUnitUris = fbBuilder.writeList(_unlinkedUnitUris.map((b) => fbBuilder.writeString(b)).toList());
869 } 869 }
870 if (!(_unlinkedUnits == null || _unlinkedUnits.isEmpty)) { 870 if (!(_unlinkedUnits == null || _unlinkedUnits.isEmpty)) {
871 offset_unlinkedUnits = fbBuilder.writeList(_unlinkedUnits.map((b) => b.fin ish(fbBuilder)).toList()); 871 offset_unlinkedUnits = fbBuilder.writeList(_unlinkedUnits.map((b) => b.fin ish(fbBuilder)).toList());
872 } 872 }
873 fbBuilder.startTable(); 873 fbBuilder.startTable();
874 if (offset_prelinkedLibraryUris != null) { 874 if (offset_linkedLibraryUris != null) {
875 fbBuilder.addOffset(0, offset_prelinkedLibraryUris); 875 fbBuilder.addOffset(0, offset_linkedLibraryUris);
876 } 876 }
877 if (offset_prelinkedLibraries != null) { 877 if (offset_linkedLibraries != null) {
878 fbBuilder.addOffset(1, offset_prelinkedLibraries); 878 fbBuilder.addOffset(1, offset_linkedLibraries);
879 } 879 }
880 if (offset_unlinkedUnitUris != null) { 880 if (offset_unlinkedUnitUris != null) {
881 fbBuilder.addOffset(2, offset_unlinkedUnitUris); 881 fbBuilder.addOffset(2, offset_unlinkedUnitUris);
882 } 882 }
883 if (offset_unlinkedUnits != null) { 883 if (offset_unlinkedUnits != null) {
884 fbBuilder.addOffset(3, offset_unlinkedUnits); 884 fbBuilder.addOffset(3, offset_unlinkedUnits);
885 } 885 }
886 return fbBuilder.endTable(); 886 return fbBuilder.endTable();
887 } 887 }
888 } 888 }
889 889
890 /** 890 /**
891 * Information about SDK. 891 * Information about SDK.
892 */ 892 */
893 abstract class SdkBundle extends base.SummaryClass { 893 abstract class SdkBundle extends base.SummaryClass {
894 factory SdkBundle.fromBuffer(List<int> buffer) { 894 factory SdkBundle.fromBuffer(List<int> buffer) {
895 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer); 895 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer);
896 return const _SdkBundleReader().read(rootRef); 896 return const _SdkBundleReader().read(rootRef);
897 } 897 }
898 898
899 /** 899 /**
900 * The list of URIs of items in [prelinkedLibraries], e.g. `dart:core`. 900 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`.
901 */ 901 */
902 List<String> get prelinkedLibraryUris; 902 List<String> get linkedLibraryUris;
903 903
904 /** 904 /**
905 * Pre-linked libraries. 905 * Linked libraries.
906 */ 906 */
907 List<PrelinkedLibrary> get prelinkedLibraries; 907 List<LinkedLibrary> get linkedLibraries;
908 908
909 /** 909 /**
910 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. 910 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`.
911 */ 911 */
912 List<String> get unlinkedUnitUris; 912 List<String> get unlinkedUnitUris;
913 913
914 /** 914 /**
915 * Unlinked information for the compilation units constituting the SDK. 915 * Unlinked information for the compilation units constituting the SDK.
916 */ 916 */
917 List<UnlinkedUnit> get unlinkedUnits; 917 List<UnlinkedUnit> get unlinkedUnits;
918 } 918 }
919 919
920 class _SdkBundleReader extends fb.TableReader<_SdkBundleImpl> { 920 class _SdkBundleReader extends fb.TableReader<_SdkBundleImpl> {
921 const _SdkBundleReader(); 921 const _SdkBundleReader();
922 922
923 @override 923 @override
924 _SdkBundleImpl createObject(fb.BufferPointer bp) => new _SdkBundleImpl(bp); 924 _SdkBundleImpl createObject(fb.BufferPointer bp) => new _SdkBundleImpl(bp);
925 } 925 }
926 926
927 class _SdkBundleImpl extends Object with _SdkBundleMixin implements SdkBundle { 927 class _SdkBundleImpl extends Object with _SdkBundleMixin implements SdkBundle {
928 final fb.BufferPointer _bp; 928 final fb.BufferPointer _bp;
929 929
930 _SdkBundleImpl(this._bp); 930 _SdkBundleImpl(this._bp);
931 931
932 List<String> _prelinkedLibraryUris; 932 List<String> _linkedLibraryUris;
933 List<PrelinkedLibrary> _prelinkedLibraries; 933 List<LinkedLibrary> _linkedLibraries;
934 List<String> _unlinkedUnitUris; 934 List<String> _unlinkedUnitUris;
935 List<UnlinkedUnit> _unlinkedUnits; 935 List<UnlinkedUnit> _unlinkedUnits;
936 936
937 @override 937 @override
938 List<String> get prelinkedLibraryUris { 938 List<String> get linkedLibraryUris {
939 _prelinkedLibraryUris ??= const fb.ListReader<String>(const fb.StringReader( )).vTableGet(_bp, 0, const <String>[]); 939 _linkedLibraryUris ??= const fb.ListReader<String>(const fb.StringReader()). vTableGet(_bp, 0, const <String>[]);
940 return _prelinkedLibraryUris; 940 return _linkedLibraryUris;
941 } 941 }
942 942
943 @override 943 @override
944 List<PrelinkedLibrary> get prelinkedLibraries { 944 List<LinkedLibrary> get linkedLibraries {
945 _prelinkedLibraries ??= const fb.ListReader<PrelinkedLibrary>(const _Prelink edLibraryReader()).vTableGet(_bp, 1, const <PrelinkedLibrary>[]); 945 _linkedLibraries ??= const fb.ListReader<LinkedLibrary>(const _LinkedLibrary Reader()).vTableGet(_bp, 1, const <LinkedLibrary>[]);
946 return _prelinkedLibraries; 946 return _linkedLibraries;
947 } 947 }
948 948
949 @override 949 @override
950 List<String> get unlinkedUnitUris { 950 List<String> get unlinkedUnitUris {
951 _unlinkedUnitUris ??= const fb.ListReader<String>(const fb.StringReader()).v TableGet(_bp, 2, const <String>[]); 951 _unlinkedUnitUris ??= const fb.ListReader<String>(const fb.StringReader()).v TableGet(_bp, 2, const <String>[]);
952 return _unlinkedUnitUris; 952 return _unlinkedUnitUris;
953 } 953 }
954 954
955 @override 955 @override
956 List<UnlinkedUnit> get unlinkedUnits { 956 List<UnlinkedUnit> get unlinkedUnits {
957 _unlinkedUnits ??= const fb.ListReader<UnlinkedUnit>(const _UnlinkedUnitRead er()).vTableGet(_bp, 3, const <UnlinkedUnit>[]); 957 _unlinkedUnits ??= const fb.ListReader<UnlinkedUnit>(const _UnlinkedUnitRead er()).vTableGet(_bp, 3, const <UnlinkedUnit>[]);
958 return _unlinkedUnits; 958 return _unlinkedUnits;
959 } 959 }
960 } 960 }
961 961
962 abstract class _SdkBundleMixin implements SdkBundle { 962 abstract class _SdkBundleMixin implements SdkBundle {
963 @override 963 @override
964 Map<String, Object> toMap() => { 964 Map<String, Object> toMap() => {
965 "prelinkedLibraryUris": prelinkedLibraryUris, 965 "linkedLibraryUris": linkedLibraryUris,
966 "prelinkedLibraries": prelinkedLibraries, 966 "linkedLibraries": linkedLibraries,
967 "unlinkedUnitUris": unlinkedUnitUris, 967 "unlinkedUnitUris": unlinkedUnitUris,
968 "unlinkedUnits": unlinkedUnits, 968 "unlinkedUnits": unlinkedUnits,
969 }; 969 };
970 } 970 }
971 971
972 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements Un linkedClass { 972 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements Un linkedClass {
973 bool _finished = false; 973 bool _finished = false;
974 974
975 String _name; 975 String _name;
976 int _nameOffset; 976 int _nameOffset;
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after
3380 Map<String, Object> toMap() => { 3380 Map<String, Object> toMap() => {
3381 "uriOffset": uriOffset, 3381 "uriOffset": uriOffset,
3382 "uriEnd": uriEnd, 3382 "uriEnd": uriEnd,
3383 }; 3383 };
3384 } 3384 }
3385 3385
3386 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp lements UnlinkedPublicName { 3386 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp lements UnlinkedPublicName {
3387 bool _finished = false; 3387 bool _finished = false;
3388 3388
3389 String _name; 3389 String _name;
3390 PrelinkedReferenceKind _kind; 3390 ReferenceKind _kind;
3391 int _numTypeParameters; 3391 int _numTypeParameters;
3392 3392
3393 @override 3393 @override
3394 String get name => _name ?? ''; 3394 String get name => _name ?? '';
3395 3395
3396 /** 3396 /**
3397 * The name itself. 3397 * The name itself.
3398 */ 3398 */
3399 void set name(String _value) { 3399 void set name(String _value) {
3400 assert(!_finished); 3400 assert(!_finished);
3401 _name = _value; 3401 _name = _value;
3402 } 3402 }
3403 3403
3404 @override 3404 @override
3405 PrelinkedReferenceKind get kind => _kind ?? PrelinkedReferenceKind.classOrEnum ; 3405 ReferenceKind get kind => _kind ?? ReferenceKind.classOrEnum;
3406 3406
3407 /** 3407 /**
3408 * The kind of object referred to by the name. 3408 * The kind of object referred to by the name.
3409 */ 3409 */
3410 void set kind(PrelinkedReferenceKind _value) { 3410 void set kind(ReferenceKind _value) {
3411 assert(!_finished); 3411 assert(!_finished);
3412 _kind = _value; 3412 _kind = _value;
3413 } 3413 }
3414 3414
3415 @override 3415 @override
3416 int get numTypeParameters => _numTypeParameters ?? 0; 3416 int get numTypeParameters => _numTypeParameters ?? 0;
3417 3417
3418 /** 3418 /**
3419 * If the entity being referred to is generic, the number of type parameters 3419 * If the entity being referred to is generic, the number of type parameters
3420 * it accepts. Otherwise zero. 3420 * it accepts. Otherwise zero.
3421 */ 3421 */
3422 void set numTypeParameters(int _value) { 3422 void set numTypeParameters(int _value) {
3423 assert(!_finished); 3423 assert(!_finished);
3424 _numTypeParameters = _value; 3424 _numTypeParameters = _value;
3425 } 3425 }
3426 3426
3427 UnlinkedPublicNameBuilder({String name, PrelinkedReferenceKind kind, int numTy peParameters}) 3427 UnlinkedPublicNameBuilder({String name, ReferenceKind kind, int numTypeParamet ers})
3428 : _name = name, 3428 : _name = name,
3429 _kind = kind, 3429 _kind = kind,
3430 _numTypeParameters = numTypeParameters; 3430 _numTypeParameters = numTypeParameters;
3431 3431
3432 fb.Offset finish(fb.Builder fbBuilder) { 3432 fb.Offset finish(fb.Builder fbBuilder) {
3433 assert(!_finished); 3433 assert(!_finished);
3434 _finished = true; 3434 _finished = true;
3435 fb.Offset offset_name; 3435 fb.Offset offset_name;
3436 if (_name != null) { 3436 if (_name != null) {
3437 offset_name = fbBuilder.writeString(_name); 3437 offset_name = fbBuilder.writeString(_name);
3438 } 3438 }
3439 fbBuilder.startTable(); 3439 fbBuilder.startTable();
3440 if (offset_name != null) { 3440 if (offset_name != null) {
3441 fbBuilder.addOffset(0, offset_name); 3441 fbBuilder.addOffset(0, offset_name);
3442 } 3442 }
3443 if (_kind != null && _kind != PrelinkedReferenceKind.classOrEnum) { 3443 if (_kind != null && _kind != ReferenceKind.classOrEnum) {
3444 fbBuilder.addInt32(1, _kind.index); 3444 fbBuilder.addInt32(1, _kind.index);
3445 } 3445 }
3446 if (_numTypeParameters != null && _numTypeParameters != 0) { 3446 if (_numTypeParameters != null && _numTypeParameters != 0) {
3447 fbBuilder.addInt32(2, _numTypeParameters); 3447 fbBuilder.addInt32(2, _numTypeParameters);
3448 } 3448 }
3449 return fbBuilder.endTable(); 3449 return fbBuilder.endTable();
3450 } 3450 }
3451 } 3451 }
3452 3452
3453 /** 3453 /**
(...skipping 13 matching lines...) Expand all
3467 abstract class UnlinkedPublicName extends base.SummaryClass { 3467 abstract class UnlinkedPublicName extends base.SummaryClass {
3468 3468
3469 /** 3469 /**
3470 * The name itself. 3470 * The name itself.
3471 */ 3471 */
3472 String get name; 3472 String get name;
3473 3473
3474 /** 3474 /**
3475 * The kind of object referred to by the name. 3475 * The kind of object referred to by the name.
3476 */ 3476 */
3477 PrelinkedReferenceKind get kind; 3477 ReferenceKind get kind;
3478 3478
3479 /** 3479 /**
3480 * If the entity being referred to is generic, the number of type parameters 3480 * If the entity being referred to is generic, the number of type parameters
3481 * it accepts. Otherwise zero. 3481 * it accepts. Otherwise zero.
3482 */ 3482 */
3483 int get numTypeParameters; 3483 int get numTypeParameters;
3484 } 3484 }
3485 3485
3486 class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl> { 3486 class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl> {
3487 const _UnlinkedPublicNameReader(); 3487 const _UnlinkedPublicNameReader();
3488 3488
3489 @override 3489 @override
3490 _UnlinkedPublicNameImpl createObject(fb.BufferPointer bp) => new _UnlinkedPubl icNameImpl(bp); 3490 _UnlinkedPublicNameImpl createObject(fb.BufferPointer bp) => new _UnlinkedPubl icNameImpl(bp);
3491 } 3491 }
3492 3492
3493 class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple ments UnlinkedPublicName { 3493 class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple ments UnlinkedPublicName {
3494 final fb.BufferPointer _bp; 3494 final fb.BufferPointer _bp;
3495 3495
3496 _UnlinkedPublicNameImpl(this._bp); 3496 _UnlinkedPublicNameImpl(this._bp);
3497 3497
3498 String _name; 3498 String _name;
3499 PrelinkedReferenceKind _kind; 3499 ReferenceKind _kind;
3500 int _numTypeParameters; 3500 int _numTypeParameters;
3501 3501
3502 @override 3502 @override
3503 String get name { 3503 String get name {
3504 _name ??= const fb.StringReader().vTableGet(_bp, 0, ''); 3504 _name ??= const fb.StringReader().vTableGet(_bp, 0, '');
3505 return _name; 3505 return _name;
3506 } 3506 }
3507 3507
3508 @override 3508 @override
3509 PrelinkedReferenceKind get kind { 3509 ReferenceKind get kind {
3510 _kind ??= PrelinkedReferenceKind.values[const fb.Int32Reader().vTableGet(_bp , 1, 0)]; 3510 _kind ??= ReferenceKind.values[const fb.Int32Reader().vTableGet(_bp, 1, 0)];
3511 return _kind; 3511 return _kind;
3512 } 3512 }
3513 3513
3514 @override 3514 @override
3515 int get numTypeParameters { 3515 int get numTypeParameters {
3516 _numTypeParameters ??= const fb.Int32Reader().vTableGet(_bp, 2, 0); 3516 _numTypeParameters ??= const fb.Int32Reader().vTableGet(_bp, 2, 0);
3517 return _numTypeParameters; 3517 return _numTypeParameters;
3518 } 3518 }
3519 } 3519 }
3520 3520
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
5155 "nameOffset": nameOffset, 5155 "nameOffset": nameOffset,
5156 "documentationComment": documentationComment, 5156 "documentationComment": documentationComment,
5157 "type": type, 5157 "type": type,
5158 "isStatic": isStatic, 5158 "isStatic": isStatic,
5159 "isFinal": isFinal, 5159 "isFinal": isFinal,
5160 "isConst": isConst, 5160 "isConst": isConst,
5161 "hasImplicitType": hasImplicitType, 5161 "hasImplicitType": hasImplicitType,
5162 }; 5162 };
5163 } 5163 }
5164 5164
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/prelink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698