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_to_binary; | 4 library kernel.ast_to_binary; |
5 | 5 |
6 import '../ast.dart'; | 6 import '../ast.dart'; |
7 import '../import_table.dart'; | 7 import '../import_table.dart'; |
8 import 'tag.dart'; | 8 import 'tag.dart'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:typed_data'; | 10 import 'dart:typed_data'; |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 _labelIndexer = new LabelIndexer(); | 475 _labelIndexer = new LabelIndexer(); |
476 var oldCases = _switchCaseIndexer; | 476 var oldCases = _switchCaseIndexer; |
477 _switchCaseIndexer = new SwitchCaseIndexer(); | 477 _switchCaseIndexer = new SwitchCaseIndexer(); |
478 // Note: FunctionNode has no tag. | 478 // Note: FunctionNode has no tag. |
479 _typeParameterIndexer.enter(node.typeParameters); | 479 _typeParameterIndexer.enter(node.typeParameters); |
480 writeOffset(node.fileOffset); | 480 writeOffset(node.fileOffset); |
481 writeOffset(node.fileEndOffset); | 481 writeOffset(node.fileEndOffset); |
482 writeByte(node.asyncMarker.index); | 482 writeByte(node.asyncMarker.index); |
483 writeByte(node.dartAsyncMarker.index); | 483 writeByte(node.dartAsyncMarker.index); |
484 writeNodeList(node.typeParameters); | 484 writeNodeList(node.typeParameters); |
| 485 writeUInt30(node.positionalParameters.length + node.namedParameters.length); |
485 writeUInt30(node.requiredParameterCount); | 486 writeUInt30(node.requiredParameterCount); |
486 writeVariableDeclarationList(node.positionalParameters); | 487 writeVariableDeclarationList(node.positionalParameters); |
487 writeVariableDeclarationList(node.namedParameters); | 488 writeVariableDeclarationList(node.namedParameters); |
488 writeNode(node.returnType); | 489 writeNode(node.returnType); |
489 writeOptionalNode(node.body); | 490 writeOptionalNode(node.body); |
490 _labelIndexer = oldLabels; | 491 _labelIndexer = oldLabels; |
491 _switchCaseIndexer = oldCases; | 492 _switchCaseIndexer = oldCases; |
492 _typeParameterIndexer.exit(node.typeParameters); | 493 _typeParameterIndexer.exit(node.typeParameters); |
493 _variableIndexer.popScope(); | 494 _variableIndexer.popScope(); |
494 } | 495 } |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 _sink.add(_buffer.sublist(0, length)); | 1463 _sink.add(_buffer.sublist(0, length)); |
1463 _buffer = new Uint8List(SIZE); | 1464 _buffer = new Uint8List(SIZE); |
1464 flushedLength += length; | 1465 flushedLength += length; |
1465 length = 0; | 1466 length = 0; |
1466 } | 1467 } |
1467 | 1468 |
1468 void flushAndDestroy() { | 1469 void flushAndDestroy() { |
1469 _sink.add(_buffer.sublist(0, length)); | 1470 _sink.add(_buffer.sublist(0, length)); |
1470 } | 1471 } |
1471 } | 1472 } |
OLD | NEW |