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

Unified Diff: pkg/analyzer/lib/src/summary/idl.dart

Issue 1733853002: IDL for index. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: We store only URI strings. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/idl.dart
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/idl.dart
index 9d840b96997564d40d1007e4bc49360d4bac0c37..b04a9285fea31b7026fdbec92d0fb11a844b48a5 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/idl.dart
@@ -137,6 +137,20 @@ abstract class EntityRef extends base.SummaryClass {
}
/**
+ * TODO(scheglov) document
Paul Berry 2016/02/25 17:14:25 Please document this.
+ */
+enum IndexRelationKind {
+ EXTEND,
+ IMPLEMENT,
+ MIXIN,
+ READ,
+ READ_WRITE,
+ WRITE,
+ INVOKE,
+ REFERENCE
+}
+
+/**
* Information about a dependency that exists between one library and another
* due to an "import" declaration.
*/
@@ -160,6 +174,9 @@ abstract class LinkedDependency extends base.SummaryClass {
}
/**
+ * TODO(scheglov) document
Paul Berry 2016/02/25 17:14:25 Remove this.
+ */
+/**
* Information about a single name in the export namespace of the library that
* is not in the public namespace.
*/
@@ -395,6 +412,58 @@ abstract class PackageBundle extends base.SummaryClass {
}
/**
+ * Index information about a package.
+ */
+@topLevel
+abstract class PackageIndex extends base.SummaryClass {
+ factory PackageIndex.fromBuffer(List<int> buffer) =>
+ generated.readPackageIndex(buffer);
+
+ /**
+ * Each item of this list corresponds to a unique library URI with an element
+ * referenced in the [PackageIndex]. It is index into [uris] list.
Paul Berry 2016/02/25 17:14:25 s/It is index/It is an index/
+ */
+ @Id(2)
+ List<int> get elementLibraryUris;
+
+ /**
+ * Each item of this list corresponds to a unique referenced element. It is
+ * the offset of the element name relative to the beginning of the file. The
+ * list is sorted in ascending order, so that the client can quickly check
+ * whether an element is referenced in this [PackageIndex].
+ */
+ @Id(1)
+ List<int> get elementOffsets;
+
+ /**
+ * Each item of this list corresponds to a unique referenced element. It is
+ * the index into [elementLibraryUris] and [elementUnitUris] for the library
+ * specific unit where the element is declared.
+ */
+ @Id(0)
+ List<int> get elementUnits;
+
+ /**
+ * Each item of this list corresponds to a unique unit URI with an element
+ * referenced in the [PackageIndex]. It is index into [uris] list.
+ */
+ @Id(3)
+ List<int> get elementUnitUris;
+
+ /**
+ * List of unit indexed in this [PackageIndex].
Paul Berry 2016/02/25 17:14:25 s/unit/units/
+ */
+ @Id(5)
+ List<UnitIndex> get units;
+
+ /**
+ * List of unique URIs used in this [PackageIndex].
+ */
+ @Id(4)
+ List<String> get uris;
+}
+
+/**
* Enum used to indicate the kind of entity referred to by a
* [LinkedReference].
*/
@@ -463,6 +532,52 @@ enum ReferenceKind {
}
/**
+ * Index information about a unit in a [PackageIndex].
+ */
+abstract class UnitIndex extends base.SummaryClass {
+ /**
+ * Each item of this list is the index into [PackageIndex.elementUnits] and
+ * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so
+ * that the client can quickly find element references in this [UnitIndex].
+ */
+ @Id(4)
+ List<int> get elements;
+
+ /**
+ * Each item of this list is the kind of the element usage.
+ */
+ @Id(5)
+ List<IndexRelationKind> get kinds;
+
+ /**
+ * The library source URI of this unit, e.g. `dart:core` or
+ * `package:foo/bar.dart`, as index into [PackageIndex.uris].
+ */
+ @Id(0)
+ int get libraryUri;
+
+ /**
+ * Each item of this list is the length of the element usage.
+ */
+ @Id(2)
+ List<int> get locationLengths;
+
+ /**
+ * Each item of this list is the offset of the element usage relative to the
+ * beginning of the file.
+ */
+ @Id(3)
+ List<int> get locationOffsets;
+
+ /**
+ * The unit source URI of this unit, e.g. `dart:core/int.dart` or
+ * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris].
+ */
+ @Id(1)
+ int get unitUri;
+}
+
+/**
* Unlinked summary information about a class declaration.
*/
abstract class UnlinkedClass extends base.SummaryClass {
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698