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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 Byte tag = 4; | 206 Byte tag = 4; |
207 CanonicalNameReference canonicalName; | 207 CanonicalNameReference canonicalName; |
208 FileOffset fileOffset; | 208 FileOffset fileOffset; |
209 FileOffset fileEndOffset; | 209 FileOffset fileEndOffset; |
210 Byte flags (isFinal, isConst, isStatic); | 210 Byte flags (isFinal, isConst, isStatic); |
211 Name name; | 211 Name name; |
212 // An absolute path URI to the .dart file from which the field was created. | 212 // An absolute path URI to the .dart file from which the field was created. |
213 UriReference fileUri; | 213 UriReference fileUri; |
214 List<Expression> annotations; | 214 List<Expression> annotations; |
215 DartType type; | 215 DartType type; |
216 Option<InferredValue> inferredValue; | |
217 Option<Expression> initializer; | 216 Option<Expression> initializer; |
218 } | 217 } |
219 | 218 |
220 type Constructor extends Member { | 219 type Constructor extends Member { |
221 Byte tag = 5; | 220 Byte tag = 5; |
222 CanonicalNameReference canonicalName; | 221 CanonicalNameReference canonicalName; |
223 FileOffset fileOffset; | 222 FileOffset fileOffset; |
224 FileOffset fileEndOffset; | 223 FileOffset fileEndOffset; |
225 Byte flags (isConst, isExternal); | 224 Byte flags (isConst, isExternal); |
226 Name name; | 225 Name name; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 // Note: there is no tag on FunctionNode. | 296 // Note: there is no tag on FunctionNode. |
298 FileOffset fileOffset; | 297 FileOffset fileOffset; |
299 FileOffset fileEndOffset; | 298 FileOffset fileEndOffset; |
300 Byte asyncMarker; // Index into AsyncMarker above. | 299 Byte asyncMarker; // Index into AsyncMarker above. |
301 Byte dartAsyncMarker; // Index into AsyncMarker above. | 300 Byte dartAsyncMarker; // Index into AsyncMarker above. |
302 List<TypeParameter> typeParameters; | 301 List<TypeParameter> typeParameters; |
303 UInt requiredParameterCount; | 302 UInt requiredParameterCount; |
304 List<VariableDeclaration> positionalParameters; | 303 List<VariableDeclaration> positionalParameters; |
305 List<VariableDeclaration> namedParameters; | 304 List<VariableDeclaration> namedParameters; |
306 DartType returnType; | 305 DartType returnType; |
307 Option<InferredValue> inferredReturnValue; | |
308 Option<Statement> body; | 306 Option<Statement> body; |
309 } | 307 } |
310 | 308 |
311 type VariableReference { | 309 type VariableReference { |
312 // Reference to the Nth variable in scope, with 0 being the | 310 // Reference to the Nth variable in scope, with 0 being the |
313 // first variable declared in the outermost scope, and larger | 311 // first variable declared in the outermost scope, and larger |
314 // numbers being the variables declared later in a given scope, | 312 // numbers being the variables declared later in a given scope, |
315 // or in a more deeply nested scope. | 313 // or in a more deeply nested scope. |
316 // | 314 // |
317 // Function parameters are indexed from left to right and make | 315 // Function parameters are indexed from left to right and make |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 // The offset for the equal sign in the declaration (if it contains one). | 840 // The offset for the equal sign in the declaration (if it contains one). |
843 // If it does not contain one this should be -1. | 841 // If it does not contain one this should be -1. |
844 FileOffset fileEqualsOffset; | 842 FileOffset fileEqualsOffset; |
845 | 843 |
846 Byte flags (isFinal, isConst); | 844 Byte flags (isFinal, isConst); |
847 // For named parameters, this is the parameter name. | 845 // For named parameters, this is the parameter name. |
848 // For other variables, the name is cosmetic, may be empty, | 846 // For other variables, the name is cosmetic, may be empty, |
849 // and is not necessarily unique. | 847 // and is not necessarily unique. |
850 StringReference name; | 848 StringReference name; |
851 DartType type; | 849 DartType type; |
852 Option<InferredValue> inferredValue; | |
853 | 850 |
854 // For statements and for-loops, this is the initial value. | 851 // For statements and for-loops, this is the initial value. |
855 // For optional parameters, this is the default value (if given). | 852 // For optional parameters, this is the default value (if given). |
856 // In all other contexts, it must be Nothing. | 853 // In all other contexts, it must be Nothing. |
857 Option<Expression> initializer; | 854 Option<Expression> initializer; |
858 } | 855 } |
859 | 856 |
860 type FunctionDeclaration extends Statement { | 857 type FunctionDeclaration extends Statement { |
861 Byte tag = 79; | 858 Byte tag = 79; |
862 FileOffset fileOffset; | 859 FileOffset fileOffset; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 type VectorType extends DartType { | 939 type VectorType extends DartType { |
943 Byte tag = 88; | 940 Byte tag = 88; |
944 } | 941 } |
945 | 942 |
946 type TypeParameter { | 943 type TypeParameter { |
947 // Note: there is no tag on TypeParameter | 944 // Note: there is no tag on TypeParameter |
948 StringReference name; // Cosmetic, may be empty, not unique. | 945 StringReference name; // Cosmetic, may be empty, not unique. |
949 DartType bound; // 'dynamic' if no explicit bound was given. | 946 DartType bound; // 'dynamic' if no explicit bound was given. |
950 } | 947 } |
951 | 948 |
952 /* enum BaseClassKind { None, Exact, Subclass, Subtype, } */ | |
953 | |
954 type InferredValue { | |
955 ClassReference baseClass; // May be NullReference if kind = None. | |
956 Byte kind; // Index into BaseClassKind. | |
957 Byte valueBits; // See lib/type_propagation/type_propagation.dart | |
958 } | |
959 | |
960 ``` | 949 ``` |
OLD | NEW |