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

Unified Diff: pkg/kernel/binary.md

Issue 2931773005: [kernel] Delete most of the AST (Closed)
Patch Set: Review Created 3 years, 6 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 | « no previous file | pkg/kernel/lib/ast.dart » ('j') | 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 e1f84096a368e30da0969095c281f1ad2c439a3d..30c4801506f50386f8552726ab7c8b0f62bbdd86 100644
--- a/pkg/kernel/binary.md
+++ b/pkg/kernel/binary.md
@@ -40,7 +40,7 @@ type UInt30 extends UInt {
Byte byte4(xxxxxxxx); // least significant byte
}
-type MagicWord = big endian 32-bit unsigned integer
+type UInt32 = big endian 32-bit unsigned integer
type List<T> {
UInt length;
@@ -115,12 +115,26 @@ type CanonicalName {
}
type ProgramFile {
- MagicWord magic = 0x90ABCDEF;
+ UInt32 magic = 0x90ABCDEF;
StringTable strings;
UriSource sourceMap;
List<CanonicalName> canonicalNames;
List<Library> libraries;
ProcedureReference mainMethod;
+ ProgramIndex programIndex;
+}
+
+// Program index with all fixed-size-32-bit integers.
+// This gives "semi-random-access" to certain parts of the binary.
+// By reading the last 4 bytes one knows the number of libaries,
+// which allows to skip to any other field in this program index,
+// which again allows to skip to what it points to.
+type ProgramIndex {
+ UInt32 binaryOffsetForSourceTable;
+ UInt32 binaryOffsetForCanonicalNames;
+ UInt32 mainMethodReference; // This is a ProcedureReference with a fixed-size integer.
+ UInt32[libraryCount] libraryOffsets;
+ UInt32 libraryCount;
}
type LibraryReference {
« no previous file with comments | « no previous file | pkg/kernel/lib/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698