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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 var index = readUInt(); | 925 var index = readUInt(); |
926 var value = readExpression(); | 926 var value = readExpression(); |
927 return new VectorSet(vectorExpression, index, value); | 927 return new VectorSet(vectorExpression, index, value); |
928 case Tag.VectorCopy: | 928 case Tag.VectorCopy: |
929 var vectorExpression = readExpression(); | 929 var vectorExpression = readExpression(); |
930 return new VectorCopy(vectorExpression); | 930 return new VectorCopy(vectorExpression); |
931 case Tag.ClosureCreation: | 931 case Tag.ClosureCreation: |
932 var topLevelFunctionReference = readMemberReference(); | 932 var topLevelFunctionReference = readMemberReference(); |
933 var contextVector = readExpression(); | 933 var contextVector = readExpression(); |
934 var functionType = readDartType(); | 934 var functionType = readDartType(); |
| 935 var typeArgs = readDartTypeList(); |
935 return new ClosureCreation.byReference( | 936 return new ClosureCreation.byReference( |
936 topLevelFunctionReference, contextVector, functionType); | 937 topLevelFunctionReference, contextVector, functionType, typeArgs); |
937 default: | 938 default: |
938 throw fail('Invalid expression tag: $tag'); | 939 throw fail('Invalid expression tag: $tag'); |
939 } | 940 } |
940 } | 941 } |
941 | 942 |
942 List<MapEntry> readMapEntryList() { | 943 List<MapEntry> readMapEntryList() { |
943 return new List<MapEntry>.generate(readUInt(), (i) => readMapEntry()); | 944 return new List<MapEntry>.generate(readUInt(), (i) => readMapEntry()); |
944 } | 945 } |
945 | 946 |
946 MapEntry readMapEntry() { | 947 MapEntry readMapEntry() { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 ..fileOffset = offset | 1243 ..fileOffset = offset |
1243 ..fileEqualsOffset = fileEqualsOffset; | 1244 ..fileEqualsOffset = fileEqualsOffset; |
1244 } | 1245 } |
1245 | 1246 |
1246 int readOffset() { | 1247 int readOffset() { |
1247 // Offset is saved as unsigned, | 1248 // Offset is saved as unsigned, |
1248 // but actually ranges from -1 and up (thus the -1) | 1249 // but actually ranges from -1 and up (thus the -1) |
1249 return readUInt() - 1; | 1250 return readUInt() - 1; |
1250 } | 1251 } |
1251 } | 1252 } |
OLD | NEW |