| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 * Since we expect "linked" and "prelinked" dependencies to be similar, we only | 35 * Since we expect "linked" and "prelinked" dependencies to be similar, we only |
| 36 * rarely distinguish between them; most information is that is not "unlinked" | 36 * rarely distinguish between them; most information is that is not "unlinked" |
| 37 * is typically considered "linked" for simplicity. | 37 * is typically considered "linked" for simplicity. |
| 38 * | 38 * |
| 39 * Except as otherwise noted, synthetic elements are not stored in the summary; | 39 * Except as otherwise noted, synthetic elements are not stored in the summary; |
| 40 * they are re-synthesized at the time the summary is read. | 40 * they are re-synthesized at the time the summary is read. |
| 41 */ | 41 */ |
| 42 library analyzer.tool.summary.idl; | 42 library analyzer.tool.summary.idl; |
| 43 | 43 |
| 44 import 'base.dart' as base; | 44 import 'base.dart' as base; |
| 45 import 'base.dart' show Id; | 45 import 'base.dart' show Id, TopLevel; |
| 46 import 'format.dart' as generated; | 46 import 'format.dart' as generated; |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Annotation describing information which is not part of Dart semantics; in | 49 * Annotation describing information which is not part of Dart semantics; in |
| 50 * other words, if this information (or any information it refers to) changes, | 50 * other words, if this information (or any information it refers to) changes, |
| 51 * static analysis and runtime behavior of the library are unaffected. | 51 * static analysis and runtime behavior of the library are unaffected. |
| 52 */ | 52 */ |
| 53 const informative = null; | 53 const informative = null; |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Annotation describing a class which can be the top level object in an | |
| 57 * encoded summary. | |
| 58 */ | |
| 59 const topLevel = null; | |
| 60 | |
| 61 /** | |
| 62 * Summary information about a reference to a an entity such as a type, top | 56 * Summary information about a reference to a an entity such as a type, top |
| 63 * level executable, or executable within a class. | 57 * level executable, or executable within a class. |
| 64 */ | 58 */ |
| 65 abstract class EntityRef extends base.SummaryClass { | 59 abstract class EntityRef extends base.SummaryClass { |
| 66 /** | 60 /** |
| 67 * If this is a reference to a function type implicitly defined by a | 61 * If this is a reference to a function type implicitly defined by a |
| 68 * function-typed parameter, a list of zero-based indices indicating the path | 62 * function-typed parameter, a list of zero-based indices indicating the path |
| 69 * from the entity referred to by [reference] to the appropriate type | 63 * from the entity referred to by [reference] to the appropriate type |
| 70 * parameter. Otherwise the empty list. | 64 * parameter. Otherwise the empty list. |
| 71 * | 65 * |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 * zero represents the defining compilation unit, and nonzero values | 184 * zero represents the defining compilation unit, and nonzero values |
| 191 * represent parts in the order of the corresponding `part` declarations. | 185 * represent parts in the order of the corresponding `part` declarations. |
| 192 */ | 186 */ |
| 193 @Id(2) | 187 @Id(2) |
| 194 int get unit; | 188 int get unit; |
| 195 } | 189 } |
| 196 | 190 |
| 197 /** | 191 /** |
| 198 * Linked summary of a library. | 192 * Linked summary of a library. |
| 199 */ | 193 */ |
| 200 @topLevel | 194 @TopLevel('LLib') |
| 201 abstract class LinkedLibrary extends base.SummaryClass { | 195 abstract class LinkedLibrary extends base.SummaryClass { |
| 202 factory LinkedLibrary.fromBuffer(List<int> buffer) => | 196 factory LinkedLibrary.fromBuffer(List<int> buffer) => |
| 203 generated.readLinkedLibrary(buffer); | 197 generated.readLinkedLibrary(buffer); |
| 204 | 198 |
| 205 /** | 199 /** |
| 206 * The libraries that this library depends on (either via an explicit import | 200 * The libraries that this library depends on (either via an explicit import |
| 207 * statement or via the implicit dependencies on `dart:core` and | 201 * statement or via the implicit dependencies on `dart:core` and |
| 208 * `dart:async`). The first element of this array is a pseudo-dependency | 202 * `dart:async`). The first element of this array is a pseudo-dependency |
| 209 * representing the library itself (it is also used for `dynamic` and | 203 * representing the library itself (it is also used for `dynamic` and |
| 210 * `void`). This is followed by elements representing "prelinked" | 204 * `void`). This is followed by elements representing "prelinked" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 * List associating slot ids found inside the unlinked summary for the | 343 * List associating slot ids found inside the unlinked summary for the |
| 350 * compilation unit with propagated and inferred types. | 344 * compilation unit with propagated and inferred types. |
| 351 */ | 345 */ |
| 352 @Id(1) | 346 @Id(1) |
| 353 List<EntityRef> get types; | 347 List<EntityRef> get types; |
| 354 } | 348 } |
| 355 | 349 |
| 356 /** | 350 /** |
| 357 * Summary information about a package. | 351 * Summary information about a package. |
| 358 */ | 352 */ |
| 359 @topLevel | 353 @TopLevel('PBdl') |
| 360 abstract class PackageBundle extends base.SummaryClass { | 354 abstract class PackageBundle extends base.SummaryClass { |
| 361 factory PackageBundle.fromBuffer(List<int> buffer) => | 355 factory PackageBundle.fromBuffer(List<int> buffer) => |
| 362 generated.readPackageBundle(buffer); | 356 generated.readPackageBundle(buffer); |
| 363 | 357 |
| 364 /** | 358 /** |
| 365 * Linked libraries. | 359 * Linked libraries. |
| 366 */ | 360 */ |
| 367 @Id(0) | 361 @Id(0) |
| 368 List<LinkedLibrary> get linkedLibraries; | 362 List<LinkedLibrary> get linkedLibraries; |
| 369 | 363 |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 */ | 1635 */ |
| 1642 @Id(3) | 1636 @Id(3) |
| 1643 int get numTypeParameters; | 1637 int get numTypeParameters; |
| 1644 } | 1638 } |
| 1645 | 1639 |
| 1646 /** | 1640 /** |
| 1647 * Unlinked summary information about what a compilation unit contributes to a | 1641 * Unlinked summary information about what a compilation unit contributes to a |
| 1648 * library's public namespace. This is the subset of [UnlinkedUnit] that is | 1642 * library's public namespace. This is the subset of [UnlinkedUnit] that is |
| 1649 * required from dependent libraries in order to perform prelinking. | 1643 * required from dependent libraries in order to perform prelinking. |
| 1650 */ | 1644 */ |
| 1651 @topLevel | 1645 @TopLevel('UPNS') |
| 1652 abstract class UnlinkedPublicNamespace extends base.SummaryClass { | 1646 abstract class UnlinkedPublicNamespace extends base.SummaryClass { |
| 1653 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) => | 1647 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) => |
| 1654 generated.readUnlinkedPublicNamespace(buffer); | 1648 generated.readUnlinkedPublicNamespace(buffer); |
| 1655 | 1649 |
| 1656 /** | 1650 /** |
| 1657 * Export declarations in the compilation unit. | 1651 * Export declarations in the compilation unit. |
| 1658 */ | 1652 */ |
| 1659 @Id(2) | 1653 @Id(2) |
| 1660 List<UnlinkedExportPublic> get exports; | 1654 List<UnlinkedExportPublic> get exports; |
| 1661 | 1655 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1777 * Offset of the type parameter name relative to the beginning of the file. | 1771 * Offset of the type parameter name relative to the beginning of the file. |
| 1778 */ | 1772 */ |
| 1779 @informative | 1773 @informative |
| 1780 @Id(1) | 1774 @Id(1) |
| 1781 int get nameOffset; | 1775 int get nameOffset; |
| 1782 } | 1776 } |
| 1783 | 1777 |
| 1784 /** | 1778 /** |
| 1785 * Unlinked summary information about a compilation unit ("part file"). | 1779 * Unlinked summary information about a compilation unit ("part file"). |
| 1786 */ | 1780 */ |
| 1787 @topLevel | 1781 @TopLevel('UUnt') |
| 1788 abstract class UnlinkedUnit extends base.SummaryClass { | 1782 abstract class UnlinkedUnit extends base.SummaryClass { |
| 1789 factory UnlinkedUnit.fromBuffer(List<int> buffer) => | 1783 factory UnlinkedUnit.fromBuffer(List<int> buffer) => |
| 1790 generated.readUnlinkedUnit(buffer); | 1784 generated.readUnlinkedUnit(buffer); |
| 1791 | 1785 |
| 1792 /** | 1786 /** |
| 1793 * Classes declared in the compilation unit. | 1787 * Classes declared in the compilation unit. |
| 1794 */ | 1788 */ |
| 1795 @Id(2) | 1789 @Id(2) |
| 1796 List<UnlinkedClass> get classes; | 1790 List<UnlinkedClass> get classes; |
| 1797 | 1791 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 */ | 1986 */ |
| 1993 @Id(11) | 1987 @Id(11) |
| 1994 int get visibleLength; | 1988 int get visibleLength; |
| 1995 | 1989 |
| 1996 /** | 1990 /** |
| 1997 * If a local variable, the beginning of the visible range; zero otherwise. | 1991 * If a local variable, the beginning of the visible range; zero otherwise. |
| 1998 */ | 1992 */ |
| 1999 @Id(12) | 1993 @Id(12) |
| 2000 int get visibleOffset; | 1994 int get visibleOffset; |
| 2001 } | 1995 } |
| OLD | NEW |