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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 239 } |
240 | 240 |
241 abstract type Member extends Node {} | 241 abstract type Member extends Node {} |
242 | 242 |
243 type Field extends Member { | 243 type Field extends Member { |
244 Byte tag = 4; | 244 Byte tag = 4; |
245 CanonicalNameReference canonicalName; | 245 CanonicalNameReference canonicalName; |
246 FileOffset fileOffset; | 246 FileOffset fileOffset; |
247 FileOffset fileEndOffset; | 247 FileOffset fileEndOffset; |
248 Byte flags (isFinal, isConst, isStatic); | 248 Byte flags (isFinal, isConst, isStatic); |
249 // Byte offset in the binary for the parent class, | |
250 // or 0 if parent is not a class | |
251 UInt parentPosition; | |
252 Name name; | 249 Name name; |
253 // An absolute path URI to the .dart file from which the field was created. | 250 // An absolute path URI to the .dart file from which the field was created. |
254 UriReference fileUri; | 251 UriReference fileUri; |
255 List<Expression> annotations; | 252 List<Expression> annotations; |
256 DartType type; | 253 DartType type; |
257 Option<Expression> initializer; | 254 Option<Expression> initializer; |
258 } | 255 } |
259 | 256 |
260 type Constructor extends Member { | 257 type Constructor extends Member { |
261 Byte tag = 5; | 258 Byte tag = 5; |
262 CanonicalNameReference canonicalName; | 259 CanonicalNameReference canonicalName; |
263 FileOffset fileOffset; | 260 FileOffset fileOffset; |
264 FileOffset fileEndOffset; | 261 FileOffset fileEndOffset; |
265 Byte flags (isConst, isExternal); | 262 Byte flags (isConst, isExternal); |
266 UInt parentPosition; // Byte offset in the binary for the parent class. | |
267 Name name; | 263 Name name; |
268 List<Expression> annotations; | 264 List<Expression> annotations; |
269 FunctionNode function; | 265 FunctionNode function; |
270 List<Initializer> initializers; | 266 List<Initializer> initializers; |
271 } | 267 } |
272 | 268 |
273 /* | 269 /* |
274 enum ProcedureKind { | 270 enum ProcedureKind { |
275 Method, | 271 Method, |
276 Getter, | 272 Getter, |
277 Setter, | 273 Setter, |
278 Operator, | 274 Operator, |
279 Factory, | 275 Factory, |
280 } | 276 } |
281 */ | 277 */ |
282 | 278 |
283 type Procedure extends Member { | 279 type Procedure extends Member { |
284 Byte tag = 6; | 280 Byte tag = 6; |
285 CanonicalNameReference canonicalName; | 281 CanonicalNameReference canonicalName; |
286 FileOffset fileOffset; | 282 FileOffset fileOffset; |
287 FileOffset fileEndOffset; | 283 FileOffset fileEndOffset; |
288 Byte kind; // Index into the ProcedureKind enum above. | 284 Byte kind; // Index into the ProcedureKind enum above. |
289 Byte flags (isStatic, isAbstract, isExternal, isConst); | 285 Byte flags (isStatic, isAbstract, isExternal, isConst); |
290 // Byte offset in the binary for the parent class, | |
291 // or 0 if parent is not a class. | |
292 UInt parentPosition; | |
293 Name name; | 286 Name name; |
294 // An absolute path URI to the .dart file from which the class was created. | 287 // An absolute path URI to the .dart file from which the class was created. |
295 UriReference fileUri; | 288 UriReference fileUri; |
296 List<Expression> annotations; | 289 List<Expression> annotations; |
297 // Can only be absent if abstract, but tag is there anyway. | 290 // Can only be absent if abstract, but tag is there anyway. |
298 Option<FunctionNode> function; | 291 Option<FunctionNode> function; |
299 } | 292 } |
300 | 293 |
301 abstract type Initializer extends Node {} | 294 abstract type Initializer extends Node {} |
302 | 295 |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 Option<DartType> bound; | 1007 Option<DartType> bound; |
1015 } | 1008 } |
1016 | 1009 |
1017 type TypeParameter { | 1010 type TypeParameter { |
1018 // Note: there is no tag on TypeParameter | 1011 // Note: there is no tag on TypeParameter |
1019 StringReference name; // Cosmetic, may be empty, not unique. | 1012 StringReference name; // Cosmetic, may be empty, not unique. |
1020 DartType bound; // 'dynamic' if no explicit bound was given. | 1013 DartType bound; // 'dynamic' if no explicit bound was given. |
1021 } | 1014 } |
1022 | 1015 |
1023 ``` | 1016 ``` |
OLD | NEW |