| 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 arm and mips when possible. | 431 // TODO(regis): Reenable this code for mips when possible. |
| 432 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 432 #if defined(TARGET_ARCH_IA32) || \ |
| 433 defined(TARGET_ARCH_X64) || \ |
| 434 defined(TARGET_ARCH_ARM) |
| 433 Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary); | 435 Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary); |
| 434 VerifyLoaded(library); | 436 VerifyLoaded(library); |
| 435 #endif | 437 #endif |
| 436 } | 438 } |
| 437 | 439 |
| 438 | 440 |
| 439 int main(int argc, char** argv) { | 441 int main(int argc, char** argv) { |
| 440 CommandLineOptions vm_options(argc); | 442 CommandLineOptions vm_options(argc); |
| 441 | 443 |
| 442 // Initialize the URL mapping array. | 444 // Initialize the URL mapping array. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 CreateAndWriteSnapshot(); | 521 CreateAndWriteSnapshot(); |
| 520 | 522 |
| 521 Dart_EnterIsolate(UriResolverIsolateScope::isolate); | 523 Dart_EnterIsolate(UriResolverIsolateScope::isolate); |
| 522 Dart_ShutdownIsolate(); | 524 Dart_ShutdownIsolate(); |
| 523 } else { | 525 } else { |
| 524 SetupForGenericSnapshotCreation(); | 526 SetupForGenericSnapshotCreation(); |
| 525 CreateAndWriteSnapshot(); | 527 CreateAndWriteSnapshot(); |
| 526 } | 528 } |
| 527 return 0; | 529 return 0; |
| 528 } | 530 } |
| OLD | NEW |