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

Unified Diff: bin/gen_snapshot.cc

Issue 10387061: Resubmit change 7506. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/builtin.dart ('k') | bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/gen_snapshot.cc
===================================================================
--- bin/gen_snapshot.cc (revision 7508)
+++ bin/gen_snapshot.cc (working copy)
@@ -157,7 +157,6 @@
return Dart_LoadScript(url,
source,
- CreateSnapshotLibraryTagHandler,
import_map);
}
@@ -277,19 +276,29 @@
ASSERT(snapshot_filename != NULL);
// Load up the script before a snapshot is created.
if (app_script_name != NULL) {
+ // Set up the library tag handler for this isolate.
+ result = Dart_SetLibraryTagHandler(CreateSnapshotLibraryTagHandler);
+ if (Dart_IsError(result)) {
+ fprintf(stderr, "%s", Dart_GetError(result));
+ Dart_ExitScope();
+ Dart_ShutdownIsolate();
+ exit(255);
+ }
// Load the specified script.
library = LoadSnapshotCreationScript(app_script_name);
VerifyLoaded(library);
} else {
- // Load a dummy script as the script to setup the tag handler.
- Dart_Handle empty_string = Dart_NewString("");
- library = Dart_LoadScript(empty_string,
- empty_string,
- BuiltinLibraryTagHandler,
- Dart_Null());
- VerifyLoaded(library);
+ // Set up the library tag handler for this isolate.
+ result = Dart_SetLibraryTagHandler(BuiltinLibraryTagHandler);
+ if (Dart_IsError(result)) {
+ fprintf(stderr, "%s", Dart_GetError(result));
+ Dart_ExitScope();
+ Dart_ShutdownIsolate();
+ exit(255);
+ }
// This is a generic dart snapshot which needs builtin library setup.
- library = LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary);
+ Dart_Handle library =
+ LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary);
VerifyLoaded(library);
library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary);
VerifyLoaded(library);
« no previous file with comments | « bin/builtin.dart ('k') | bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698