| 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_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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 int tag = readByte(); | 438 int tag = readByte(); |
| 439 assert(tag == Tag.Class); | 439 assert(tag == Tag.Class); |
| 440 var canonicalName = readCanonicalNameReference(); | 440 var canonicalName = readCanonicalNameReference(); |
| 441 var reference = canonicalName.getReference(); | 441 var reference = canonicalName.getReference(); |
| 442 Class node = reference.node; | 442 Class node = reference.node; |
| 443 bool shouldWriteData = node == null || _isReadingLibraryImplementation; | 443 bool shouldWriteData = node == null || _isReadingLibraryImplementation; |
| 444 if (node == null) { | 444 if (node == null) { |
| 445 node = new Class(reference: reference)..level = ClassLevel.Temporary; | 445 node = new Class(reference: reference)..level = ClassLevel.Temporary; |
| 446 } | 446 } |
| 447 node.fileOffset = readOffset(); | 447 node.fileOffset = readOffset(); |
| 448 node.fileEndOffset = readOffset(); |
| 448 int flags = readByte(); | 449 int flags = readByte(); |
| 449 node.isAbstract = flags & 0x1 != 0; | 450 node.isAbstract = flags & 0x1 != 0; |
| 450 int levelIndex = (flags >> 1) & 0x3; | 451 int levelIndex = (flags >> 1) & 0x3; |
| 451 var level = ClassLevel.values[levelIndex + 1]; | 452 var level = ClassLevel.values[levelIndex + 1]; |
| 452 if (level.index >= node.level.index) { | 453 if (level.index >= node.level.index) { |
| 453 node.level = level; | 454 node.level = level; |
| 454 } | 455 } |
| 455 var name = readStringOrNullIfEmpty(); | 456 var name = readStringOrNullIfEmpty(); |
| 456 var fileUri = readUriReference(); | 457 var fileUri = readUriReference(); |
| 457 var annotations = readAnnotationList(node); | 458 var annotations = readAnnotationList(node); |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 ..fileOffset = offset | 1216 ..fileOffset = offset |
| 1216 ..fileEqualsOffset = fileEqualsOffset; | 1217 ..fileEqualsOffset = fileEqualsOffset; |
| 1217 } | 1218 } |
| 1218 | 1219 |
| 1219 int readOffset() { | 1220 int readOffset() { |
| 1220 // Offset is saved as unsigned, | 1221 // Offset is saved as unsigned, |
| 1221 // but actually ranges from -1 and up (thus the -1) | 1222 // but actually ranges from -1 and up (thus the -1) |
| 1222 return readUInt() - 1; | 1223 return readUInt() - 1; |
| 1223 } | 1224 } |
| 1224 } | 1225 } |
| OLD | NEW |