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

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

Issue 1746113002: Rename some index fields and use single 'UnitIndex.unit' field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 /** 5 /**
6 * This file is an "idl" style description of the summary format. It 6 * This file is an "idl" style description of the summary format. It
7 * contains abstract classes which declare the interface for reading data from 7 * contains abstract classes which declare the interface for reading data from
8 * summaries. It is parsed and transformed into code that implements the 8 * summaries. It is parsed and transformed into code that implements the
9 * summary format. 9 * summary format.
10 * 10 *
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 generated.readPackageIndex(buffer); 511 generated.readPackageIndex(buffer);
512 512
513 /** 513 /**
514 * Each item of this list corresponds to a unique referenced element. It is 514 * Each item of this list corresponds to a unique referenced element. It is
515 * the kind of the synthetic element. 515 * the kind of the synthetic element.
516 */ 516 */
517 @Id(5) 517 @Id(5)
518 List<IndexSyntheticElementKind> get elementKinds; 518 List<IndexSyntheticElementKind> get elementKinds;
519 519
520 /** 520 /**
521 * Each item of this list corresponds to a unique library URI with an element
522 * referenced in the [PackageIndex]. It is an index into [uris] list.
523 */
524 @Id(2)
525 List<int> get elementLibraryUris;
526
527 /**
528 * Each item of this list corresponds to a unique referenced element. It is 521 * Each item of this list corresponds to a unique referenced element. It is
529 * the offset of the element name relative to the beginning of the file. The 522 * the offset of the element name relative to the beginning of the file. The
530 * list is sorted in ascending order, so that the client can quickly check 523 * list is sorted in ascending order, so that the client can quickly check
531 * whether an element is referenced in this [PackageIndex]. 524 * whether an element is referenced in this [PackageIndex].
532 */ 525 */
533 @Id(1) 526 @Id(1)
534 List<int> get elementOffsets; 527 List<int> get elementOffsets;
535 528
536 /** 529 /**
537 * Each item of this list corresponds to a unique referenced element. It is 530 * Each item of this list corresponds to a unique referenced element. It is
538 * the index into [elementLibraryUris] and [elementUnitUris] for the library 531 * the index into [unitLibraryUris] and [unitUnitUris] for the library
539 * specific unit where the element is declared. 532 * specific unit where the element is declared.
540 */ 533 */
541 @Id(0) 534 @Id(0)
542 List<int> get elementUnits; 535 List<int> get elementUnits;
543 536
544 /** 537 /**
545 * Each item of this list corresponds to a unique unit URI with an element
546 * referenced in the [PackageIndex]. It is an index into [uris] list.
547 */
548 @Id(3)
549 List<int> get elementUnitUris;
550
551 /**
552 * List of unique element strings used in this [PackageIndex]. 538 * List of unique element strings used in this [PackageIndex].
553 */ 539 */
554 @Id(6) 540 @Id(6)
555 List<String> get strings; 541 List<String> get strings;
556 542
557 /** 543 /**
558 * List of units indexed in this [PackageIndex]. 544 * Each item of this list corresponds to the library URI of a unique library
545 * specific unit referenced in the [PackageIndex].
546 */
547 @Id(2)
548 List<int> get unitLibraryUris;
549
550 /**
551 * List of indexes of each unit in this [PackageIndex].
559 */ 552 */
560 @Id(4) 553 @Id(4)
561 List<UnitIndex> get units; 554 List<UnitIndex> get units;
555
556 /**
557 * Each item of this list corresponds to the unit URI of a unique library
558 * specific unit referenced in the [PackageIndex].
559 */
560 @Id(3)
561 List<int> get unitUnitUris;
562 } 562 }
563 563
564 /** 564 /**
565 * Enum used to indicate the kind of entity referred to by a 565 * Enum used to indicate the kind of entity referred to by a
566 * [LinkedReference]. 566 * [LinkedReference].
567 */ 567 */
568 enum ReferenceKind { 568 enum ReferenceKind {
569 /** 569 /**
570 * The entity is a class or enum. 570 * The entity is a class or enum.
571 */ 571 */
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 unresolved 629 unresolved
630 } 630 }
631 631
632 /** 632 /**
633 * Index information about a unit in a [PackageIndex]. 633 * Index information about a unit in a [PackageIndex].
634 */ 634 */
635 abstract class UnitIndex extends base.SummaryClass { 635 abstract class UnitIndex extends base.SummaryClass {
636 /** 636 /**
637 * Each item of this list is the kind of an element defined in this unit. 637 * Each item of this list is the kind of an element defined in this unit.
638 */ 638 */
639 @Id(7) 639 @Id(6)
640 List<IndexNameKind> get definedNameKinds; 640 List<IndexNameKind> get definedNameKinds;
641 641
642 /** 642 /**
643 * Each item of this list is the name offset of an element defined in this 643 * Each item of this list is the name offset of an element defined in this
644 * unit relative to the beginning of the file. 644 * unit relative to the beginning of the file.
645 */ 645 */
646 @Id(8) 646 @Id(7)
647 List<int> get definedNameOffsets; 647 List<int> get definedNameOffsets;
648 648
649 /** 649 /**
650 * Each item of this list corresponds to an element defined in this unit. It 650 * Each item of this list corresponds to an element defined in this unit. It
651 * is an index into [PackageIndex.strings] list. The list is sorted in 651 * is an index into [PackageIndex.strings] list. The list is sorted in
652 * ascending order, so that the client can quickly find name definitions in 652 * ascending order, so that the client can quickly find name definitions in
653 * this [UnitIndex]. 653 * this [UnitIndex].
654 */ 654 */
655 @Id(6) 655 @Id(5)
656 List<int> get definedNames; 656 List<int> get definedNames;
657 657
658 /** 658 /**
659 * Index into [PackageIndex.unitLibraryUris] and [PackageIndex.unitUnitUris]
660 * for the library specific unit that corresponds to this [UnitIndex].
661 */
662 @Id(0)
663 int get unit;
664
665 /**
666 * Each item of this list is the kind of the element usage.
667 */
668 @Id(4)
669 List<IndexRelationKind> get usedElementKinds;
670
671 /**
672 * Each item of this list is the length of the element usage.
673 */
674 @Id(1)
675 List<int> get usedElementLengths;
676
677 /**
678 * Each item of this list is the offset of the element usage relative to the
679 * beginning of the file.
680 */
681 @Id(2)
682 List<int> get usedElementOffsets;
683
684 /**
659 * Each item of this list is the index into [PackageIndex.elementUnits] and 685 * Each item of this list is the index into [PackageIndex.elementUnits] and
660 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so 686 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so
661 * that the client can quickly find element references in this [UnitIndex]. 687 * that the client can quickly find element references in this [UnitIndex].
662 */ 688 */
663 @Id(4)
664 List<int> get elements;
665
666 /**
667 * Each item of this list is the kind of the element usage.
668 */
669 @Id(5)
670 List<IndexRelationKind> get kinds;
671
672 /**
673 * The library source URI of this unit, e.g. `dart:core` or
674 * `package:foo/bar.dart`, as index into [PackageIndex.uris].
675 */
676 @Id(0)
677 int get libraryUri;
678
679 /**
680 * Each item of this list is the length of the element usage.
681 */
682 @Id(2)
683 List<int> get locationLengths;
684
685 /**
686 * Each item of this list is the offset of the element usage relative to the
687 * beginning of the file.
688 */
689 @Id(3) 689 @Id(3)
690 List<int> get locationOffsets; 690 List<int> get usedElements;
691
692 /**
693 * The unit source URI of this unit, e.g. `dart:core/int.dart` or
694 * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris].
695 */
696 @Id(1)
697 int get unitUri;
698 } 691 }
699 692
700 /** 693 /**
701 * Unlinked summary information about a class declaration. 694 * Unlinked summary information about a class declaration.
702 */ 695 */
703 abstract class UnlinkedClass extends base.SummaryClass { 696 abstract class UnlinkedClass extends base.SummaryClass {
704 /** 697 /**
705 * Annotations for this class. 698 * Annotations for this class.
706 */ 699 */
707 @Id(5) 700 @Id(5)
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 */ 2220 */
2228 @Id(11) 2221 @Id(11)
2229 int get visibleLength; 2222 int get visibleLength;
2230 2223
2231 /** 2224 /**
2232 * If a local variable, the beginning of the visible range; zero otherwise. 2225 * If a local variable, the beginning of the visible range; zero otherwise.
2233 */ 2226 */
2234 @Id(12) 2227 @Id(12)
2235 int get visibleOffset; 2228 int get visibleOffset;
2236 } 2229 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698