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

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

Issue 3008843002: Fixes for AST <-> binary serialization. (Closed)
Patch Set: Created 3 years, 3 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 | « no previous file | 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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 } 1269 }
1270 1270
1271 VariableDeclaration readVariableDeclaration() { 1271 VariableDeclaration readVariableDeclaration() {
1272 int offset = readOffset(); 1272 int offset = readOffset();
1273 int fileEqualsOffset = readOffset(); 1273 int fileEqualsOffset = readOffset();
1274 int flags = readByte(); 1274 int flags = readByte();
1275 return new VariableDeclaration(readStringOrNullIfEmpty(), 1275 return new VariableDeclaration(readStringOrNullIfEmpty(),
1276 type: readDartType(), 1276 type: readDartType(),
1277 initializer: readExpressionOption(), 1277 initializer: readExpressionOption(),
1278 isFinal: flags & 0x1 != 0, 1278 isFinal: flags & 0x1 != 0,
1279 isConst: flags & 0x2 != 0) 1279 isConst: flags & 0x2 != 0,
1280 isFieldFormal: flags & 04 != 0)
1280 ..fileOffset = offset 1281 ..fileOffset = offset
1281 ..fileEqualsOffset = fileEqualsOffset; 1282 ..fileEqualsOffset = fileEqualsOffset;
1282 } 1283 }
1283 1284
1284 int readOffset() { 1285 int readOffset() {
1285 // Offset is saved as unsigned, 1286 // Offset is saved as unsigned,
1286 // but actually ranges from -1 and up (thus the -1) 1287 // but actually ranges from -1 and up (thus the -1)
1287 return readUInt() - 1; 1288 return readUInt() - 1;
1288 } 1289 }
1289 } 1290 }
OLDNEW
« no previous file with comments | « no previous file | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698