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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 } | 215 } |
216 | 216 |
217 abstract type Member extends Node {} | 217 abstract type Member extends Node {} |
218 | 218 |
219 type Field extends Member { | 219 type Field extends Member { |
220 Byte tag = 4; | 220 Byte tag = 4; |
221 CanonicalNameReference canonicalName; | 221 CanonicalNameReference canonicalName; |
222 FileOffset fileOffset; | 222 FileOffset fileOffset; |
223 FileOffset fileEndOffset; | 223 FileOffset fileEndOffset; |
224 Byte flags (isFinal, isConst, isStatic); | 224 Byte flags (isFinal, isConst, isStatic); |
225 UInt parentPosition; // Byte offset in the binary for the parent class, or 0 i f parent is not a class. | |
Kevin Millikin (Google)
2017/06/12 08:25:14
Put the comment before the field and wrap it to 80
jensj
2017/06/13 09:41:02
Done.
| |
225 Name name; | 226 Name name; |
226 // An absolute path URI to the .dart file from which the field was created. | 227 // An absolute path URI to the .dart file from which the field was created. |
227 UriReference fileUri; | 228 UriReference fileUri; |
228 List<Expression> annotations; | 229 List<Expression> annotations; |
229 DartType type; | 230 DartType type; |
230 Option<Expression> initializer; | 231 Option<Expression> initializer; |
231 } | 232 } |
232 | 233 |
233 type Constructor extends Member { | 234 type Constructor extends Member { |
234 Byte tag = 5; | 235 Byte tag = 5; |
235 CanonicalNameReference canonicalName; | 236 CanonicalNameReference canonicalName; |
236 FileOffset fileOffset; | 237 FileOffset fileOffset; |
237 FileOffset fileEndOffset; | 238 FileOffset fileEndOffset; |
238 Byte flags (isConst, isExternal); | 239 Byte flags (isConst, isExternal); |
240 UInt parentPosition; // Byte offset in the binary for the parent class. | |
239 Name name; | 241 Name name; |
240 List<Expression> annotations; | 242 List<Expression> annotations; |
241 FunctionNode function; | 243 FunctionNode function; |
242 List<Initializer> initializers; | 244 List<Initializer> initializers; |
243 } | 245 } |
244 | 246 |
245 /* | 247 /* |
246 enum ProcedureKind { | 248 enum ProcedureKind { |
247 Method, | 249 Method, |
248 Getter, | 250 Getter, |
249 Setter, | 251 Setter, |
250 Operator, | 252 Operator, |
251 Factory, | 253 Factory, |
252 } | 254 } |
253 */ | 255 */ |
254 | 256 |
255 type Procedure extends Member { | 257 type Procedure extends Member { |
256 Byte tag = 6; | 258 Byte tag = 6; |
257 CanonicalNameReference canonicalName; | 259 CanonicalNameReference canonicalName; |
258 FileOffset fileOffset; | 260 FileOffset fileOffset; |
259 FileOffset fileEndOffset; | 261 FileOffset fileEndOffset; |
260 Byte kind; // Index into the ProcedureKind enum above. | 262 Byte kind; // Index into the ProcedureKind enum above. |
261 Byte flags (isStatic, isAbstract, isExternal, isConst); | 263 Byte flags (isStatic, isAbstract, isExternal, isConst); |
264 UInt parentPosition; // Byte offset in the binary for the parent class, or 0 i f parent is not a class. | |
262 Name name; | 265 Name name; |
263 // An absolute path URI to the .dart file from which the class was created. | 266 // An absolute path URI to the .dart file from which the class was created. |
264 UriReference fileUri; | 267 UriReference fileUri; |
265 List<Expression> annotations; | 268 List<Expression> annotations; |
266 // Can only be absent if abstract, but tag is there anyway. | 269 // Can only be absent if abstract, but tag is there anyway. |
267 Option<FunctionNode> function; | 270 Option<FunctionNode> function; |
268 } | 271 } |
269 | 272 |
270 abstract type Initializer extends Node {} | 273 abstract type Initializer extends Node {} |
271 | 274 |
(...skipping 28 matching lines...) Expand all Loading... | |
300 enum AsyncMarker { | 303 enum AsyncMarker { |
301 Sync, | 304 Sync, |
302 SyncStar, | 305 SyncStar, |
303 Async, | 306 Async, |
304 AsyncStar, | 307 AsyncStar, |
305 SyncYielding | 308 SyncYielding |
306 } | 309 } |
307 */ | 310 */ |
308 | 311 |
309 type FunctionNode { | 312 type FunctionNode { |
310 // Note: there is no tag on FunctionNode. | 313 Byte tag = 3; |
311 FileOffset fileOffset; | 314 FileOffset fileOffset; |
312 FileOffset fileEndOffset; | 315 FileOffset fileEndOffset; |
313 Byte asyncMarker; // Index into AsyncMarker above. | 316 Byte asyncMarker; // Index into AsyncMarker above. |
314 Byte dartAsyncMarker; // Index into AsyncMarker above. | 317 Byte dartAsyncMarker; // Index into AsyncMarker above. |
315 List<TypeParameter> typeParameters; | 318 List<TypeParameter> typeParameters; |
316 UInt requiredParameterCount; | 319 UInt requiredParameterCount; |
317 List<VariableDeclaration> positionalParameters; | 320 List<VariableDeclaration> positionalParameters; |
318 List<VariableDeclaration> namedParameters; | 321 List<VariableDeclaration> namedParameters; |
319 DartType returnType; | 322 DartType returnType; |
320 Option<Statement> body; | 323 Option<Statement> body; |
(...skipping 24 matching lines...) Expand all Loading... | |
345 | 348 |
346 abstract type Expression extends Node {} | 349 abstract type Expression extends Node {} |
347 | 350 |
348 type InvalidExpression extends Expression { | 351 type InvalidExpression extends Expression { |
349 Byte tag = 19; | 352 Byte tag = 19; |
350 } | 353 } |
351 | 354 |
352 type VariableGet extends Expression { | 355 type VariableGet extends Expression { |
353 Byte tag = 20; | 356 Byte tag = 20; |
354 FileOffset fileOffset; | 357 FileOffset fileOffset; |
355 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration. | 358 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration (without tag). |
356 VariableReference variable; | 359 VariableReference variable; |
357 } | 360 } |
358 | 361 |
359 type SpecializedVariableGet extends Expression { | 362 type SpecializedVariableGet extends Expression { |
360 Byte tag = 128 + N; // Where 0 <= N < 8. | 363 Byte tag = 128 + N; // Where 0 <= N < 8. |
361 // Equivalent to a VariableGet with index N. | 364 // Equivalent to a VariableGet with index N. |
362 FileOffset fileOffset; | 365 FileOffset fileOffset; |
363 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration. | 366 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration (without tag). |
364 } | 367 } |
365 | 368 |
366 type VariableSet extends Expression { | 369 type VariableSet extends Expression { |
367 Byte tag = 21; | 370 Byte tag = 21; |
368 FileOffset fileOffset; | 371 FileOffset fileOffset; |
369 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration. | 372 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration (without tag). |
370 VariableReference variable; | 373 VariableReference variable; |
371 Expression value; | 374 Expression value; |
372 } | 375 } |
373 | 376 |
374 type SpecializedVariableSet extends Expression { | 377 type SpecializedVariableSet extends Expression { |
375 Byte tag = 136 + N; // Where 0 <= N < 8. | 378 Byte tag = 136 + N; // Where 0 <= N < 8. |
376 FileOffset fileOffset; | 379 FileOffset fileOffset; |
377 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration. | 380 UInt variableDeclarationPosition; // Byte offset in the binary for the variabl e declaration (without tag). |
378 Expression value; | 381 Expression value; |
379 // Equivalent to VariableSet with index N. | 382 // Equivalent to VariableSet with index N. |
380 } | 383 } |
381 | 384 |
382 type PropertyGet extends Expression { | 385 type PropertyGet extends Expression { |
383 Byte tag = 22; | 386 Byte tag = 22; |
384 FileOffset fileOffset; | 387 FileOffset fileOffset; |
385 Expression receiver; | 388 Expression receiver; |
386 Name name; | 389 Name name; |
387 MemberReference interfaceTarget; // May be NullReference. | 390 MemberReference interfaceTarget; // May be NullReference. |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
972 Byte tag = 88; | 975 Byte tag = 88; |
973 } | 976 } |
974 | 977 |
975 type TypeParameter { | 978 type TypeParameter { |
976 // Note: there is no tag on TypeParameter | 979 // Note: there is no tag on TypeParameter |
977 StringReference name; // Cosmetic, may be empty, not unique. | 980 StringReference name; // Cosmetic, may be empty, not unique. |
978 DartType bound; // 'dynamic' if no explicit bound was given. | 981 DartType bound; // 'dynamic' if no explicit bound was given. |
979 } | 982 } |
980 | 983 |
981 ``` | 984 ``` |
OLD | NEW |