| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 var index = readUInt(); | 821 var index = readUInt(); |
| 822 return new VectorGet(vectorExpression, index); | 822 return new VectorGet(vectorExpression, index); |
| 823 case Tag.VectorSet: | 823 case Tag.VectorSet: |
| 824 var vectorExpression = readExpression(); | 824 var vectorExpression = readExpression(); |
| 825 var index = readUInt(); | 825 var index = readUInt(); |
| 826 var value = readExpression(); | 826 var value = readExpression(); |
| 827 return new VectorSet(vectorExpression, index, value); | 827 return new VectorSet(vectorExpression, index, value); |
| 828 case Tag.VectorCopy: | 828 case Tag.VectorCopy: |
| 829 var vectorExpression = readExpression(); | 829 var vectorExpression = readExpression(); |
| 830 return new VectorCopy(vectorExpression); | 830 return new VectorCopy(vectorExpression); |
| 831 case Tag.ClosureCreation: |
| 832 var topLevelFunctionName = readStringReference(); |
| 833 var contextVector = readExpression(); |
| 834 var functionType = readDartType(); |
| 835 return new ClosureCreation( |
| 836 topLevelFunctionName, contextVector, functionType); |
| 831 default: | 837 default: |
| 832 throw fail('Invalid expression tag: $tag'); | 838 throw fail('Invalid expression tag: $tag'); |
| 833 } | 839 } |
| 834 } | 840 } |
| 835 | 841 |
| 836 List<MapEntry> readMapEntryList() { | 842 List<MapEntry> readMapEntryList() { |
| 837 return new List<MapEntry>.generate(readUInt(), (i) => readMapEntry()); | 843 return new List<MapEntry>.generate(readUInt(), (i) => readMapEntry()); |
| 838 } | 844 } |
| 839 | 845 |
| 840 MapEntry readMapEntry() { | 846 MapEntry readMapEntry() { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 ..fileOffset = offset | 1125 ..fileOffset = offset |
| 1120 ..fileEqualsOffset = fileEqualsOffset; | 1126 ..fileEqualsOffset = fileEqualsOffset; |
| 1121 } | 1127 } |
| 1122 | 1128 |
| 1123 int readOffset() { | 1129 int readOffset() { |
| 1124 // Offset is saved as unsigned, | 1130 // Offset is saved as unsigned, |
| 1125 // but actually ranges from -1 and up (thus the -1) | 1131 // but actually ranges from -1 and up (thus the -1) |
| 1126 return readUInt() - 1; | 1132 return readUInt() - 1; |
| 1127 } | 1133 } |
| 1128 } | 1134 } |
| OLD | NEW |