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

Unified Diff: pkg/kernel/binary.md

Issue 2539063002: Update kernel/binary.md. (Closed)
Patch Set: Fix typo in comment. Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/binary.md
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
index 6f8a03aecd2850df25778ecfc7cb1b537c5da597..71b7f33be578d2f26c9a19dd6dc08a236b440055 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,
+ // file, or app scheme. For file URIs, the path is an absolute path to the
+ // .dart file from which the library was created. For app URIs, the path is
+ // relative to an application root that was specified when the binary was
+ // generated.
StringReference importUri;
// An absolute path URI to the .dart file from which the library was created.
UriReference fileUri;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698