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 2203173002: Use unitMember/classMember/parameter names instead of offsets in index. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 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 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 "unlinkedUnits": unlinkedUnits, 2129 "unlinkedUnits": unlinkedUnits,
2130 "unlinkedUnitUris": unlinkedUnitUris, 2130 "unlinkedUnitUris": unlinkedUnitUris,
2131 }; 2131 };
2132 2132
2133 @override 2133 @override
2134 String toString() => convert.JSON.encode(toJson()); 2134 String toString() => convert.JSON.encode(toJson());
2135 } 2135 }
2136 2136
2137 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl. PackageIndex { 2137 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl. PackageIndex {
2138 List<idl.IndexSyntheticElementKind> _elementKinds; 2138 List<idl.IndexSyntheticElementKind> _elementKinds;
2139 List<int> _elementOffsets; 2139 List<int> _elementNameClassMemberIds;
2140 List<int> _elementNameParameterIds;
2141 List<int> _elementNameUnitMemberIds;
2140 List<int> _elementUnits; 2142 List<int> _elementUnits;
2141 List<String> _strings; 2143 List<String> _strings;
2142 List<int> _unitLibraryUris; 2144 List<int> _unitLibraryUris;
2143 List<UnitIndexBuilder> _units; 2145 List<UnitIndexBuilder> _units;
2144 List<int> _unitUnitUris; 2146 List<int> _unitUnitUris;
2145 2147
2146 @override 2148 @override
2147 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl .IndexSyntheticElementKind>[]; 2149 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl .IndexSyntheticElementKind>[];
2148 2150
2149 /** 2151 /**
2150 * Each item of this list corresponds to a unique referenced element. It is 2152 * Each item of this list corresponds to a unique referenced element. It is
2151 * the kind of the synthetic element. 2153 * the kind of the synthetic element.
2152 */ 2154 */
2153 void set elementKinds(List<idl.IndexSyntheticElementKind> _value) { 2155 void set elementKinds(List<idl.IndexSyntheticElementKind> _value) {
2154 _elementKinds = _value; 2156 _elementKinds = _value;
2155 } 2157 }
2156 2158
2157 @override 2159 @override
2158 List<int> get elementOffsets => _elementOffsets ??= <int>[]; 2160 List<int> get elementNameClassMemberIds => _elementNameClassMemberIds ??= <int >[];
2159 2161
2160 /** 2162 /**
2161 * Each item of this list corresponds to a unique referenced element. It is 2163 * Each item of this list corresponds to a unique referenced element. It is
2162 * the offset of the element name relative to the beginning of the file. The 2164 * the identifier of the class member element name, or `null` if the element i s
2163 * list is sorted in ascending order, so that the client can quickly check 2165 * a top-level element. The list is sorted in ascending order, so that the
2164 * whether an element is referenced in this [PackageIndex]. 2166 * client can quickly check whether an element is referenced in this
2167 * [PackageIndex].
2165 */ 2168 */
2166 void set elementOffsets(List<int> _value) { 2169 void set elementNameClassMemberIds(List<int> _value) {
2167 assert(_value == null || _value.every((e) => e >= 0)); 2170 assert(_value == null || _value.every((e) => e >= 0));
2168 _elementOffsets = _value; 2171 _elementNameClassMemberIds = _value;
2169 } 2172 }
2170 2173
2171 @override 2174 @override
2175 List<int> get elementNameParameterIds => _elementNameParameterIds ??= <int>[];
2176
2177 /**
2178 * Each item of this list corresponds to a unique referenced element. It is
2179 * the identifier of the named parameter name, or `null` if the element is not
2180 * a named parameter. The list is sorted in ascending order, so that the
2181 * client can quickly check whether an element is referenced in this
2182 * [PackageIndex].
2183 */
2184 void set elementNameParameterIds(List<int> _value) {
2185 assert(_value == null || _value.every((e) => e >= 0));
2186 _elementNameParameterIds = _value;
2187 }
2188
2189 @override
2190 List<int> get elementNameUnitMemberIds => _elementNameUnitMemberIds ??= <int>[ ];
2191
2192 /**
2193 * Each item of this list corresponds to a unique referenced element. It is
2194 * the identifier of the top-level element name, or `null` if the element is
2195 * the unit. The list is sorted in ascending order, so that the client can
2196 * quickly check whether an element is referenced in this [PackageIndex].
2197 */
2198 void set elementNameUnitMemberIds(List<int> _value) {
2199 assert(_value == null || _value.every((e) => e >= 0));
2200 _elementNameUnitMemberIds = _value;
2201 }
2202
2203 @override
2172 List<int> get elementUnits => _elementUnits ??= <int>[]; 2204 List<int> get elementUnits => _elementUnits ??= <int>[];
2173 2205
2174 /** 2206 /**
2175 * Each item of this list corresponds to a unique referenced element. It is 2207 * Each item of this list corresponds to a unique referenced element. It is
2176 * the index into [unitLibraryUris] and [unitUnitUris] for the library 2208 * the index into [unitLibraryUris] and [unitUnitUris] for the library
2177 * specific unit where the element is declared. 2209 * specific unit where the element is declared.
2178 */ 2210 */
2179 void set elementUnits(List<int> _value) { 2211 void set elementUnits(List<int> _value) {
2180 assert(_value == null || _value.every((e) => e >= 0)); 2212 assert(_value == null || _value.every((e) => e >= 0));
2181 _elementUnits = _value; 2213 _elementUnits = _value;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 /** 2254 /**
2223 * Each item of this list corresponds to the unit URI of a unique library 2255 * Each item of this list corresponds to the unit URI of a unique library
2224 * specific unit referenced in the [PackageIndex]. It is an index into 2256 * specific unit referenced in the [PackageIndex]. It is an index into
2225 * [strings] list. 2257 * [strings] list.
2226 */ 2258 */
2227 void set unitUnitUris(List<int> _value) { 2259 void set unitUnitUris(List<int> _value) {
2228 assert(_value == null || _value.every((e) => e >= 0)); 2260 assert(_value == null || _value.every((e) => e >= 0));
2229 _unitUnitUris = _value; 2261 _unitUnitUris = _value;
2230 } 2262 }
2231 2263
2232 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in t> elementOffsets, List<int> elementUnits, List<String> strings, List<int> unitL ibraryUris, List<UnitIndexBuilder> units, List<int> unitUnitUris}) 2264 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in t> elementNameClassMemberIds, List<int> elementNameParameterIds, List<int> eleme ntNameUnitMemberIds, List<int> elementUnits, List<String> strings, List<int> uni tLibraryUris, List<UnitIndexBuilder> units, List<int> unitUnitUris})
2233 : _elementKinds = elementKinds, 2265 : _elementKinds = elementKinds,
2234 _elementOffsets = elementOffsets, 2266 _elementNameClassMemberIds = elementNameClassMemberIds,
2267 _elementNameParameterIds = elementNameParameterIds,
2268 _elementNameUnitMemberIds = elementNameUnitMemberIds,
2235 _elementUnits = elementUnits, 2269 _elementUnits = elementUnits,
2236 _strings = strings, 2270 _strings = strings,
2237 _unitLibraryUris = unitLibraryUris, 2271 _unitLibraryUris = unitLibraryUris,
2238 _units = units, 2272 _units = units,
2239 _unitUnitUris = unitUnitUris; 2273 _unitUnitUris = unitUnitUris;
2240 2274
2241 /** 2275 /**
2242 * Flush [informative] data recursively. 2276 * Flush [informative] data recursively.
2243 */ 2277 */
2244 void flushInformative() { 2278 void flushInformative() {
2245 _units?.forEach((b) => b.flushInformative()); 2279 _units?.forEach((b) => b.flushInformative());
2246 } 2280 }
2247 2281
2248 List<int> toBuffer() { 2282 List<int> toBuffer() {
2249 fb.Builder fbBuilder = new fb.Builder(); 2283 fb.Builder fbBuilder = new fb.Builder();
2250 return fbBuilder.finish(finish(fbBuilder), "Indx"); 2284 return fbBuilder.finish(finish(fbBuilder), "Indx");
2251 } 2285 }
2252 2286
2253 fb.Offset finish(fb.Builder fbBuilder) { 2287 fb.Offset finish(fb.Builder fbBuilder) {
2254 fb.Offset offset_elementKinds; 2288 fb.Offset offset_elementKinds;
2255 fb.Offset offset_elementOffsets; 2289 fb.Offset offset_elementNameClassMemberIds;
2290 fb.Offset offset_elementNameParameterIds;
2291 fb.Offset offset_elementNameUnitMemberIds;
2256 fb.Offset offset_elementUnits; 2292 fb.Offset offset_elementUnits;
2257 fb.Offset offset_strings; 2293 fb.Offset offset_strings;
2258 fb.Offset offset_unitLibraryUris; 2294 fb.Offset offset_unitLibraryUris;
2259 fb.Offset offset_units; 2295 fb.Offset offset_units;
2260 fb.Offset offset_unitUnitUris; 2296 fb.Offset offset_unitUnitUris;
2261 if (!(_elementKinds == null || _elementKinds.isEmpty)) { 2297 if (!(_elementKinds == null || _elementKinds.isEmpty)) {
2262 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b. index).toList()); 2298 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b. index).toList());
2263 } 2299 }
2264 if (!(_elementOffsets == null || _elementOffsets.isEmpty)) { 2300 if (!(_elementNameClassMemberIds == null || _elementNameClassMemberIds.isEmp ty)) {
2265 offset_elementOffsets = fbBuilder.writeListUint32(_elementOffsets); 2301 offset_elementNameClassMemberIds = fbBuilder.writeListUint32(_elementNameC lassMemberIds);
2302 }
2303 if (!(_elementNameParameterIds == null || _elementNameParameterIds.isEmpty)) {
2304 offset_elementNameParameterIds = fbBuilder.writeListUint32(_elementNamePar ameterIds);
2305 }
2306 if (!(_elementNameUnitMemberIds == null || _elementNameUnitMemberIds.isEmpty )) {
2307 offset_elementNameUnitMemberIds = fbBuilder.writeListUint32(_elementNameUn itMemberIds);
2266 } 2308 }
2267 if (!(_elementUnits == null || _elementUnits.isEmpty)) { 2309 if (!(_elementUnits == null || _elementUnits.isEmpty)) {
2268 offset_elementUnits = fbBuilder.writeListUint32(_elementUnits); 2310 offset_elementUnits = fbBuilder.writeListUint32(_elementUnits);
2269 } 2311 }
2270 if (!(_strings == null || _strings.isEmpty)) { 2312 if (!(_strings == null || _strings.isEmpty)) {
2271 offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeSt ring(b)).toList()); 2313 offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeSt ring(b)).toList());
2272 } 2314 }
2273 if (!(_unitLibraryUris == null || _unitLibraryUris.isEmpty)) { 2315 if (!(_unitLibraryUris == null || _unitLibraryUris.isEmpty)) {
2274 offset_unitLibraryUris = fbBuilder.writeListUint32(_unitLibraryUris); 2316 offset_unitLibraryUris = fbBuilder.writeListUint32(_unitLibraryUris);
2275 } 2317 }
2276 if (!(_units == null || _units.isEmpty)) { 2318 if (!(_units == null || _units.isEmpty)) {
2277 offset_units = fbBuilder.writeList(_units.map((b) => b.finish(fbBuilder)). toList()); 2319 offset_units = fbBuilder.writeList(_units.map((b) => b.finish(fbBuilder)). toList());
2278 } 2320 }
2279 if (!(_unitUnitUris == null || _unitUnitUris.isEmpty)) { 2321 if (!(_unitUnitUris == null || _unitUnitUris.isEmpty)) {
2280 offset_unitUnitUris = fbBuilder.writeListUint32(_unitUnitUris); 2322 offset_unitUnitUris = fbBuilder.writeListUint32(_unitUnitUris);
2281 } 2323 }
2282 fbBuilder.startTable(); 2324 fbBuilder.startTable();
2283 if (offset_elementKinds != null) { 2325 if (offset_elementKinds != null) {
2284 fbBuilder.addOffset(5, offset_elementKinds); 2326 fbBuilder.addOffset(5, offset_elementKinds);
2285 } 2327 }
2286 if (offset_elementOffsets != null) { 2328 if (offset_elementNameClassMemberIds != null) {
2287 fbBuilder.addOffset(1, offset_elementOffsets); 2329 fbBuilder.addOffset(7, offset_elementNameClassMemberIds);
2330 }
2331 if (offset_elementNameParameterIds != null) {
2332 fbBuilder.addOffset(8, offset_elementNameParameterIds);
2333 }
2334 if (offset_elementNameUnitMemberIds != null) {
2335 fbBuilder.addOffset(1, offset_elementNameUnitMemberIds);
2288 } 2336 }
2289 if (offset_elementUnits != null) { 2337 if (offset_elementUnits != null) {
2290 fbBuilder.addOffset(0, offset_elementUnits); 2338 fbBuilder.addOffset(0, offset_elementUnits);
2291 } 2339 }
2292 if (offset_strings != null) { 2340 if (offset_strings != null) {
2293 fbBuilder.addOffset(6, offset_strings); 2341 fbBuilder.addOffset(6, offset_strings);
2294 } 2342 }
2295 if (offset_unitLibraryUris != null) { 2343 if (offset_unitLibraryUris != null) {
2296 fbBuilder.addOffset(2, offset_unitLibraryUris); 2344 fbBuilder.addOffset(2, offset_unitLibraryUris);
2297 } 2345 }
(...skipping 19 matching lines...) Expand all
2317 _PackageIndexImpl createObject(fb.BufferContext bc, int offset) => new _Packag eIndexImpl(bc, offset); 2365 _PackageIndexImpl createObject(fb.BufferContext bc, int offset) => new _Packag eIndexImpl(bc, offset);
2318 } 2366 }
2319 2367
2320 class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa ckageIndex { 2368 class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa ckageIndex {
2321 final fb.BufferContext _bc; 2369 final fb.BufferContext _bc;
2322 final int _bcOffset; 2370 final int _bcOffset;
2323 2371
2324 _PackageIndexImpl(this._bc, this._bcOffset); 2372 _PackageIndexImpl(this._bc, this._bcOffset);
2325 2373
2326 List<idl.IndexSyntheticElementKind> _elementKinds; 2374 List<idl.IndexSyntheticElementKind> _elementKinds;
2327 List<int> _elementOffsets; 2375 List<int> _elementNameClassMemberIds;
2376 List<int> _elementNameParameterIds;
2377 List<int> _elementNameUnitMemberIds;
2328 List<int> _elementUnits; 2378 List<int> _elementUnits;
2329 List<String> _strings; 2379 List<String> _strings;
2330 List<int> _unitLibraryUris; 2380 List<int> _unitLibraryUris;
2331 List<idl.UnitIndex> _units; 2381 List<idl.UnitIndex> _units;
2332 List<int> _unitUnitUris; 2382 List<int> _unitUnitUris;
2333 2383
2334 @override 2384 @override
2335 List<idl.IndexSyntheticElementKind> get elementKinds { 2385 List<idl.IndexSyntheticElementKind> get elementKinds {
2336 _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>(const _ IndexSyntheticElementKindReader()).vTableGet(_bc, _bcOffset, 5, const <idl.Index SyntheticElementKind>[]); 2386 _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>(const _ IndexSyntheticElementKindReader()).vTableGet(_bc, _bcOffset, 5, const <idl.Index SyntheticElementKind>[]);
2337 return _elementKinds; 2387 return _elementKinds;
2338 } 2388 }
2339 2389
2340 @override 2390 @override
2341 List<int> get elementOffsets { 2391 List<int> get elementNameClassMemberIds {
2342 _elementOffsets ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 1, const <int>[]); 2392 _elementNameClassMemberIds ??= const fb.Uint32ListReader().vTableGet(_bc, _b cOffset, 7, const <int>[]);
2343 return _elementOffsets; 2393 return _elementNameClassMemberIds;
2344 } 2394 }
2345 2395
2346 @override 2396 @override
2397 List<int> get elementNameParameterIds {
2398 _elementNameParameterIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bcO ffset, 8, const <int>[]);
2399 return _elementNameParameterIds;
2400 }
2401
2402 @override
2403 List<int> get elementNameUnitMemberIds {
2404 _elementNameUnitMemberIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bc Offset, 1, const <int>[]);
2405 return _elementNameUnitMemberIds;
2406 }
2407
2408 @override
2347 List<int> get elementUnits { 2409 List<int> get elementUnits {
2348 _elementUnits ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 0, c onst <int>[]); 2410 _elementUnits ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 0, c onst <int>[]);
2349 return _elementUnits; 2411 return _elementUnits;
2350 } 2412 }
2351 2413
2352 @override 2414 @override
2353 List<String> get strings { 2415 List<String> get strings {
2354 _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet( _bc, _bcOffset, 6, const <String>[]); 2416 _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet( _bc, _bcOffset, 6, const <String>[]);
2355 return _strings; 2417 return _strings;
2356 } 2418 }
(...skipping 15 matching lines...) Expand all
2372 _unitUnitUris ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, c onst <int>[]); 2434 _unitUnitUris ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, c onst <int>[]);
2373 return _unitUnitUris; 2435 return _unitUnitUris;
2374 } 2436 }
2375 } 2437 }
2376 2438
2377 abstract class _PackageIndexMixin implements idl.PackageIndex { 2439 abstract class _PackageIndexMixin implements idl.PackageIndex {
2378 @override 2440 @override
2379 Map<String, Object> toJson() { 2441 Map<String, Object> toJson() {
2380 Map<String, Object> _result = <String, Object>{}; 2442 Map<String, Object> _result = <String, Object>{};
2381 if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_va lue) => _value.toString().split('.')[1]).toList(); 2443 if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_va lue) => _value.toString().split('.')[1]).toList();
2382 if (elementOffsets.isNotEmpty) _result["elementOffsets"] = elementOffsets; 2444 if (elementNameClassMemberIds.isNotEmpty) _result["elementNameClassMemberIds "] = elementNameClassMemberIds;
2445 if (elementNameParameterIds.isNotEmpty) _result["elementNameParameterIds"] = elementNameParameterIds;
2446 if (elementNameUnitMemberIds.isNotEmpty) _result["elementNameUnitMemberIds"] = elementNameUnitMemberIds;
2383 if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits; 2447 if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits;
2384 if (strings.isNotEmpty) _result["strings"] = strings; 2448 if (strings.isNotEmpty) _result["strings"] = strings;
2385 if (unitLibraryUris.isNotEmpty) _result["unitLibraryUris"] = unitLibraryUris ; 2449 if (unitLibraryUris.isNotEmpty) _result["unitLibraryUris"] = unitLibraryUris ;
2386 if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson ()).toList(); 2450 if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson ()).toList();
2387 if (unitUnitUris.isNotEmpty) _result["unitUnitUris"] = unitUnitUris; 2451 if (unitUnitUris.isNotEmpty) _result["unitUnitUris"] = unitUnitUris;
2388 return _result; 2452 return _result;
2389 } 2453 }
2390 2454
2391 @override 2455 @override
2392 Map<String, Object> toMap() => { 2456 Map<String, Object> toMap() => {
2393 "elementKinds": elementKinds, 2457 "elementKinds": elementKinds,
2394 "elementOffsets": elementOffsets, 2458 "elementNameClassMemberIds": elementNameClassMemberIds,
2459 "elementNameParameterIds": elementNameParameterIds,
2460 "elementNameUnitMemberIds": elementNameUnitMemberIds,
2395 "elementUnits": elementUnits, 2461 "elementUnits": elementUnits,
2396 "strings": strings, 2462 "strings": strings,
2397 "unitLibraryUris": unitLibraryUris, 2463 "unitLibraryUris": unitLibraryUris,
2398 "units": units, 2464 "units": units,
2399 "unitUnitUris": unitUnitUris, 2465 "unitUnitUris": unitUnitUris,
2400 }; 2466 };
2401 2467
2402 @override 2468 @override
2403 String toString() => convert.JSON.encode(toJson()); 2469 String toString() => convert.JSON.encode(toJson());
2404 } 2470 }
(...skipping 5949 matching lines...) Expand 10 before | Expand all | Expand 10 after
8354 "propagatedTypeSlot": propagatedTypeSlot, 8420 "propagatedTypeSlot": propagatedTypeSlot,
8355 "type": type, 8421 "type": type,
8356 "visibleLength": visibleLength, 8422 "visibleLength": visibleLength,
8357 "visibleOffset": visibleOffset, 8423 "visibleOffset": visibleOffset,
8358 }; 8424 };
8359 8425
8360 @override 8426 @override
8361 String toString() => convert.JSON.encode(toJson()); 8427 String toString() => convert.JSON.encode(toJson());
8362 } 8428 }
8363 8429
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/search/search_engine_internal.dart ('k') | pkg/analyzer/lib/src/summary/format.fbs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698