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

Side by Side Diff: pkg/kernel/lib/binary/ast_to_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 | « pkg/kernel/lib/binary/ast_from_binary.dart ('k') | no next file » | 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_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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 writeNode(annotation); 373 writeNode(annotation);
374 } 374 }
375 375
376 void writeAnnotationList(List<Expression> annotations) { 376 void writeAnnotationList(List<Expression> annotations) {
377 writeList(annotations, writeAnnotation); 377 writeList(annotations, writeAnnotation);
378 } 378 }
379 379
380 int _encodeClassFlags(bool isAbstract, bool isEnum, 380 int _encodeClassFlags(bool isAbstract, bool isEnum,
381 bool isSyntheticMixinImplementation, ClassLevel level) { 381 bool isSyntheticMixinImplementation, ClassLevel level) {
382 int abstractFlag = isAbstract ? 1 : 0; 382 int abstractFlag = isAbstract ? 1 : 0;
383 int isEnumFlag = isSyntheticMixinImplementation ? 2 : 0; 383 int isEnumFlag = isEnum ? 2 : 0;
384 int isSyntheticMixinImplementationFlag = 384 int isSyntheticMixinImplementationFlag =
385 isSyntheticMixinImplementation ? 4 : 0; 385 isSyntheticMixinImplementation ? 4 : 0;
386 int levelFlags = (level.index - 1) << 3; 386 int levelFlags = (level.index - 1) << 3;
387 return abstractFlag | 387 return abstractFlag |
388 isEnumFlag | 388 isEnumFlag |
389 isSyntheticMixinImplementationFlag | 389 isSyntheticMixinImplementationFlag |
390 levelFlags; 390 levelFlags;
391 } 391 }
392 392
393 visitClass(Class node) { 393 visitClass(Class node) {
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 _sink.add(_buffer.sublist(0, length)); 1553 _sink.add(_buffer.sublist(0, length));
1554 _buffer = new Uint8List(SIZE); 1554 _buffer = new Uint8List(SIZE);
1555 flushedLength += length; 1555 flushedLength += length;
1556 length = 0; 1556 length = 0;
1557 } 1557 }
1558 1558
1559 void flushAndDestroy() { 1559 void flushAndDestroy() {
1560 _sink.add(_buffer.sublist(0, length)); 1560 _sink.add(_buffer.sublist(0, length));
1561 } 1561 }
1562 } 1562 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_from_binary.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698