| OLD | NEW |
| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // This is a generic dart snapshot which needs builtin library setup. | 421 // This is a generic dart snapshot which needs builtin library setup. |
| 422 Dart_Handle library = | 422 Dart_Handle library = |
| 423 LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary); | 423 LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary); |
| 424 VerifyLoaded(library); | 424 VerifyLoaded(library); |
| 425 } | 425 } |
| 426 | 426 |
| 427 | 427 |
| 428 static void SetupForGenericSnapshotCreation() { | 428 static void SetupForGenericSnapshotCreation() { |
| 429 SetupForUriResolution(); | 429 SetupForUriResolution(); |
| 430 | 430 |
| 431 // TODO(regis): Reenable this code for mips when possible. | |
| 432 #if defined(TARGET_ARCH_IA32) || \ | |
| 433 defined(TARGET_ARCH_X64) || \ | |
| 434 defined(TARGET_ARCH_ARM) | |
| 435 Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary); | 431 Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary); |
| 436 VerifyLoaded(library); | 432 VerifyLoaded(library); |
| 437 #endif | |
| 438 } | 433 } |
| 439 | 434 |
| 440 | 435 |
| 441 int main(int argc, char** argv) { | 436 int main(int argc, char** argv) { |
| 442 CommandLineOptions vm_options(argc); | 437 CommandLineOptions vm_options(argc); |
| 443 | 438 |
| 444 // Initialize the URL mapping array. | 439 // Initialize the URL mapping array. |
| 445 CommandLineOptions url_mapping_array(argc); | 440 CommandLineOptions url_mapping_array(argc); |
| 446 url_mapping = &url_mapping_array; | 441 url_mapping = &url_mapping_array; |
| 447 | 442 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 CreateAndWriteSnapshot(); | 516 CreateAndWriteSnapshot(); |
| 522 | 517 |
| 523 Dart_EnterIsolate(UriResolverIsolateScope::isolate); | 518 Dart_EnterIsolate(UriResolverIsolateScope::isolate); |
| 524 Dart_ShutdownIsolate(); | 519 Dart_ShutdownIsolate(); |
| 525 } else { | 520 } else { |
| 526 SetupForGenericSnapshotCreation(); | 521 SetupForGenericSnapshotCreation(); |
| 527 CreateAndWriteSnapshot(); | 522 CreateAndWriteSnapshot(); |
| 528 } | 523 } |
| 529 return 0; | 524 return 0; |
| 530 } | 525 } |
| OLD | NEW |