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

Side by Side Diff: pkg/kernel/lib/binary/ast_from_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_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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 FunctionNode readFunctionNode() { 592 FunctionNode readFunctionNode() {
593 int tag = readByte(); 593 int tag = readByte();
594 assert(tag == Tag.FunctionNode); 594 assert(tag == Tag.FunctionNode);
595 int offset = readOffset(); 595 int offset = readOffset();
596 int endOffset = readOffset(); 596 int endOffset = readOffset();
597 AsyncMarker asyncMarker = AsyncMarker.values[readByte()]; 597 AsyncMarker asyncMarker = AsyncMarker.values[readByte()];
598 AsyncMarker dartAsyncMarker = AsyncMarker.values[readByte()]; 598 AsyncMarker dartAsyncMarker = AsyncMarker.values[readByte()];
599 int typeParameterStackHeight = typeParameterStack.length; 599 int typeParameterStackHeight = typeParameterStack.length;
600 var typeParameters = readAndPushTypeParameterList(); 600 var typeParameters = readAndPushTypeParameterList();
601 var requiredParameterCount = readUInt(); 601 var requiredParameterCount = readUInt();
602 readUInt(); // total parameter count.
602 int variableStackHeight = variableStack.length; 603 int variableStackHeight = variableStack.length;
603 var positional = readAndPushVariableDeclarationList(); 604 var positional = readAndPushVariableDeclarationList();
604 var named = readAndPushVariableDeclarationList(); 605 var named = readAndPushVariableDeclarationList();
605 var returnType = readDartType(); 606 var returnType = readDartType();
606 int oldLabelStackBase = labelStackBase; 607 int oldLabelStackBase = labelStackBase;
607 labelStackBase = labelStack.length; 608 labelStackBase = labelStack.length;
608 var body = readStatementOption(); 609 var body = readStatementOption();
609 labelStackBase = oldLabelStackBase; 610 labelStackBase = oldLabelStackBase;
610 variableStack.length = variableStackHeight; 611 variableStack.length = variableStackHeight;
611 typeParameterStack.length = typeParameterStackHeight; 612 typeParameterStack.length = typeParameterStackHeight;
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 ..fileOffset = offset 1178 ..fileOffset = offset
1178 ..fileEqualsOffset = fileEqualsOffset; 1179 ..fileEqualsOffset = fileEqualsOffset;
1179 } 1180 }
1180 1181
1181 int readOffset() { 1182 int readOffset() {
1182 // Offset is saved as unsigned, 1183 // Offset is saved as unsigned,
1183 // but actually ranges from -1 and up (thus the -1) 1184 // but actually ranges from -1 and up (thus the -1)
1184 return readUInt() - 1; 1185 return readUInt() - 1;
1185 } 1186 }
1186 } 1187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698