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

Side by Side Diff: runtime/bin/gen_snapshot.cc

Issue 1998963003: Rework standalone to use a synchronous loader that does not invoke Dart code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 4
5 // Generate a snapshot file after loading all the scripts specified on the 5 // Generate a snapshot file after loading all the scripts specified on the
6 // command line. 6 // command line.
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 static Dart_Handle LoadGenericSnapshotCreationScript( 591 static Dart_Handle LoadGenericSnapshotCreationScript(
592 Builtin::BuiltinLibraryId id) { 592 Builtin::BuiltinLibraryId id) {
593 Dart_Handle source = Builtin::Source(id); 593 Dart_Handle source = Builtin::Source(id);
594 if (Dart_IsError(source)) { 594 if (Dart_IsError(source)) {
595 return source; // source contains the error string. 595 return source; // source contains the error string.
596 } 596 }
597 Dart_Handle lib; 597 Dart_Handle lib;
598 // Load the builtin library to make it available in the snapshot 598 // Load the builtin library to make it available in the snapshot
599 // for importing. 599 // for importing.
600 lib = Builtin::LoadAndCheckLibrary(id); 600 lib = Builtin::LoadAndCheckLibrary(id);
601 if (Dart_IsError(lib)) {
602 fprintf(stderr, "%s", Dart_GetError(lib));
turnidge 2016/06/03 17:50:25 Debug stuff....
Cutch 2016/06/03 22:07:32 Done.
603 }
601 ASSERT(!Dart_IsError(lib)); 604 ASSERT(!Dart_IsError(lib));
602 return lib; 605 return lib;
603 } 606 }
604 607
605 608
606 static void PrintUsage() { 609 static void PrintUsage() {
607 Log::PrintErr( 610 Log::PrintErr(
608 "Usage: \n" 611 "Usage: \n"
609 " gen_snapshot [<vm-flags>] [<options>] [<dart-script-file>] \n" 612 " gen_snapshot [<vm-flags>] [<options>] [<dart-script-file>] \n"
610 " \n" 613 " \n"
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 EventHandler::Stop(); 1351 EventHandler::Stop();
1349 return 0; 1352 return 0;
1350 } 1353 }
1351 1354
1352 } // namespace bin 1355 } // namespace bin
1353 } // namespace dart 1356 } // namespace dart
1354 1357
1355 int main(int argc, char** argv) { 1358 int main(int argc, char** argv) {
1356 return dart::bin::main(argc, argv); 1359 return dart::bin::main(argc, argv);
1357 } 1360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698