| 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/file-utils.h" | 10 #include "src/base/file-utils.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace | 81 } // namespace |
| 82 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 82 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 83 | 83 |
| 84 | 84 |
| 85 void InitializeExternalStartupData(const char* directory_path) { | 85 void InitializeExternalStartupData(const char* directory_path) { |
| 86 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 86 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 87 char* natives; | 87 char* natives; |
| 88 char* snapshot; | 88 char* snapshot; |
| 89 LoadFromFiles( | 89 LoadFromFiles(RelativePath(&natives, directory_path, "natives_blob.bin"), |
| 90 base::RelativePath(&natives, directory_path, "natives_blob.bin"), | 90 RelativePath(&snapshot, directory_path, "snapshot_blob.bin")); |
| 91 base::RelativePath(&snapshot, directory_path, "snapshot_blob.bin")); | |
| 92 free(natives); | 91 free(natives); |
| 93 free(snapshot); | 92 free(snapshot); |
| 94 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 93 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 95 } | 94 } |
| 96 | 95 |
| 97 | 96 |
| 98 void InitializeExternalStartupData(const char* natives_blob, | 97 void InitializeExternalStartupData(const char* natives_blob, |
| 99 const char* snapshot_blob) { | 98 const char* snapshot_blob) { |
| 100 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 99 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 101 LoadFromFiles(natives_blob, snapshot_blob); | 100 LoadFromFiles(natives_blob, snapshot_blob); |
| 102 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 101 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 103 } | 102 } |
| 104 | 103 |
| 105 } // namespace internal | 104 } // namespace internal |
| 106 } // namespace v8 | 105 } // namespace v8 |
| OLD | NEW |