| 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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 : predicate = predicate, | 1031 : predicate = predicate, |
| 1032 super(sink); | 1032 super(sink); |
| 1033 | 1033 |
| 1034 void writeProgramFile(Program program) { | 1034 void writeProgramFile(Program program) { |
| 1035 program.computeCanonicalNames(); | 1035 program.computeCanonicalNames(); |
| 1036 writeMagicWord(Tag.ProgramFile); | 1036 writeMagicWord(Tag.ProgramFile); |
| 1037 _stringIndexer.scanProgram(program); | 1037 _stringIndexer.scanProgram(program); |
| 1038 writeStringTable(_stringIndexer); | 1038 writeStringTable(_stringIndexer); |
| 1039 writeUriToSource(program); | 1039 writeUriToSource(program); |
| 1040 writeLinkTable(program); | 1040 writeLinkTable(program); |
| 1041 writeList(program.libraries.where(predicate), writeNode); | 1041 writeList(program.libraries.where(predicate).toList(), writeNode); |
| 1042 writeMemberReference(program.mainMethod, allowNull: true); | 1042 writeMemberReference(program.mainMethod, allowNull: true); |
| 1043 _flush(); | 1043 _flush(); |
| 1044 } | 1044 } |
| 1045 } | 1045 } |
| 1046 | 1046 |
| 1047 class VariableIndexer { | 1047 class VariableIndexer { |
| 1048 final Map<VariableDeclaration, int> index = <VariableDeclaration, int>{}; | 1048 final Map<VariableDeclaration, int> index = <VariableDeclaration, int>{}; |
| 1049 final List<int> scopes = <int>[]; | 1049 final List<int> scopes = <int>[]; |
| 1050 int stackHeight = 0; | 1050 int stackHeight = 0; |
| 1051 | 1051 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 void flush() { | 1333 void flush() { |
| 1334 _sink.add(_buffer.sublist(0, length)); | 1334 _sink.add(_buffer.sublist(0, length)); |
| 1335 _buffer = new Uint8List(SIZE); | 1335 _buffer = new Uint8List(SIZE); |
| 1336 length = 0; | 1336 length = 0; |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 void flushAndDestroy() { | 1339 void flushAndDestroy() { |
| 1340 _sink.add(_buffer.sublist(0, length)); | 1340 _sink.add(_buffer.sublist(0, length)); |
| 1341 } | 1341 } |
| 1342 } | 1342 } |
| OLD | NEW |