OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <string.h> | 6 #include <string.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "platform/globals.h" | 29 #include "platform/globals.h" |
30 #include "platform/growable_array.h" | 30 #include "platform/growable_array.h" |
31 #include "platform/hashmap.h" | 31 #include "platform/hashmap.h" |
32 #include "platform/text_buffer.h" | 32 #include "platform/text_buffer.h" |
33 #if !defined(DART_PRECOMPILER) | 33 #if !defined(DART_PRECOMPILER) |
34 #include "zlib/zlib.h" | 34 #include "zlib/zlib.h" |
35 #endif | 35 #endif |
36 | 36 |
37 #include "vm/kernel.h" | 37 #include "vm/kernel.h" |
38 | 38 |
| 39 extern "C" { |
| 40 extern const uint8_t kDartVmSnapshotData[]; |
| 41 extern const uint8_t kDartVmSnapshotInstructions[]; |
| 42 extern const uint8_t kDartCoreIsolateSnapshotData[]; |
| 43 extern const uint8_t kDartCoreIsolateSnapshotInstructions[]; |
| 44 } |
| 45 |
39 namespace dart { | 46 namespace dart { |
40 namespace bin { | 47 namespace bin { |
41 | 48 |
42 // Snapshot pieces if we link in a snapshot, otherwise initialized to NULL. | 49 // Snapshot pieces if we link in a snapshot, otherwise initialized to NULL. |
43 extern const uint8_t* vm_snapshot_data; | 50 #if defined(DART_NO_SNAPSHOT) |
44 extern const uint8_t* vm_snapshot_instructions; | 51 const uint8_t* vm_snapshot_data = NULL; |
45 extern const uint8_t* core_isolate_snapshot_data; | 52 const uint8_t* vm_snapshot_instructions = NULL; |
46 extern const uint8_t* core_isolate_snapshot_instructions; | 53 const uint8_t* core_isolate_snapshot_data = NULL; |
| 54 const uint8_t* core_isolate_snapshot_instructions = NULL; |
| 55 #else |
| 56 const uint8_t* vm_snapshot_data = kDartVmSnapshotData; |
| 57 const uint8_t* vm_snapshot_instructions = kDartVmSnapshotInstructions; |
| 58 const uint8_t* core_isolate_snapshot_data = kDartCoreIsolateSnapshotData; |
| 59 const uint8_t* core_isolate_snapshot_instructions = kDartVmSnapshotInstructions; |
| 60 #endif |
47 | 61 |
48 /** | 62 /** |
49 * Global state used to control and store generation of application snapshots | 63 * Global state used to control and store generation of application snapshots |
50 * An application snapshot can be generated and run using the following | 64 * An application snapshot can be generated and run using the following |
51 * command | 65 * command |
52 * dart --snapshot-kind=app-jit --snapshot=<app_snapshot_filename> | 66 * dart --snapshot-kind=app-jit --snapshot=<app_snapshot_filename> |
53 * <script_uri> [<script_options>] | 67 * <script_uri> [<script_options>] |
54 * To Run the application snapshot generated above, use : | 68 * To Run the application snapshot generated above, use : |
55 * dart <app_snapshot_filename> [<script_options>] | 69 * dart <app_snapshot_filename> [<script_options>] |
56 */ | 70 */ |
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 Platform::Exit(Process::GlobalExitCode()); | 1772 Platform::Exit(Process::GlobalExitCode()); |
1759 } | 1773 } |
1760 | 1774 |
1761 } // namespace bin | 1775 } // namespace bin |
1762 } // namespace dart | 1776 } // namespace dart |
1763 | 1777 |
1764 int main(int argc, char** argv) { | 1778 int main(int argc, char** argv) { |
1765 dart::bin::main(argc, argv); | 1779 dart::bin::main(argc, argv); |
1766 UNREACHABLE(); | 1780 UNREACHABLE(); |
1767 } | 1781 } |
OLD | NEW |