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

Side by Side Diff: pkg/kernel/lib/binary/ast_to_binary.dart

Issue 2786083002: Read platform.dill in the VM. (Closed)
Patch Set: Allow main to be a field or getter. Created 3 years, 8 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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void writeCanonicalNameEntry(CanonicalName node) { 139 void writeCanonicalNameEntry(CanonicalName node) {
140 var parent = node.parent; 140 var parent = node.parent;
141 if (parent.isRoot) { 141 if (parent.isRoot) {
142 writeByte(0); 142 writeByte(0);
143 } else { 143 } else {
144 writeUInt30(parent.index + 1); 144 writeUInt30(parent.index + 1);
145 } 145 }
146 writeStringReference(node.name); 146 writeStringReference(node.name);
147 } 147 }
148 148
149 StringIndexer get stringIndexer => _stringIndexer;
150 void flush() => _flush();
151
149 void writeProgramFile(Program program) { 152 void writeProgramFile(Program program) {
150 program.computeCanonicalNames(); 153 program.computeCanonicalNames();
151 writeMagicWord(Tag.ProgramFile); 154 writeMagicWord(Tag.ProgramFile);
152 _stringIndexer.scanProgram(program); 155 _stringIndexer.scanProgram(program);
153 writeStringTable(_stringIndexer); 156 writeStringTable(_stringIndexer);
154 writeUriToSource(program); 157 writeUriToSource(program);
155 writeLinkTable(program); 158 writeLinkTable(program);
156 writeList(program.libraries, writeNode); 159 writeList(program.libraries, writeNode);
157 writeMemberReference(program.mainMethod, allowNull: true); 160 writeMemberReference(program.mainMethod, allowNull: true);
158 _flush(); 161 _flush();
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 void flush() { 1300 void flush() {
1298 _sink.add(_buffer.sublist(0, length)); 1301 _sink.add(_buffer.sublist(0, length));
1299 _buffer = new Uint8List(SIZE); 1302 _buffer = new Uint8List(SIZE);
1300 length = 0; 1303 length = 0;
1301 } 1304 }
1302 1305
1303 void flushAndDestroy() { 1306 void flushAndDestroy() {
1304 _sink.add(_buffer.sublist(0, length)); 1307 _sink.add(_buffer.sublist(0, length));
1305 } 1308 }
1306 } 1309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698