| 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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 for (int i = 0; i < length; ++i) { | 982 for (int i = 0; i < length; ++i) { |
| 983 writeOffset(node.expressionOffsets[i]); | 983 writeOffset(node.expressionOffsets[i]); |
| 984 writeNode(node.expressions[i]); | 984 writeNode(node.expressions[i]); |
| 985 } | 985 } |
| 986 writeByte(node.isDefault ? 1 : 0); | 986 writeByte(node.isDefault ? 1 : 0); |
| 987 writeNode(node.body); | 987 writeNode(node.body); |
| 988 } | 988 } |
| 989 | 989 |
| 990 visitContinueSwitchStatement(ContinueSwitchStatement node) { | 990 visitContinueSwitchStatement(ContinueSwitchStatement node) { |
| 991 writeByte(Tag.ContinueSwitchStatement); | 991 writeByte(Tag.ContinueSwitchStatement); |
| 992 writeOffset(node.fileOffset); |
| 992 writeUInt30(_switchCaseIndexer[node.target]); | 993 writeUInt30(_switchCaseIndexer[node.target]); |
| 993 } | 994 } |
| 994 | 995 |
| 995 visitIfStatement(IfStatement node) { | 996 visitIfStatement(IfStatement node) { |
| 996 writeByte(Tag.IfStatement); | 997 writeByte(Tag.IfStatement); |
| 997 writeNode(node.condition); | 998 writeNode(node.condition); |
| 998 writeNode(node.then); | 999 writeNode(node.then); |
| 999 writeStatementOrEmpty(node.otherwise); | 1000 writeStatementOrEmpty(node.otherwise); |
| 1000 } | 1001 } |
| 1001 | 1002 |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 _sink.add(_buffer.sublist(0, length)); | 1553 _sink.add(_buffer.sublist(0, length)); |
| 1553 _buffer = new Uint8List(SIZE); | 1554 _buffer = new Uint8List(SIZE); |
| 1554 flushedLength += length; | 1555 flushedLength += length; |
| 1555 length = 0; | 1556 length = 0; |
| 1556 } | 1557 } |
| 1557 | 1558 |
| 1558 void flushAndDestroy() { | 1559 void flushAndDestroy() { |
| 1559 _sink.add(_buffer.sublist(0, length)); | 1560 _sink.add(_buffer.sublist(0, length)); |
| 1560 } | 1561 } |
| 1561 } | 1562 } |
| OLD | NEW |