OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 library kernel.ast_from_binary; | 4 library kernel.ast_from_binary; |
5 | 5 |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
8 | 8 |
9 import '../ast.dart'; | 9 import '../ast.dart'; |
10 import '../transformations/flags.dart'; | 10 import '../transformations/flags.dart'; |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 positionalParameterNames: positionalNames, | 1195 positionalParameterNames: positionalNames, |
1196 typedefReference: typedefReference); | 1196 typedefReference: typedefReference); |
1197 case Tag.SimpleFunctionType: | 1197 case Tag.SimpleFunctionType: |
1198 var positional = readDartTypeList(); | 1198 var positional = readDartTypeList(); |
1199 var positionalNames = readStringReferenceList(); | 1199 var positionalNames = readStringReferenceList(); |
1200 var returnType = readDartType(); | 1200 var returnType = readDartType(); |
1201 return new FunctionType(positional, returnType, | 1201 return new FunctionType(positional, returnType, |
1202 positionalParameterNames: positionalNames); | 1202 positionalParameterNames: positionalNames); |
1203 case Tag.TypeParameterType: | 1203 case Tag.TypeParameterType: |
1204 int index = readUInt(); | 1204 int index = readUInt(); |
1205 readUInt(); // offset of parameter list in the binary. | |
1206 readUInt(); // index in the list. | |
1207 var bound = readDartTypeOption(); | 1205 var bound = readDartTypeOption(); |
1208 return new TypeParameterType(typeParameterStack[index], bound); | 1206 return new TypeParameterType(typeParameterStack[index], bound); |
1209 default: | 1207 default: |
1210 throw fail('Invalid dart type tag: $tag'); | 1208 throw fail('Invalid dart type tag: $tag'); |
1211 } | 1209 } |
1212 } | 1210 } |
1213 | 1211 |
1214 List<TypeParameter> readAndPushTypeParameterList( | 1212 List<TypeParameter> readAndPushTypeParameterList( |
1215 [List<TypeParameter> list, TreeNode parent]) { | 1213 [List<TypeParameter> list, TreeNode parent]) { |
1216 int length = readUInt(); | 1214 int length = readUInt(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 ..fileOffset = offset | 1279 ..fileOffset = offset |
1282 ..fileEqualsOffset = fileEqualsOffset; | 1280 ..fileEqualsOffset = fileEqualsOffset; |
1283 } | 1281 } |
1284 | 1282 |
1285 int readOffset() { | 1283 int readOffset() { |
1286 // Offset is saved as unsigned, | 1284 // Offset is saved as unsigned, |
1287 // but actually ranges from -1 and up (thus the -1) | 1285 // but actually ranges from -1 and up (thus the -1) |
1288 return readUInt() - 1; | 1286 return readUInt() - 1; |
1289 } | 1287 } |
1290 } | 1288 } |
OLD | NEW |