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

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

Issue 2931813002: [kernel] Stream kernel_reader (Closed)
Patch Set: Feedback 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
« no previous file with comments | « pkg/kernel/binary.md ('k') | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 return new FunctionType(positional, returnType, 1115 return new FunctionType(positional, returnType,
1116 typeParameters: typeParameters, 1116 typeParameters: typeParameters,
1117 requiredParameterCount: requiredParameterCount, 1117 requiredParameterCount: requiredParameterCount,
1118 namedParameters: named); 1118 namedParameters: named);
1119 case Tag.SimpleFunctionType: 1119 case Tag.SimpleFunctionType:
1120 var positional = readDartTypeList(); 1120 var positional = readDartTypeList();
1121 var returnType = readDartType(); 1121 var returnType = readDartType();
1122 return new FunctionType(positional, returnType); 1122 return new FunctionType(positional, returnType);
1123 case Tag.TypeParameterType: 1123 case Tag.TypeParameterType:
1124 int index = readUInt(); 1124 int index = readUInt();
1125 readUInt(); // offset of the TypeParameter declaration in the binary. 1125 readUInt(); // offset of parameter list in the binary.
1126 readUInt(); // index in the list.
1126 var bound = readDartTypeOption(); 1127 var bound = readDartTypeOption();
1127 return new TypeParameterType(typeParameterStack[index], bound); 1128 return new TypeParameterType(typeParameterStack[index], bound);
1128 default: 1129 default:
1129 throw fail('Invalid dart type tag: $tag'); 1130 throw fail('Invalid dart type tag: $tag');
1130 } 1131 }
1131 } 1132 }
1132 1133
1133 List<TypeParameter> readAndPushTypeParameterList( 1134 List<TypeParameter> readAndPushTypeParameterList(
1134 [List<TypeParameter> list, TreeNode parent]) { 1135 [List<TypeParameter> list, TreeNode parent]) {
1135 int length = readUInt(); 1136 int length = readUInt();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 ..fileOffset = offset 1201 ..fileOffset = offset
1201 ..fileEqualsOffset = fileEqualsOffset; 1202 ..fileEqualsOffset = fileEqualsOffset;
1202 } 1203 }
1203 1204
1204 int readOffset() { 1205 int readOffset() {
1205 // Offset is saved as unsigned, 1206 // Offset is saved as unsigned,
1206 // but actually ranges from -1 and up (thus the -1) 1207 // but actually ranges from -1 and up (thus the -1)
1207 return readUInt() - 1; 1208 return readUInt() - 1;
1208 } 1209 }
1209 } 1210 }
OLDNEW
« no previous file with comments | « pkg/kernel/binary.md ('k') | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698