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

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

Issue 1653143002: Fix gen snapshot code to use Dart_LoadLibrary instead of Dart_LoadScript so that the root library v… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 Dart_Handle script_path = FilePathFromUri( 442 Dart_Handle script_path = FilePathFromUri(
443 DartUtils::GetStringValue(resolved_script_uri)); 443 DartUtils::GetStringValue(resolved_script_uri));
444 if (Dart_IsError(script_path)) { 444 if (Dart_IsError(script_path)) {
445 return script_path; 445 return script_path;
446 } 446 }
447 Dart_Handle source = DartUtils::ReadStringFromFile( 447 Dart_Handle source = DartUtils::ReadStringFromFile(
448 DartUtils::GetStringValue(script_path)); 448 DartUtils::GetStringValue(script_path));
449 if (Dart_IsError(source)) { 449 if (Dart_IsError(source)) {
450 return source; 450 return source;
451 } 451 }
452 return Dart_LoadScript(resolved_script_uri, source, 0, 0); 452 return Dart_LoadLibrary(resolved_script_uri, source, 0, 0);
453 } 453 }
454 454
455 455
456 static Dart_Handle LoadGenericSnapshotCreationScript( 456 static Dart_Handle LoadGenericSnapshotCreationScript(
457 Builtin::BuiltinLibraryId id) { 457 Builtin::BuiltinLibraryId id) {
458 Dart_Handle source = Builtin::Source(id); 458 Dart_Handle source = Builtin::Source(id);
459 if (Dart_IsError(source)) { 459 if (Dart_IsError(source)) {
460 return source; // source contains the error string. 460 return source; // source contains the error string.
461 } 461 }
462 Dart_Handle lib; 462 Dart_Handle lib;
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 EventHandler::Stop(); 1151 EventHandler::Stop();
1152 return 0; 1152 return 0;
1153 } 1153 }
1154 1154
1155 } // namespace bin 1155 } // namespace bin
1156 } // namespace dart 1156 } // namespace dart
1157 1157
1158 int main(int argc, char** argv) { 1158 int main(int argc, char** argv) {
1159 return dart::bin::main(argc, argv); 1159 return dart::bin::main(argc, argv);
1160 } 1160 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698