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

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

Issue 1530303005: Separate prelinked and unlinked parts of summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/resynthesize.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 'dart:convert'; 10 import 'dart:convert';
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 PrelinkedReferenceBuilder encodePrelinkedReference(builder.BuilderContext builde rContext, {int dependency, PrelinkedReferenceKind kind, int unit}) { 189 PrelinkedReferenceBuilder encodePrelinkedReference(builder.BuilderContext builde rContext, {int dependency, PrelinkedReferenceKind kind, int unit}) {
190 PrelinkedReferenceBuilder builder = new PrelinkedReferenceBuilder(builderConte xt); 190 PrelinkedReferenceBuilder builder = new PrelinkedReferenceBuilder(builderConte xt);
191 builder.dependency = dependency; 191 builder.dependency = dependency;
192 builder.kind = kind; 192 builder.kind = kind;
193 builder.unit = unit; 193 builder.unit = unit;
194 return builder; 194 return builder;
195 } 195 }
196 196
197 class PrelinkedUnit { 197 class PrelinkedUnit {
198 UnlinkedUnit _unlinked;
199 List<PrelinkedReference> _references; 198 List<PrelinkedReference> _references;
200 199
201 PrelinkedUnit.fromJson(Map json) 200 PrelinkedUnit.fromJson(Map json)
202 : _unlinked = json["unlinked"] == null ? null : new UnlinkedUnit.fromJson(js on["unlinked"]), 201 : _references = json["references"]?.map((x) => new PrelinkedReference.fromJs on(x))?.toList();
203 _references = json["references"]?.map((x) => new PrelinkedReference.fromJs on(x))?.toList();
204 202
205 UnlinkedUnit get unlinked => _unlinked;
206 List<PrelinkedReference> get references => _references ?? const <PrelinkedRefe rence>[]; 203 List<PrelinkedReference> get references => _references ?? const <PrelinkedRefe rence>[];
207 } 204 }
208 205
209 class PrelinkedUnitBuilder { 206 class PrelinkedUnitBuilder {
210 final Map _json = {}; 207 final Map _json = {};
211 208
212 bool _finished = false; 209 bool _finished = false;
213 210
214 PrelinkedUnitBuilder(builder.BuilderContext context); 211 PrelinkedUnitBuilder(builder.BuilderContext context);
215 212
216 void set unlinked(UnlinkedUnitBuilder _value) {
217 assert(!_finished);
218 assert(!_json.containsKey("unlinked"));
219 if (_value != null) {
220 _json["unlinked"] = _value.finish();
221 }
222 }
223
224 void set references(List<PrelinkedReferenceBuilder> _value) { 213 void set references(List<PrelinkedReferenceBuilder> _value) {
225 assert(!_finished); 214 assert(!_finished);
226 assert(!_json.containsKey("references")); 215 assert(!_json.containsKey("references"));
227 if (_value != null || _value.isEmpty) { 216 if (_value != null || _value.isEmpty) {
228 _json["references"] = _value.map((b) => b.finish()).toList(); 217 _json["references"] = _value.map((b) => b.finish()).toList();
229 } 218 }
230 } 219 }
231 220
232 Map finish() { 221 Map finish() {
233 assert(!_finished); 222 assert(!_finished);
234 _finished = true; 223 _finished = true;
235 return _json; 224 return _json;
236 } 225 }
237 } 226 }
238 227
239 PrelinkedUnitBuilder encodePrelinkedUnit(builder.BuilderContext builderContext, {UnlinkedUnitBuilder unlinked, List<PrelinkedReferenceBuilder> references}) { 228 PrelinkedUnitBuilder encodePrelinkedUnit(builder.BuilderContext builderContext, {List<PrelinkedReferenceBuilder> references}) {
240 PrelinkedUnitBuilder builder = new PrelinkedUnitBuilder(builderContext); 229 PrelinkedUnitBuilder builder = new PrelinkedUnitBuilder(builderContext);
241 builder.unlinked = unlinked;
242 builder.references = references; 230 builder.references = references;
243 return builder; 231 return builder;
244 } 232 }
245 233
246 class UnlinkedClass { 234 class UnlinkedClass {
247 String _name; 235 String _name;
248 List<UnlinkedTypeParam> _typeParameters; 236 List<UnlinkedTypeParam> _typeParameters;
249 UnlinkedTypeRef _supertype; 237 UnlinkedTypeRef _supertype;
250 List<UnlinkedTypeRef> _mixins; 238 List<UnlinkedTypeRef> _mixins;
251 List<UnlinkedTypeRef> _interfaces; 239 List<UnlinkedTypeRef> _interfaces;
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 _references = json["references"]?.map((x) => new UnlinkedReference.fromJso n(x))?.toList(), 1246 _references = json["references"]?.map((x) => new UnlinkedReference.fromJso n(x))?.toList(),
1259 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL ist(), 1247 _classes = json["classes"]?.map((x) => new UnlinkedClass.fromJson(x))?.toL ist(),
1260 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList() , 1248 _enums = json["enums"]?.map((x) => new UnlinkedEnum.fromJson(x))?.toList() ,
1261 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from Json(x))?.toList(), 1249 _executables = json["executables"]?.map((x) => new UnlinkedExecutable.from Json(x))?.toList(),
1262 _exports = json["exports"]?.map((x) => new UnlinkedExport.fromJson(x))?.to List(), 1250 _exports = json["exports"]?.map((x) => new UnlinkedExport.fromJson(x))?.to List(),
1263 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to List(), 1251 _imports = json["imports"]?.map((x) => new UnlinkedImport.fromJson(x))?.to List(),
1264 _parts = json["parts"]?.map((x) => new UnlinkedPart.fromJson(x))?.toList() , 1252 _parts = json["parts"]?.map((x) => new UnlinkedPart.fromJson(x))?.toList() ,
1265 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))? .toList(), 1253 _typedefs = json["typedefs"]?.map((x) => new UnlinkedTypedef.fromJson(x))? .toList(),
1266 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x ))?.toList(); 1254 _variables = json["variables"]?.map((x) => new UnlinkedVariable.fromJson(x ))?.toList();
1267 1255
1256 UnlinkedUnit.fromBuffer(List<int> buffer) : this.fromJson(JSON.decode(UTF8.dec ode(buffer)));
1257
1268 String get libraryName => _libraryName ?? ''; 1258 String get libraryName => _libraryName ?? '';
1269 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere nce>[]; 1259 List<UnlinkedReference> get references => _references ?? const <UnlinkedRefere nce>[];
1270 List<UnlinkedClass> get classes => _classes ?? const <UnlinkedClass>[]; 1260 List<UnlinkedClass> get classes => _classes ?? const <UnlinkedClass>[];
1271 List<UnlinkedEnum> get enums => _enums ?? const <UnlinkedEnum>[]; 1261 List<UnlinkedEnum> get enums => _enums ?? const <UnlinkedEnum>[];
1272 List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExe cutable>[]; 1262 List<UnlinkedExecutable> get executables => _executables ?? const <UnlinkedExe cutable>[];
1273 List<UnlinkedExport> get exports => _exports ?? const <UnlinkedExport>[]; 1263 List<UnlinkedExport> get exports => _exports ?? const <UnlinkedExport>[];
1274 List<UnlinkedImport> get imports => _imports ?? const <UnlinkedImport>[]; 1264 List<UnlinkedImport> get imports => _imports ?? const <UnlinkedImport>[];
1275 List<UnlinkedPart> get parts => _parts ?? const <UnlinkedPart>[]; 1265 List<UnlinkedPart> get parts => _parts ?? const <UnlinkedPart>[];
1276 List<UnlinkedTypedef> get typedefs => _typedefs ?? const <UnlinkedTypedef>[]; 1266 List<UnlinkedTypedef> get typedefs => _typedefs ?? const <UnlinkedTypedef>[];
1277 List<UnlinkedVariable> get variables => _variables ?? const <UnlinkedVariable> []; 1267 List<UnlinkedVariable> get variables => _variables ?? const <UnlinkedVariable> [];
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 } 1347 }
1358 1348
1359 void set variables(List<UnlinkedVariableBuilder> _value) { 1349 void set variables(List<UnlinkedVariableBuilder> _value) {
1360 assert(!_finished); 1350 assert(!_finished);
1361 assert(!_json.containsKey("variables")); 1351 assert(!_json.containsKey("variables"));
1362 if (_value != null || _value.isEmpty) { 1352 if (_value != null || _value.isEmpty) {
1363 _json["variables"] = _value.map((b) => b.finish()).toList(); 1353 _json["variables"] = _value.map((b) => b.finish()).toList();
1364 } 1354 }
1365 } 1355 }
1366 1356
1357 List<int> toBuffer() => UTF8.encode(JSON.encode(finish()));
1358
1367 Map finish() { 1359 Map finish() {
1368 assert(!_finished); 1360 assert(!_finished);
1369 _finished = true; 1361 _finished = true;
1370 return _json; 1362 return _json;
1371 } 1363 }
1372 } 1364 }
1373 1365
1374 UnlinkedUnitBuilder encodeUnlinkedUnit(builder.BuilderContext builderContext, {S tring libraryName, List<UnlinkedReferenceBuilder> references, List<UnlinkedClass Builder> classes, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilde r> executables, List<UnlinkedExportBuilder> exports, List<UnlinkedImportBuilder> imports, List<UnlinkedPartBuilder> parts, List<UnlinkedTypedefBuilder> typedefs , List<UnlinkedVariableBuilder> variables}) { 1366 UnlinkedUnitBuilder encodeUnlinkedUnit(builder.BuilderContext builderContext, {S tring libraryName, List<UnlinkedReferenceBuilder> references, List<UnlinkedClass Builder> classes, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilde r> executables, List<UnlinkedExportBuilder> exports, List<UnlinkedImportBuilder> imports, List<UnlinkedPartBuilder> parts, List<UnlinkedTypedefBuilder> typedefs , List<UnlinkedVariableBuilder> variables}) {
1375 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext); 1367 UnlinkedUnitBuilder builder = new UnlinkedUnitBuilder(builderContext);
1376 builder.libraryName = libraryName; 1368 builder.libraryName = libraryName;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext); 1468 UnlinkedVariableBuilder builder = new UnlinkedVariableBuilder(builderContext);
1477 builder.name = name; 1469 builder.name = name;
1478 builder.type = type; 1470 builder.type = type;
1479 builder.isStatic = isStatic; 1471 builder.isStatic = isStatic;
1480 builder.isFinal = isFinal; 1472 builder.isFinal = isFinal;
1481 builder.isConst = isConst; 1473 builder.isConst = isConst;
1482 builder.hasImplicitType = hasImplicitType; 1474 builder.hasImplicitType = hasImplicitType;
1483 return builder; 1475 return builder;
1484 } 1476 }
1485 1477
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698