| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/startup-data-util.h" | 5 #include "src/startup-data-util.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
| 11 #include "src/base/platform/platform.h" | 11 #include "src/base/platform/platform.h" |
| 12 #include "src/flags.h" | |
| 13 #include "src/utils.h" | 12 #include "src/utils.h" |
| 14 | 13 |
| 15 | 14 |
| 16 namespace v8 { | 15 namespace v8 { |
| 17 namespace internal { | 16 namespace internal { |
| 18 | 17 |
| 19 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 18 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 20 | 19 |
| 21 namespace { | 20 namespace { |
| 22 | 21 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 100 |
| 102 } // namespace | 101 } // namespace |
| 103 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 102 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 104 | 103 |
| 105 | 104 |
| 106 void InitializeExternalStartupData(const char* directory_path) { | 105 void InitializeExternalStartupData(const char* directory_path) { |
| 107 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 106 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 108 char* natives; | 107 char* natives; |
| 109 char* snapshot; | 108 char* snapshot; |
| 110 LoadFromFiles(RelativePath(&natives, directory_path, "natives_blob.bin"), | 109 LoadFromFiles(RelativePath(&natives, directory_path, "natives_blob.bin"), |
| 111 RelativePath(&snapshot, directory_path, | 110 RelativePath(&snapshot, directory_path, "snapshot_blob.bin")); |
| 112 FLAG_ignition ? "snapshot_blob_ignition.bin" | |
| 113 : "snapshot_blob.bin")); | |
| 114 free(natives); | 111 free(natives); |
| 115 free(snapshot); | 112 free(snapshot); |
| 116 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 113 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 117 } | 114 } |
| 118 | 115 |
| 119 | 116 |
| 120 void InitializeExternalStartupData(const char* natives_blob, | 117 void InitializeExternalStartupData(const char* natives_blob, |
| 121 const char* snapshot_blob) { | 118 const char* snapshot_blob) { |
| 122 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 119 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 123 LoadFromFiles(natives_blob, snapshot_blob); | 120 LoadFromFiles(natives_blob, snapshot_blob); |
| 124 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 121 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 125 } | 122 } |
| 126 | 123 |
| 127 } // namespace internal | 124 } // namespace internal |
| 128 } // namespace v8 | 125 } // namespace v8 |
| OLD | NEW |