| 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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 if (write_magic_number) { | 1092 if (write_magic_number) { |
| 1093 // Write the magic number to indicate file is a script snapshot. | 1093 // Write the magic number to indicate file is a script snapshot. |
| 1094 DartUtils::WriteMagicNumber(file); | 1094 DartUtils::WriteMagicNumber(file); |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 if (!file->WriteFully(buffer, size)) { | 1097 if (!file->WriteFully(buffer, size)) { |
| 1098 ErrorExit(kErrorExitCode, | 1098 ErrorExit(kErrorExitCode, |
| 1099 "Unable to open file %s for writing snapshot\n", | 1099 "Unable to open file %s for writing snapshot\n", |
| 1100 qualified_filename); | 1100 qualified_filename); |
| 1101 } | 1101 } |
| 1102 delete file; | 1102 file->Release(); |
| 1103 if (concat != NULL) { | 1103 if (concat != NULL) { |
| 1104 delete concat; | 1104 delete concat; |
| 1105 } | 1105 } |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 | 1108 |
| 1109 static void ReadSnapshotFile(const char* snapshot_directory, | 1109 static void ReadSnapshotFile(const char* snapshot_directory, |
| 1110 const char* filename, | 1110 const char* filename, |
| 1111 const uint8_t** buffer) { | 1111 const uint8_t** buffer) { |
| 1112 char* concat = NULL; | 1112 char* concat = NULL; |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 Platform::Exit(Process::GlobalExitCode()); | 1699 Platform::Exit(Process::GlobalExitCode()); |
| 1700 } | 1700 } |
| 1701 | 1701 |
| 1702 } // namespace bin | 1702 } // namespace bin |
| 1703 } // namespace dart | 1703 } // namespace dart |
| 1704 | 1704 |
| 1705 int main(int argc, char** argv) { | 1705 int main(int argc, char** argv) { |
| 1706 dart::bin::main(argc, argv); | 1706 dart::bin::main(argc, argv); |
| 1707 UNREACHABLE(); | 1707 UNREACHABLE(); |
| 1708 } | 1708 } |
| OLD | NEW |