Chromium Code Reviews| Index: pkg/kernel/binary.md |
| diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md |
| index 6f8a03aecd2850df25778ecfc7cb1b537c5da597..09f9151f0467d19c3f45da26135454accccaf7db 100644 |
| --- a/pkg/kernel/binary.md |
| +++ b/pkg/kernel/binary.md |
| @@ -42,45 +42,43 @@ type UInt30 extends UInt { |
| type MagicWord = big endian 32-bit unsigned integer |
| +type List<T> { |
| + UInt length; |
| + T[length] items; |
| +} |
| + |
| type String { |
| - UInt num_bytes; |
| - Byte[num_bytes] utf8_bytes; |
| + List<Byte> utf8Bytes; |
| } |
| type StringTable { |
| - UInt num_strings; |
| - String[num_strings] strings; |
| + List<String> strings; |
| } |
| type StringReference { |
| - UInt index; // Index into the StringTable. |
| + UInt index; // Index into the StringTable strings. |
| } |
| type LineStarts { |
| - UInt lineCount; |
| - // Delta encoded, e.g. 0, 10, 15, 7, 10 means 0, 10, 25, 32, 42. |
| - UInt[lineCount] lineStarts; |
| + // Line starts are delta-encoded (they are encoded as line lengths). The list |
| + // [0, 10, 25, 32, 42] is encoded as [0, 10, 15, 7, 10]. |
| + List<Uint> lineStarts; |
| } |
| type UriLineStarts { |
| - StringTable uris; |
| - LineStarts[uris.num_strings] lineStarts; |
| + List<String> uris; |
| + LineStarts[uris.length] lineStarts; |
| } |
| type UriReference { |
| - UInt index; // Index into the URIs StringTable. |
| + UInt index; // Index into the UriLineStarts uris. |
| } |
| type FileOffset { |
| - // Saved as number+1 to accommodate literal "-1". |
| + // Encoded as offset + 1 to accommodate -1 indicating no offset. |
| UInt fileOffset; |
| } |
| -type List<T> { |
| - UInt length; |
| - T[length] items; |
| -} |
| - |
| type Option<T> { |
| Byte tag; |
| } |
| @@ -96,13 +94,12 @@ type ProgramFile { |
| MagicWord magic = 0x90ABCDEF; |
| StringTable strings; |
| UriLineStarts lineStartsMap; |
| - List<Library> library; |
| + List<Library> libraries; |
| LibraryProcedureReference mainMethod; |
| } |
| type LibraryReference { |
| - // For library files, this is an index into the import table. |
| - // For program files, this is an index into the list of libaries. |
| + // Index into the ProgramFile libraries. |
| UInt index; |
| } |
| @@ -169,8 +166,11 @@ type Name { |
| type Library { |
| Byte flags (isExternal); |
| StringReference name; |
| - // A URI with the dart, package, or file scheme. For file URIs, the path |
| - // is an absolute path to the .dart file from which the library was created. |
| + // A URI from which the library was created. The URI has the dart, package, |
| + // or file scheme. An application root was specified when the binary was |
|
asgerf
2016/11/30 11:14:55
URIs relative to the application root use the "app
Kevin Millikin (Google)
2016/11/30 11:20:59
I've reworded this to be even more clear.
|
| + // generated. For file URIs that lie under the application root, the path is |
| + // relative to the application root. For file URIs outside the application |
| + // root, the path is absolute. |
| StringReference importUri; |
| // An absolute path URI to the .dart file from which the library was created. |
| UriReference fileUri; |