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_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 Loading... |
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 Loading... |
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 } |
OLD | NEW |