| OLD | NEW |
| 1 This file describes the binary format of Dart Kernel. | 1 This file describes the binary format of Dart Kernel. |
| 2 | 2 |
| 3 Notation | 3 Notation |
| 4 -------- | 4 -------- |
| 5 Bitmasks are described with the syntax: | 5 Bitmasks are described with the syntax: |
| 6 ```scala | 6 ```scala |
| 7 Byte flags (flag1, flag2, ..., flagN) | 7 Byte flags (flag1, flag2, ..., flagN) |
| 8 ``` | 8 ``` |
| 9 where 'flag<N>' is the N-th least significant bit, | 9 where 'flag<N>' is the N-th least significant bit, |
| 10 (so flag1 is the least significant bit). | 10 (so flag1 is the least significant bit). |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 type StringTable { | 54 type StringTable { |
| 55 List<String> strings; | 55 List<String> strings; |
| 56 } | 56 } |
| 57 | 57 |
| 58 type StringReference { | 58 type StringReference { |
| 59 UInt index; // Index into the StringTable strings. | 59 UInt index; // Index into the StringTable strings. |
| 60 } | 60 } |
| 61 | 61 |
| 62 type LineStarts { | 62 type LineStartsAndSource { |
| 63 String source; |
| 63 // Line starts are delta-encoded (they are encoded as line lengths). The list | 64 // Line starts are delta-encoded (they are encoded as line lengths). The list |
| 64 // [0, 10, 25, 32, 42] is encoded as [0, 10, 15, 7, 10]. | 65 // [0, 10, 25, 32, 42] is encoded as [0, 10, 15, 7, 10]. |
| 65 List<Uint> lineStarts; | 66 List<Uint> lineStarts; |
| 66 } | 67 } |
| 67 | 68 |
| 68 type UriLineStarts { | 69 type UriLineStartsAndSource { |
| 69 List<String> uris; | 70 List<String> uris; |
| 70 LineStarts[uris.length] lineStarts; | 71 LineStartsAndSource[uris.length] lineStartsAndSource; |
| 71 } | 72 } |
| 72 | 73 |
| 73 type UriReference { | 74 type UriReference { |
| 74 UInt index; // Index into the UriLineStarts uris. | 75 UInt index; // Index into the UriLineStartsAndSource uris. |
| 75 } | 76 } |
| 76 | 77 |
| 77 type FileOffset { | 78 type FileOffset { |
| 78 // Encoded as offset + 1 to accommodate -1 indicating no offset. | 79 // Encoded as offset + 1 to accommodate -1 indicating no offset. |
| 79 UInt fileOffset; | 80 UInt fileOffset; |
| 80 } | 81 } |
| 81 | 82 |
| 82 type Option<T> { | 83 type Option<T> { |
| 83 Byte tag; | 84 Byte tag; |
| 84 } | 85 } |
| 85 type Nothing extends Option<T> { | 86 type Nothing extends Option<T> { |
| 86 Byte tag = 0; | 87 Byte tag = 0; |
| 87 } | 88 } |
| 88 type Something<T> extends Option<T> { | 89 type Something<T> extends Option<T> { |
| 89 Byte tag = 1; | 90 Byte tag = 1; |
| 90 T value; | 91 T value; |
| 91 } | 92 } |
| 92 | 93 |
| 93 type ProgramFile { | 94 type ProgramFile { |
| 94 MagicWord magic = 0x90ABCDEF; | 95 MagicWord magic = 0x90ABCDEF; |
| 95 StringTable strings; | 96 StringTable strings; |
| 96 UriLineStarts lineStartsMap; | 97 UriLineStartsAndSource lineStartsAndSourceMap; |
| 97 List<Library> libraries; | 98 List<Library> libraries; |
| 98 LibraryProcedureReference mainMethod; | 99 LibraryProcedureReference mainMethod; |
| 99 } | 100 } |
| 100 | 101 |
| 101 type LibraryReference { | 102 type LibraryReference { |
| 102 // Index into the ProgramFile libraries. | 103 // Index into the ProgramFile libraries. |
| 103 UInt index; | 104 UInt index; |
| 104 } | 105 } |
| 105 | 106 |
| 106 abstract type ClassReference {} | 107 abstract type ClassReference {} |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 | 896 |
| 896 /* enum BaseClassKind { None, Exact, Subclass, Subtype, } */ | 897 /* enum BaseClassKind { None, Exact, Subclass, Subtype, } */ |
| 897 | 898 |
| 898 type InferredValue { | 899 type InferredValue { |
| 899 ClassReference baseClass; // May be NullReference if kind = None. | 900 ClassReference baseClass; // May be NullReference if kind = None. |
| 900 Byte kind; // Index into BaseClassKind. | 901 Byte kind; // Index into BaseClassKind. |
| 901 Byte valueBits; // See lib/type_propagation/type_propagation.dart | 902 Byte valueBits; // See lib/type_propagation/type_propagation.dart |
| 902 } | 903 } |
| 903 | 904 |
| 904 ``` | 905 ``` |
| OLD | NEW |