Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: pkg/kernel/lib/binary/ast_to_binary.dart

Issue 2901533002: [kernel] Stream everything. Replace .kernel_function with .kernel_offset (Closed)
Patch Set: Fixed assert issues; small refactorings. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 var oldCases = _switchCaseIndexer; 432 var oldCases = _switchCaseIndexer;
433 _switchCaseIndexer = new SwitchCaseIndexer(); 433 _switchCaseIndexer = new SwitchCaseIndexer();
434 // Note: FunctionNode has no tag. 434 // Note: FunctionNode has no tag.
435 _typeParameterIndexer.enter(node.typeParameters); 435 _typeParameterIndexer.enter(node.typeParameters);
436 writeOffset(node.fileOffset); 436 writeOffset(node.fileOffset);
437 writeOffset(node.fileEndOffset); 437 writeOffset(node.fileEndOffset);
438 writeByte(node.asyncMarker.index); 438 writeByte(node.asyncMarker.index);
439 writeByte(node.dartAsyncMarker.index); 439 writeByte(node.dartAsyncMarker.index);
440 writeNodeList(node.typeParameters); 440 writeNodeList(node.typeParameters);
441 writeUInt30(node.requiredParameterCount); 441 writeUInt30(node.requiredParameterCount);
442 writeUInt30(node.positionalParameters.length + node.namedParameters.length);
442 writeVariableDeclarationList(node.positionalParameters); 443 writeVariableDeclarationList(node.positionalParameters);
443 writeVariableDeclarationList(node.namedParameters); 444 writeVariableDeclarationList(node.namedParameters);
444 writeNode(node.returnType); 445 writeNode(node.returnType);
445 writeOptionalNode(node.body); 446 writeOptionalNode(node.body);
446 _labelIndexer = oldLabels; 447 _labelIndexer = oldLabels;
447 _switchCaseIndexer = oldCases; 448 _switchCaseIndexer = oldCases;
448 _typeParameterIndexer.exit(node.typeParameters); 449 _typeParameterIndexer.exit(node.typeParameters);
449 _variableIndexer.popScope(); 450 _variableIndexer.popScope();
450 } 451 }
451 452
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 _sink.add(_buffer.sublist(0, length)); 1398 _sink.add(_buffer.sublist(0, length));
1398 _buffer = new Uint8List(SIZE); 1399 _buffer = new Uint8List(SIZE);
1399 flushedLength += length; 1400 flushedLength += length;
1400 length = 0; 1401 length = 0;
1401 } 1402 }
1402 1403
1403 void flushAndDestroy() { 1404 void flushAndDestroy() {
1404 _sink.add(_buffer.sublist(0, length)); 1405 _sink.add(_buffer.sublist(0, length));
1405 } 1406 }
1406 } 1407 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698