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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 | 610 |
611 FunctionNode readFunctionNode() { | 611 FunctionNode readFunctionNode() { |
612 int tag = readByte(); | 612 int tag = readByte(); |
613 assert(tag == Tag.FunctionNode); | 613 assert(tag == Tag.FunctionNode); |
614 int offset = readOffset(); | 614 int offset = readOffset(); |
615 int endOffset = readOffset(); | 615 int endOffset = readOffset(); |
616 AsyncMarker asyncMarker = AsyncMarker.values[readByte()]; | 616 AsyncMarker asyncMarker = AsyncMarker.values[readByte()]; |
617 AsyncMarker dartAsyncMarker = AsyncMarker.values[readByte()]; | 617 AsyncMarker dartAsyncMarker = AsyncMarker.values[readByte()]; |
618 int typeParameterStackHeight = typeParameterStack.length; | 618 int typeParameterStackHeight = typeParameterStack.length; |
619 var typeParameters = readAndPushTypeParameterList(); | 619 var typeParameters = readAndPushTypeParameterList(); |
620 readUInt(); // total parameter count. | |
621 var requiredParameterCount = readUInt(); | 620 var requiredParameterCount = readUInt(); |
622 int variableStackHeight = variableStack.length; | 621 int variableStackHeight = variableStack.length; |
623 var positional = readAndPushVariableDeclarationList(); | 622 var positional = readAndPushVariableDeclarationList(); |
624 var named = readAndPushVariableDeclarationList(); | 623 var named = readAndPushVariableDeclarationList(); |
625 var returnType = readDartType(); | 624 var returnType = readDartType(); |
626 int oldLabelStackBase = labelStackBase; | 625 int oldLabelStackBase = labelStackBase; |
627 labelStackBase = labelStack.length; | 626 labelStackBase = labelStack.length; |
628 var body = readStatementOption(); | 627 var body = readStatementOption(); |
629 labelStackBase = oldLabelStackBase; | 628 labelStackBase = oldLabelStackBase; |
630 variableStack.length = variableStackHeight; | 629 variableStack.length = variableStackHeight; |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 ..fileOffset = offset | 1196 ..fileOffset = offset |
1198 ..fileEqualsOffset = fileEqualsOffset; | 1197 ..fileEqualsOffset = fileEqualsOffset; |
1199 } | 1198 } |
1200 | 1199 |
1201 int readOffset() { | 1200 int readOffset() { |
1202 // Offset is saved as unsigned, | 1201 // Offset is saved as unsigned, |
1203 // but actually ranges from -1 and up (thus the -1) | 1202 // but actually ranges from -1 and up (thus the -1) |
1204 return readUInt() - 1; | 1203 return readUInt() - 1; |
1205 } | 1204 } |
1206 } | 1205 } |
OLD | NEW |